Section 1
//ObjectController (alternativa.engine3d.controllers.ObjectController)
package alternativa.engine3d.controllers {
import flash.events.*;
import alternativa.engine3d.core.*;
import alternativa.types.*;
import alternativa.engine3d.physics.*;
import flash.display.*;
import alternativa.utils.*;
import flash.utils.*;
import alternativa.engine3d.*;
public class ObjectController {
protected var _enabled:Boolean;// = true
protected var keyBindings:Map;
protected var _mouseSensitivity:Number;// = 1
protected var _keyboardEnabled:Boolean;
protected var _right:Boolean;
protected var _speedMultiplier:Number;// = 2
public var onStopMoving:Function;
protected var _up:Boolean;
protected var _coords:Point3D;
protected var _speed:Number;// = 100
protected var _yawRight:Boolean;
protected var _collider:EllipsoidCollider;
protected var _object:Object3D;
protected var _mouseSensitivityX:Number;
protected var _mouseSensitivityY:Number;
protected var startMouseCoords:Point3D;
protected var _eventsSource:DisplayObject;
protected var _yawSpeed:Number;// = 1
protected var _accelerate:Boolean;
protected var _down:Boolean;
protected var _pitchDown:Boolean;
protected var _forward:Boolean;
protected var _mouseCoefficientX:Number;
protected var _mouseCoefficientY:Number;
protected var _pitchSpeed:Number;// = 1
protected var _isMoving:Boolean;
public var checkCollisions:Boolean;
protected var _mouseEnabled:Boolean;
protected var _pitchUp:Boolean;
protected var _back:Boolean;
protected var _mouseLookActive:Boolean;
protected var _yawLeft:Boolean;
protected var actionBindings:Map;
protected var _left:Boolean;
protected var lastFrameTime:uint;
public var onStartMoving:Function;
private var _displacement:Point3D;
public static const ACTION_PITCH_UP:String = "ACTION_PITCH_UP";
public static const ACTION_UP:String = "ACTION_UP";
public static const ACTION_MOUSE_LOOK:String = "ACTION_MOUSE_LOOK";
public static const ACTION_PITCH_DOWN:String = "ACTION_PITCH_DOWN";
public static const ACTION_DOWN:String = "ACTION_DOWN";
public static const ACTION_YAW_LEFT:String = "ACTION_YAW_LEFT";
public static const ACTION_LEFT:String = "ACTION_LEFT";
public static const ACTION_YAW_RIGHT:String = "ACTION_YAW_RIGHT";
public static const ACTION_RIGHT:String = "ACTION_RIGHT";
public static const ACTION_BACK:String = "ACTION_BACK";
public static const ACTION_FORWARD:String = "ACTION_FORWARD";
public static const ACTION_ACCELERATE:String = "ACTION_ACCELERATE";
public function ObjectController(_arg1:DisplayObject){
startMouseCoords = new Point3D();
keyBindings = new Map();
actionBindings = new Map();
_mouseSensitivityY = (Math.PI / 360);
_mouseSensitivityX = (Math.PI / 360);
_mouseCoefficientY = (_mouseSensitivity * _mouseSensitivityY);
_mouseCoefficientX = (_mouseSensitivity * _mouseSensitivityX);
_coords = new Point3D();
_collider = new EllipsoidCollider();
_displacement = new Point3D();
super();
if (_arg1 == null){
throw (new ArgumentError((ObjectUtils.getClassName(this) + ": eventsSourceObject is null")));
};
_eventsSource = _arg1;
actionBindings[ACTION_FORWARD] = moveForward;
actionBindings[ACTION_BACK] = moveBack;
actionBindings[ACTION_LEFT] = moveLeft;
actionBindings[ACTION_RIGHT] = moveRight;
actionBindings[ACTION_UP] = moveUp;
actionBindings[ACTION_DOWN] = moveDown;
actionBindings[ACTION_PITCH_UP] = pitchUp;
actionBindings[ACTION_PITCH_DOWN] = pitchDown;
actionBindings[ACTION_YAW_LEFT] = yawLeft;
actionBindings[ACTION_YAW_RIGHT] = yawRight;
actionBindings[ACTION_ACCELERATE] = accelerate;
actionBindings[ACTION_MOUSE_LOOK] = setMouseLook;
keyboardEnabled = true;
mouseEnabled = true;
}
public function pitchDown(_arg1:Boolean):void{
_pitchDown = _arg1;
}
public function moveDown(_arg1:Boolean):void{
_down = _arg1;
}
public function yawLeft(_arg1:Boolean):void{
_yawLeft = _arg1;
}
public function get yawSpeed():Number{
return (_yawSpeed);
}
public function get coords():Point3D{
return (_coords.clone());
}
public function get accelerated():Boolean{
return (_accelerate);
}
public function setDefaultBindings():void{
}
public function set yawSpeed(_arg1:Number):void{
_yawSpeed = _arg1;
}
public function unbindKey(_arg1:uint):void{
keyBindings.remove(_arg1);
}
protected function stopMouseLook():void{
}
public function set coords(_arg1:Point3D):void{
_coords.copy(_arg1);
setObjectCoords();
}
public function get object():Object3D{
return (_object);
}
protected function unregisterKeyboardListeners():void{
clearCommandFlags();
_eventsSource.removeEventListener(KeyboardEvent.KEY_DOWN, onKeyboardEvent);
_eventsSource.removeEventListener(KeyboardEvent.KEY_UP, onKeyboardEvent);
}
public function get speed():Number{
return (_speed);
}
public function get enabled():Boolean{
return (_enabled);
}
public function readCoords(_arg1:Point3D):void{
_arg1.copy(_coords);
}
public function moveBack(_arg1:Boolean):void{
_back = _arg1;
}
public function get keyboardEnabled():Boolean{
return (_keyboardEnabled);
}
public function moveUp(_arg1:Boolean):void{
_up = _arg1;
}
private function onKeyboardEvent(_arg1:KeyboardEvent):void{
var _local2:Function = keyBindings[_arg1.keyCode];
if (_local2 != null){
_local2.call(this, (_arg1.type == KeyboardEvent.KEY_DOWN));
};
}
public function get speedMultiplier():Number{
return (_speedMultiplier);
}
public function unbindAll():void{
keyBindings.clear();
}
private function onMouseUp(_arg1:MouseEvent):void{
setMouseLook(false);
_eventsSource.stage.removeEventListener(MouseEvent.MOUSE_UP, onMouseUp);
}
public function moveLeft(_arg1:Boolean):void{
_left = _arg1;
}
public function set mouseSensitivity(_arg1:Number):void{
_mouseSensitivity = _arg1;
_mouseCoefficientY = (_mouseSensitivity * _mouseSensitivityY);
_mouseCoefficientX = (_mouseSensitivity * _mouseSensitivityX);
}
protected function unregisterMouseListeners():void{
_eventsSource.removeEventListener(MouseEvent.MOUSE_DOWN, onMouseDown);
_eventsSource.stage.removeEventListener(MouseEvent.MOUSE_UP, onMouseUp);
}
public function set object(_arg1:Object3D):void{
_object = _arg1;
_collider.scene = ((_object == null)) ? null : _object.scene;
setObjectCoords();
}
public function set enabled(_arg1:Boolean):void{
_enabled = _arg1;
if (_enabled){
if (_mouseEnabled){
registerMouseListeners();
};
if (_keyboardEnabled){
registerKeyboardListeners();
};
} else {
if (_mouseEnabled){
unregisterMouseListeners();
setMouseLook(false);
};
if (_keyboardEnabled){
unregisterKeyboardListeners();
};
};
}
public function set speed(_arg1:Number):void{
_speed = ((_arg1 < 0)) ? -(_arg1) : _arg1;
}
protected function rotateObject(_arg1:Number):void{
}
protected function getDisplacement(_arg1:Number, _arg2:Point3D):void{
}
public function processInput():void{
if (((!(_enabled)) || ((_object == null)))){
return;
};
var _local1:Number = (getTimer() - lastFrameTime);
if (_local1 == 0){
return;
};
lastFrameTime = (lastFrameTime + _local1);
if (_local1 > 100){
_local1 = 100;
};
_local1 = (_local1 / 1000);
rotateObject(_local1);
getDisplacement(_local1, _displacement);
applyDisplacement(_local1, _displacement);
if (((_object.changeRotationOrScaleOperation.queued) || (_object.changeCoordsOperation.queued))){
if (!_isMoving){
_isMoving = true;
if (onStartMoving != null){
onStartMoving.call(this);
};
};
} else {
if (_isMoving){
_isMoving = false;
if (onStopMoving != null){
onStopMoving.call(this);
};
};
};
}
protected function registerMouseListeners():void{
_eventsSource.addEventListener(MouseEvent.MOUSE_DOWN, onMouseDown);
}
public function setMouseLook(_arg1:Boolean):void{
if (_mouseLookActive != _arg1){
_mouseLookActive = _arg1;
if (_mouseLookActive){
startMouseLook();
} else {
stopMouseLook();
};
};
}
protected function applyDisplacement(_arg1:Number, _arg2:Point3D):void{
}
protected function startMouseLook():void{
startMouseCoords.x = _eventsSource.stage.mouseX;
startMouseCoords.y = _eventsSource.stage.mouseY;
}
public function moveForward(_arg1:Boolean):void{
_forward = _arg1;
}
protected function registerKeyboardListeners():void{
_eventsSource.addEventListener(KeyboardEvent.KEY_DOWN, onKeyboardEvent);
_eventsSource.addEventListener(KeyboardEvent.KEY_UP, onKeyboardEvent);
}
public function set mouseEnabled(_arg1:Boolean):void{
if (_mouseEnabled != _arg1){
_mouseEnabled = _arg1;
if (_mouseEnabled){
if (_enabled){
registerMouseListeners();
};
} else {
unregisterMouseListeners();
};
};
}
public function get mouseSensitivity():Number{
return (_mouseSensitivity);
}
protected function setObjectCoords():void{
if (_object != null){
_object.coords = _coords;
};
}
public function set mouseSensitivityY(_arg1:Number):void{
_mouseSensitivityY = _arg1;
_mouseCoefficientY = (_mouseSensitivity * _mouseSensitivityY);
}
public function set pitchSpeed(_arg1:Number):void{
_pitchSpeed = _arg1;
}
public function set speedMultiplier(_arg1:Number):void{
_speedMultiplier = _arg1;
}
public function moveRight(_arg1:Boolean):void{
_right = _arg1;
}
public function set mouseSensitivityX(_arg1:Number):void{
_mouseSensitivityX = _arg1;
_mouseCoefficientX = (_mouseSensitivity * _mouseSensitivityX);
}
public function set keyboardEnabled(_arg1:Boolean):void{
if (_keyboardEnabled != _arg1){
_keyboardEnabled = _arg1;
if (_keyboardEnabled){
if (_enabled){
registerKeyboardListeners();
};
} else {
unregisterKeyboardListeners();
};
};
}
public function get mouseEnabled():Boolean{
return (_mouseEnabled);
}
public function accelerate(_arg1:Boolean):void{
_accelerate = _arg1;
}
public function get mouseSensitivityX():Number{
return (_mouseSensitivityX);
}
public function get mouseSensitivityY():Number{
return (_mouseSensitivityY);
}
private function onMouseDown(_arg1:MouseEvent):void{
setMouseLook(true);
_eventsSource.stage.addEventListener(MouseEvent.MOUSE_UP, onMouseUp);
}
public function get pitchSpeed():Number{
return (_pitchSpeed);
}
public function bindKey(_arg1:uint, _arg2:String):void{
var _local3:Function = actionBindings[_arg2];
if (_local3 != null){
keyBindings[_arg1] = _local3;
};
}
public function yawRight(_arg1:Boolean):void{
_yawRight = _arg1;
}
protected function clearCommandFlags():void{
_forward = false;
_back = false;
_left = false;
_right = false;
_up = false;
_down = false;
_pitchUp = false;
_pitchDown = false;
_yawLeft = false;
_yawRight = false;
_accelerate = false;
_mouseLookActive = false;
}
public function get collider():EllipsoidCollider{
return (_collider);
}
public function pitchUp(_arg1:Boolean):void{
_pitchUp = _arg1;
}
}
}//package alternativa.engine3d.controllers
Section 2
//WalkController (alternativa.engine3d.controllers.WalkController)
package alternativa.engine3d.controllers {
import alternativa.engine3d.core.*;
import alternativa.types.*;
import alternativa.engine3d.physics.*;
import flash.display.*;
import alternativa.utils.*;
public class WalkController extends ObjectController {
private var _airControlCoefficient:Number;// = 1
private var _objectZPosition:Number;// = 0.5
private var destination:Point3D;
private var tmpVelocity:Point3D;
private var _onGround:Boolean;
private var _currentSpeed:Number;// = 0
public var jumpSpeed:Number;// = 0
private var _groundMesh:Mesh;
private var collision:Collision;
public var gravity:Number;// = 0
private var minGroundCos:Number;
private var controlsActive:Boolean;
private var velocity:Point3D;
private var startRotX:Number;
public var speedThreshold:Number;// = 1
private var startRotZ:Number;
private var currentMouseCoords:Point3D;
private var prevMouseCoords:Point3D;
private var inJump:Boolean;
private var _flyMode:Boolean;
public function WalkController(_arg1:DisplayObject){
minGroundCos = Math.cos(MathUtils.toRadian(70));
destination = new Point3D();
collision = new Collision();
velocity = new Point3D();
tmpVelocity = new Point3D();
prevMouseCoords = new Point3D();
currentMouseCoords = new Point3D();
super(_arg1);
}
public function get airControlCoefficient():Number{
return (_airControlCoefficient);
}
public function set airControlCoefficient(_arg1:Number):void{
_airControlCoefficient = ((_arg1 > 0)) ? _arg1 : -(_arg1);
}
public function get maxGroundAngle():Number{
return (Math.acos(minGroundCos));
}
override public function set enabled(_arg1:Boolean):void{
super.enabled = _arg1;
if (!_arg1){
velocity.reset();
_currentSpeed = 0;
};
}
override protected function getDisplacement(_arg1:Number, _arg2:Point3D):void{
var _local4:Number;
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local9:Matrix3D;
var _local10:Number;
var _local11:Number;
var _local12:Number;
var _local13:Number;
var _local3:Number = 0;
if (((checkCollisions) && (!(_flyMode)))){
_arg2.x = 0;
_arg2.y = 0;
_arg2.z = (((-0.5 * gravity) * _arg1) * _arg1);
if (_collider.getCollision(_coords, _arg2, collision)){
_local3 = collision.normal.z;
_groundMesh = collision.face._mesh;
} else {
_groundMesh = null;
};
};
_onGround = (_local3 > minGroundCos);
if (((_onGround) && (inJump))){
inJump = false;
};
controlsActive = ((((((((((_forward) || (_back))) || (_right))) || (_left))) || (_up))) || (_down));
if (controlsActive){
if (_flyMode){
tmpVelocity.x = 0;
tmpVelocity.y = 0;
tmpVelocity.z = 0;
if (_forward){
tmpVelocity.y = 1;
} else {
if (_back){
tmpVelocity.y = -1;
};
};
if (_right){
tmpVelocity.x = 1;
} else {
if (_left){
tmpVelocity.x = -1;
};
};
if (_up){
tmpVelocity.z = 1;
} else {
if (_down){
tmpVelocity.z = -1;
};
};
_local9 = _object._transformation;
_local5 = tmpVelocity.x;
if ((_object is Camera3D)){
_local6 = -(tmpVelocity.z);
_local7 = tmpVelocity.y;
} else {
_local6 = tmpVelocity.y;
_local7 = tmpVelocity.z;
};
velocity.x = (velocity.x + ((((_local5 * _local9.a) + (_local6 * _local9.b)) + (_local7 * _local9.c)) * _speed));
velocity.y = (velocity.y + ((((_local5 * _local9.e) + (_local6 * _local9.f)) + (_local7 * _local9.g)) * _speed));
velocity.z = (velocity.z + ((((_local5 * _local9.i) + (_local6 * _local9.j)) + (_local7 * _local9.k)) * _speed));
} else {
_local10 = _object.rotationZ;
_local11 = Math.cos(_local10);
_local12 = Math.sin(_local10);
_local13 = _speed;
if (((!((gravity == 0))) && (!(_onGround)))){
_local13 = (_local13 * _airControlCoefficient);
};
if (_forward){
velocity.x = (velocity.x - (_local13 * _local12));
velocity.y = (velocity.y + (_local13 * _local11));
} else {
if (_back){
velocity.x = (velocity.x + (_local13 * _local12));
velocity.y = (velocity.y - (_local13 * _local11));
};
};
if (_right){
velocity.x = (velocity.x + (_local13 * _local11));
velocity.y = (velocity.y + (_local13 * _local12));
} else {
if (_left){
velocity.x = (velocity.x - (_local13 * _local11));
velocity.y = (velocity.y - (_local13 * _local12));
};
};
if (gravity == 0){
if (_up){
velocity.z = (velocity.z + _speed);
} else {
if (_down){
velocity.z = (velocity.z - _speed);
};
};
};
};
} else {
_local4 = (1 / Math.pow(3, (_arg1 * 10)));
if (((_flyMode) || ((gravity == 0)))){
velocity.x = (velocity.x * _local4);
velocity.y = (velocity.y * _local4);
velocity.z = (velocity.z * _local4);
} else {
if (_onGround){
velocity.x = (velocity.x * _local4);
velocity.y = (velocity.y * _local4);
if (velocity.z < 0){
velocity.z = (velocity.z * _local4);
};
} else {
if ((((_local3 > 0)) && ((velocity.z > 0)))){
velocity.z = 0;
};
};
};
};
if (((((_onGround) && (_up))) && (!(inJump)))){
velocity.z = jumpSpeed;
inJump = true;
_onGround = false;
_local3 = 0;
};
if (!((_flyMode) || (_onGround))){
velocity.z = (velocity.z - (gravity * _arg1));
};
var _local8:Number = (_accelerate) ? (_speed * _speedMultiplier) : _speed;
if (((_flyMode) || ((gravity == 0)))){
_local4 = velocity.length;
if (_local4 > _local8){
velocity.length = _local8;
};
} else {
_local4 = Math.sqrt(((velocity.x * velocity.x) + (velocity.y * velocity.y)));
if (_local4 > _local8){
velocity.x = (velocity.x * (_local8 / _local4));
velocity.y = (velocity.y * (_local8 / _local4));
};
if ((((_local3 > 0)) && ((velocity.z > 0)))){
velocity.z = 0;
};
};
_arg2.x = (velocity.x * _arg1);
_arg2.y = (velocity.y * _arg1);
_arg2.z = (velocity.z * _arg1);
}
public function set objectZPosition(_arg1:Number):void{
_objectZPosition = _arg1;
setObjectCoords();
}
public function set maxGroundAngle(_arg1:Number):void{
minGroundCos = Math.cos(_arg1);
}
public function get groundMesh():Mesh{
return (_groundMesh);
}
override protected function startMouseLook():void{
super.startMouseLook();
startRotX = ((_object is Camera3D)) ? (_object.rotationX + MathUtils.DEG90) : _object.rotationX;
startRotZ = _object.rotationZ;
}
override protected function applyDisplacement(_arg1:Number, _arg2:Point3D):void{
if (checkCollisions){
_collider.calculateDestination(_coords, _arg2, destination);
_arg2.x = (destination.x - _coords.x);
_arg2.y = (destination.y - _coords.y);
_arg2.z = (destination.z - _coords.z);
} else {
destination.x = (_coords.x + _arg2.x);
destination.y = (_coords.y + _arg2.y);
destination.z = (_coords.z + _arg2.z);
};
velocity.x = (_arg2.x / _arg1);
velocity.y = (_arg2.y / _arg1);
velocity.z = (_arg2.z / _arg1);
_coords.x = destination.x;
_coords.y = destination.y;
_coords.z = destination.z;
setObjectCoords();
var _local3:Number = Math.sqrt((((velocity.x * velocity.x) + (velocity.y * velocity.y)) + (velocity.z * velocity.z)));
if (_local3 < speedThreshold){
velocity.x = 0;
velocity.y = 0;
velocity.z = 0;
_currentSpeed = 0;
} else {
_currentSpeed = _local3;
};
}
public function lookAt(_arg1:Point3D):void{
if (_object == null){
return;
};
var _local2:Number = (_arg1.x - _object.x);
var _local3:Number = (_arg1.y - _object.y);
var _local4:Number = (_arg1.z - _object.z);
_object.rotationX = (Math.atan2(_local4, Math.sqrt(((_local2 * _local2) + (_local3 * _local3)))) - ((_object is Camera3D)) ? MathUtils.DEG90 : 0);
_object.rotationY = 0;
_object.rotationZ = -(Math.atan2(_local2, _local3));
}
override public function setDefaultBindings():void{
unbindAll();
bindKey(KeyboardUtils.W, ACTION_FORWARD);
bindKey(KeyboardUtils.S, ACTION_BACK);
bindKey(KeyboardUtils.A, ACTION_LEFT);
bindKey(KeyboardUtils.D, ACTION_RIGHT);
bindKey(KeyboardUtils.SPACE, ACTION_UP);
bindKey(KeyboardUtils.Z, ACTION_DOWN);
bindKey(KeyboardUtils.UP, ACTION_PITCH_UP);
bindKey(KeyboardUtils.DOWN, ACTION_PITCH_DOWN);
bindKey(KeyboardUtils.LEFT, ACTION_YAW_LEFT);
bindKey(KeyboardUtils.RIGHT, ACTION_YAW_RIGHT);
bindKey(KeyboardUtils.SHIFT, ACTION_ACCELERATE);
bindKey(KeyboardUtils.M, ACTION_MOUSE_LOOK);
}
public function get flyMode():Boolean{
return (_flyMode);
}
override protected function setObjectCoords():void{
if (_object != null){
_object.x = _coords.x;
_object.y = _coords.y;
_object.z = (_coords.z + (((2 * _objectZPosition) - 1) * _collider.radiusZ));
};
}
public function get objectZPosition():Number{
return (_objectZPosition);
}
public function get onGround():Boolean{
return (_onGround);
}
public function set flyMode(_arg1:Boolean):void{
_flyMode = _arg1;
}
override protected function rotateObject(_arg1:Number):void{
var _local2:Number;
if (_mouseLookActive){
prevMouseCoords.copy(currentMouseCoords);
currentMouseCoords.x = _eventsSource.stage.mouseX;
currentMouseCoords.y = _eventsSource.stage.mouseY;
if (!prevMouseCoords.equals(currentMouseCoords)){
_object.rotationZ = (startRotZ + ((startMouseCoords.x - currentMouseCoords.x) * _mouseCoefficientX));
_local2 = (startRotX + ((startMouseCoords.y - currentMouseCoords.y) * _mouseCoefficientY));
if ((_object is Camera3D)){
_object.rotationX = ((_local2)>MathUtils.DEG90) ? 0 : ((_local2)<-(MathUtils.DEG90)) ? -(Math.PI) : (_local2 - MathUtils.DEG90);
} else {
_object.rotationX = ((_local2)>MathUtils.DEG90) ? MathUtils.DEG90 : ((_local2)<-(MathUtils.DEG90)) ? -(MathUtils.DEG90) : _local2;
};
};
};
if (_yawLeft){
_object.rotationZ = (_object.rotationZ + (_yawSpeed * _arg1));
} else {
if (_yawRight){
_object.rotationZ = (_object.rotationZ - (_yawSpeed * _arg1));
};
};
_local2 = NaN;
if (_pitchUp){
_local2 = (_object.rotationX + (_pitchSpeed * _arg1));
} else {
if (_pitchDown){
_local2 = (_object.rotationX - (_pitchSpeed * _arg1));
};
};
if (!isNaN(_local2)){
if ((_object is Camera3D)){
_object.rotationX = ((_local2)>0) ? 0 : ((_local2)<-(Math.PI)) ? -(Math.PI) : _local2;
} else {
_object.rotationX = ((_local2)>MathUtils.DEG90) ? MathUtils.DEG90 : ((_local2)<-(MathUtils.DEG90)) ? -(MathUtils.DEG90) : _local2;
};
};
}
public function get currentSpeed():Number{
return (_currentSpeed);
}
}
}//package alternativa.engine3d.controllers
Section 3
//BSPNode (alternativa.engine3d.core.BSPNode)
package alternativa.engine3d.core {
import alternativa.types.*;
import alternativa.engine3d.*;
public final class BSPNode {
alternativa3d var primitive:PolyPrimitive;
alternativa3d var normal:Point3D;
alternativa3d var front:BSPNode;
alternativa3d var parent:BSPNode;
alternativa3d var mobility:int;// = 2147483647
alternativa3d var offset:Number;
alternativa3d var back:BSPNode;
alternativa3d var backPrimitives:Set;
alternativa3d var frontPrimitives:Set;
alternativa3d var sprited:Boolean;
private static var collector:Array = new Array();
public function BSPNode(){
normal = new Point3D();
super();
}
alternativa3d static function createBSPNode(_arg1:PolyPrimitive):BSPNode{
var _local2:BSPNode;
_local2 = collector.pop();
if (_local2 == null){
_local2 = new (BSPNode);
};
_local2.primitive = _arg1;
_arg1.node = _local2;
if (_arg1.face == null){
_local2.normal.x = 0;
_local2.normal.y = 0;
_local2.normal.z = 0;
_local2.offset = 0;
_local2.sprited = true;
} else {
_local2.normal.copy(_arg1.face.globalNormal);
_local2.offset = _arg1.face.globalOffset;
_local2.sprited = false;
};
_local2.mobility = _arg1.mobility;
return (_local2);
}
alternativa3d static function destroyBSPNode(_arg1:BSPNode):void{
collector.push(_arg1);
}
}
}//package alternativa.engine3d.core
Section 4
//Camera3D (alternativa.engine3d.core.Camera3D)
package alternativa.engine3d.core {
import alternativa.types.*;
import alternativa.engine3d.display.*;
import alternativa.engine3d.materials.*;
import flash.geom.*;
import alternativa.engine3d.*;
public class Camera3D extends Object3D {
private var topPlane:Point3D;
alternativa3d var _fov:Number;// = 1.5707963267949
alternativa3d var _orthographic:Boolean;// = false
private var spritePrimitives:Array;
private var viewAngle:Number;
alternativa3d var uvMatricesCalculated:Set;
alternativa3d var _farClipping:Boolean;// = false
alternativa3d var cameraMatrix:Matrix3D;
private var topOffset:Number;
alternativa3d var calculatePlanesOperation:Operation;
private var firstSkin:Skin;
alternativa3d var _farClippingDistance:Number;// = 1000
private var prevSkin:Skin;
alternativa3d var calculateMatrixOperation:Operation;
alternativa3d var _viewClipping:Boolean;// = true
alternativa3d var renderOperation:Operation;
private var fullDraw:Boolean;
private var leftOffset:Number;
private var direction:Point3D;
alternativa3d var _view:View;
private var farPlane:Point3D;
private var textureA:Point3D;
private var textureB:Point3D;
private var textureC:Point3D;
private var farOffset:Number;
private var leftPlane:Point3D;
private var currentSkin:Skin;
private var bottomOffset:Number;
private var rightPlane:Point3D;
alternativa3d var focalLength:Number;
private var points1:Array;
private var points2:Array;
alternativa3d var _zoom:Number;// = 1
private var spritePoint:Point3D;
private var rightOffset:Number;
private var nearOffset:Number;
alternativa3d var _nearClipping:Boolean;// = false
alternativa3d var focalDistortion:Number;
private var bottomPlane:Point3D;
alternativa3d var _nearClippingDistance:Number;// = 10
private static var counter:uint = 0;
public function Camera3D(_arg1:String=null){
calculateMatrixOperation = new Operation("calculateMatrix", this, calculateMatrix, Operation.CAMERA_CALCULATE_MATRIX);
calculatePlanesOperation = new Operation("calculatePlanes", this, calculatePlanes, Operation.CAMERA_CALCULATE_PLANES);
renderOperation = new Operation("render", this, render, Operation.CAMERA_RENDER);
uvMatricesCalculated = new Set(true);
textureA = new Point3D();
textureB = new Point3D();
textureC = new Point3D();
direction = new Point3D(0, 0, 1);
cameraMatrix = new Matrix3D();
leftPlane = new Point3D();
rightPlane = new Point3D();
topPlane = new Point3D();
bottomPlane = new Point3D();
farPlane = new Point3D();
points1 = new Array();
points2 = new Array();
spritePoint = new Point3D();
spritePrimitives = new Array();
super(_arg1);
}
alternativa3d function removeFromView(_arg1:View):void{
firstSkin = null;
calculateTransformationOperation.removeSequel(calculateMatrixOperation);
calculateMatrixOperation.removeSequel(calculatePlanesOperation);
calculatePlanesOperation.removeSequel(renderOperation);
if (_scene != null){
_scene.removeOperation(calculateMatrixOperation);
_scene.removeOperation(calculatePlanesOperation);
_scene.removeOperation(renderOperation);
_scene.changePrimitivesOperation.removeSequel(renderOperation);
};
_view = null;
}
public function get nearClipping():Boolean{
return (_nearClipping);
}
public function set nearClipping(_arg1:Boolean):void{
if (_nearClipping != _arg1){
_nearClipping = _arg1;
addOperationToScene(calculatePlanesOperation);
};
}
private function insertCurrentSkin():void{
var _local1:Skin = Skin.createSkin();
_view.canvas.addChildAt(_local1, _view.canvas.getChildIndex(currentSkin));
_local1.nextSkin = currentSkin;
if (prevSkin == null){
firstSkin = _local1;
} else {
prevSkin.nextSkin = _local1;
};
currentSkin = _local1;
}
public function get nearClippingDistance():Number{
return (_nearClippingDistance);
}
public function set farClippingDistance(_arg1:Number):void{
if (_arg1 < 0){
_arg1 = 0;
};
if (_farClippingDistance != _arg1){
_farClippingDistance = _arg1;
addOperationToScene(calculatePlanesOperation);
};
}
alternativa3d function calculateUVMatrix(_arg1:Face, _arg2:uint, _arg3:uint):void{
var _local4:Point3D = _arg1.primitive.points[0];
textureA.x = (((cameraMatrix.a * _local4.x) + (cameraMatrix.b * _local4.y)) + (cameraMatrix.c * _local4.z));
textureA.y = (((cameraMatrix.e * _local4.x) + (cameraMatrix.f * _local4.y)) + (cameraMatrix.g * _local4.z));
_local4 = _arg1.primitive.points[1];
textureB.x = (((cameraMatrix.a * _local4.x) + (cameraMatrix.b * _local4.y)) + (cameraMatrix.c * _local4.z));
textureB.y = (((cameraMatrix.e * _local4.x) + (cameraMatrix.f * _local4.y)) + (cameraMatrix.g * _local4.z));
_local4 = _arg1.primitive.points[2];
textureC.x = (((cameraMatrix.a * _local4.x) + (cameraMatrix.b * _local4.y)) + (cameraMatrix.c * _local4.z));
textureC.y = (((cameraMatrix.e * _local4.x) + (cameraMatrix.f * _local4.y)) + (cameraMatrix.g * _local4.z));
var _local5:Number = (textureB.x - textureA.x);
var _local6:Number = (textureB.y - textureA.y);
var _local7:Number = (textureC.x - textureA.x);
var _local8:Number = (textureC.y - textureA.y);
var _local9:Matrix = _arg1.uvMatrixBase;
var _local10:Matrix = _arg1.uvMatrix;
_local10.a = (((_local9.a * _local5) + (_local9.b * _local7)) / _arg2);
_local10.b = (((_local9.a * _local6) + (_local9.b * _local8)) / _arg2);
_local10.c = (-(((_local9.c * _local5) + (_local9.d * _local7))) / _arg3);
_local10.d = (-(((_local9.c * _local6) + (_local9.d * _local8))) / _arg3);
_local10.tx = (((((_local9.tx + _local9.c) * _local5) + ((_local9.ty + _local9.d) * _local7)) + textureA.x) + cameraMatrix.d);
_local10.ty = (((((_local9.tx + _local9.c) * _local6) + ((_local9.ty + _local9.d) * _local8)) + textureA.y) + cameraMatrix.h);
uvMatricesCalculated[_arg1] = true;
}
public function get orthographic():Boolean{
return (_orthographic);
}
private function addCurrentSkin():void{
currentSkin = Skin.createSkin();
_view.canvas.addChild(currentSkin);
if (prevSkin == null){
firstSkin = currentSkin;
} else {
prevSkin.nextSkin = currentSkin;
};
}
public function get farClippingDistance():Number{
return (_farClippingDistance);
}
public function set nearClippingDistance(_arg1:Number):void{
if (_arg1 < 0){
_arg1 = 0;
};
if (_nearClippingDistance != _arg1){
_nearClippingDistance = _arg1;
addOperationToScene(calculatePlanesOperation);
};
}
override protected function clonePropertiesFrom(_arg1:Object3D):void{
super.clonePropertiesFrom(_arg1);
var _local2:Camera3D = Camera3D(_arg1);
orthographic = _local2._orthographic;
zoom = _local2._zoom;
fov = _local2._fov;
}
public function set viewClipping(_arg1:Boolean):void{
if (_viewClipping != _arg1){
_viewClipping = _arg1;
addOperationToScene(calculatePlanesOperation);
};
}
public function set view(_arg1:View):void{
if (_arg1 != _view){
if (_view != null){
_view.camera = null;
};
if (_arg1 != null){
_arg1.camera = this;
};
};
}
private function drawSpriteSkin(_arg1:SpritePrimitive):void{
var _local2:Sprite3D;
var _local3:SpriteMaterial;
if (((((((!(fullDraw)) && (!((currentSkin == null))))) && ((currentSkin.primitive == _arg1)))) && (!(_scene.changedPrimitives[_arg1])))){
prevSkin = currentSkin;
currentSkin = currentSkin.nextSkin;
} else {
_local2 = _arg1.sprite;
_local3 = _local2._material;
if (_local3 == null){
return;
};
if (!_local3.canDraw(this)){
return;
};
if (((fullDraw) || (_scene.changedPrimitives[_arg1]))){
if (currentSkin == null){
addCurrentSkin();
} else {
if (((fullDraw) || (_scene.changedPrimitives[currentSkin.primitive]))){
currentSkin.material.clear(currentSkin);
} else {
insertCurrentSkin();
};
};
currentSkin.primitive = _arg1;
currentSkin.material = _local3;
_local3.draw(this, currentSkin);
prevSkin = currentSkin;
currentSkin = currentSkin.nextSkin;
} else {
while (((!((currentSkin == null))) && (_scene.changedPrimitives[currentSkin.primitive]))) {
removeCurrentSkin();
};
if (currentSkin != null){
prevSkin = currentSkin;
currentSkin = currentSkin.nextSkin;
};
};
};
}
private function clip(_arg1:uint, _arg2:Array, _arg3:Array, _arg4:Point3D, _arg5:Number, _arg6:Boolean):uint{
var _local7:uint;
var _local8:Number;
var _local10:DrawPoint;
var _local11:DrawPoint;
var _local12:DrawPoint;
var _local13:Number;
var _local14:Number;
var _local9:uint;
_local11 = _arg2[(_arg1 - 1)];
_local13 = ((((_arg4.x * _local11.x) + (_arg4.y * _local11.y)) + (_arg4.z * _local11.z)) - _arg5);
if (_arg6){
_local7 = 0;
while (_local7 < _arg1) {
_local12 = _arg2[_local7];
_local14 = ((((_arg4.x * _local12.x) + (_arg4.y * _local12.y)) + (_arg4.z * _local12.z)) - _arg5);
if (_local14 > 0){
if (_local13 <= 0){
_local8 = (_local14 / (_local14 - _local13));
_local10 = _arg3[_local9];
if (_local10 == null){
_local10 = new DrawPoint((_local12.x - ((_local12.x - _local11.x) * _local8)), (_local12.y - ((_local12.y - _local11.y) * _local8)), (_local12.z - ((_local12.z - _local11.z) * _local8)), (_local12.u - ((_local12.u - _local11.u) * _local8)), (_local12.v - ((_local12.v - _local11.v) * _local8)));
_arg3[_local9] = _local10;
} else {
_local10.x = (_local12.x - ((_local12.x - _local11.x) * _local8));
_local10.y = (_local12.y - ((_local12.y - _local11.y) * _local8));
_local10.z = (_local12.z - ((_local12.z - _local11.z) * _local8));
_local10.u = (_local12.u - ((_local12.u - _local11.u) * _local8));
_local10.v = (_local12.v - ((_local12.v - _local11.v) * _local8));
};
_local9++;
};
_local10 = _arg3[_local9];
if (_local10 == null){
_local10 = new DrawPoint(_local12.x, _local12.y, _local12.z, _local12.u, _local12.v);
_arg3[_local9] = _local10;
} else {
_local10.x = _local12.x;
_local10.y = _local12.y;
_local10.z = _local12.z;
_local10.u = _local12.u;
_local10.v = _local12.v;
};
_local9++;
} else {
if (_local13 > 0){
_local8 = (_local14 / (_local14 - _local13));
_local10 = _arg3[_local9];
if (_local10 == null){
_local10 = new DrawPoint((_local12.x - ((_local12.x - _local11.x) * _local8)), (_local12.y - ((_local12.y - _local11.y) * _local8)), (_local12.z - ((_local12.z - _local11.z) * _local8)), (_local12.u - ((_local12.u - _local11.u) * _local8)), (_local12.v - ((_local12.v - _local11.v) * _local8)));
_arg3[_local9] = _local10;
} else {
_local10.x = (_local12.x - ((_local12.x - _local11.x) * _local8));
_local10.y = (_local12.y - ((_local12.y - _local11.y) * _local8));
_local10.z = (_local12.z - ((_local12.z - _local11.z) * _local8));
_local10.u = (_local12.u - ((_local12.u - _local11.u) * _local8));
_local10.v = (_local12.v - ((_local12.v - _local11.v) * _local8));
};
_local9++;
};
};
_local13 = _local14;
_local11 = _local12;
_local7++;
};
} else {
_local7 = 0;
while (_local7 < _arg1) {
_local12 = _arg2[_local7];
_local14 = ((((_arg4.x * _local12.x) + (_arg4.y * _local12.y)) + (_arg4.z * _local12.z)) - _arg5);
if (_local14 > 0){
if (_local13 <= 0){
_local8 = (_local14 / (_local14 - _local13));
_local10 = _arg3[_local9];
if (_local10 == null){
_local10 = new DrawPoint((_local12.x - ((_local12.x - _local11.x) * _local8)), (_local12.y - ((_local12.y - _local11.y) * _local8)), (_local12.z - ((_local12.z - _local11.z) * _local8)));
_arg3[_local9] = _local10;
} else {
_local10.x = (_local12.x - ((_local12.x - _local11.x) * _local8));
_local10.y = (_local12.y - ((_local12.y - _local11.y) * _local8));
_local10.z = (_local12.z - ((_local12.z - _local11.z) * _local8));
};
_local9++;
};
_local10 = _arg3[_local9];
if (_local10 == null){
_local10 = new DrawPoint(_local12.x, _local12.y, _local12.z);
_arg3[_local9] = _local10;
} else {
_local10.x = _local12.x;
_local10.y = _local12.y;
_local10.z = _local12.z;
};
_local9++;
} else {
if (_local13 > 0){
_local8 = (_local14 / (_local14 - _local13));
_local10 = _arg3[_local9];
if (_local10 == null){
_local10 = new DrawPoint((_local12.x - ((_local12.x - _local11.x) * _local8)), (_local12.y - ((_local12.y - _local11.y) * _local8)), (_local12.z - ((_local12.z - _local11.z) * _local8)));
_arg3[_local9] = _local10;
} else {
_local10.x = (_local12.x - ((_local12.x - _local11.x) * _local8));
_local10.y = (_local12.y - ((_local12.y - _local11.y) * _local8));
_local10.z = (_local12.z - ((_local12.z - _local11.z) * _local8));
};
_local9++;
};
};
_local13 = _local14;
_local11 = _local12;
_local7++;
};
};
return (_local9);
}
override protected function createEmptyObject():Object3D{
return (new Camera3D());
}
public function set orthographic(_arg1:Boolean):void{
if (_orthographic != _arg1){
addOperationToScene(calculateMatrixOperation);
_orthographic = _arg1;
};
}
private function renderBSPNode(_arg1:BSPNode):void{
var _local2:*;
var _local3:Point3D;
var _local4:Number;
var _local5:Number;
if (_arg1 != null){
if (_arg1.sprited){
if (_arg1.primitive != null){
drawSpriteSkin((_arg1.primitive as SpritePrimitive));
} else {
drawSpritePrimitives(_arg1.frontPrimitives);
};
} else {
_local3 = _arg1.normal;
_local4 = (((direction.x * _local3.x) + (direction.y * _local3.y)) + (direction.z * _local3.z));
if (!_orthographic){
_local5 = ((((globalCoords.x * _local3.x) + (globalCoords.y * _local3.y)) + (globalCoords.z * _local3.z)) - _arg1.offset);
};
if (_arg1.primitive != null){
if ((_orthographic) ? (_local4 < 0) : (_local5 > 0)){
if (((_orthographic) || ((_local4 < viewAngle)))){
renderBSPNode(_arg1.back);
drawSkin(_arg1.primitive);
};
renderBSPNode(_arg1.front);
} else {
if (((_orthographic) || ((_local4 > -(viewAngle))))){
renderBSPNode(_arg1.front);
};
renderBSPNode(_arg1.back);
};
} else {
if ((_orthographic) ? (_local4 < 0) : (_local5 > 0)){
if (((_orthographic) || ((_local4 < viewAngle)))){
renderBSPNode(_arg1.back);
for (_local2 in _arg1.frontPrimitives) {
drawSkin(_local2);
};
};
renderBSPNode(_arg1.front);
} else {
if (((_orthographic) || ((_local4 > -(viewAngle))))){
renderBSPNode(_arg1.front);
for (_local2 in _arg1.backPrimitives) {
drawSkin(_local2);
};
};
renderBSPNode(_arg1.back);
};
};
};
};
}
override protected function defaultName():String{
return (("camera" + ++counter));
}
private function drawSpritePrimitives(_arg1:Set):void{
var _local2:SpritePrimitive;
var _local4:*;
var _local6:Point3D;
var _local7:Number;
var _local3 = -1;
for (_local4 in _arg1) {
_local2 = _local4;
_local6 = _local2.sprite.globalCoords;
_local7 = ((((cameraMatrix.i * _local6.x) + (cameraMatrix.j * _local6.y)) + (cameraMatrix.k * _local6.z)) + cameraMatrix.l);
_local2.screenDepth = _local7;
++_local3;
var _local10 = _local3;
spritePrimitives[_local10] = _local2;
};
if (_local3 > 0){
sortSpritePrimitives(0, _local3);
};
var _local5:int = _local3;
while (_local5 >= 0) {
drawSpriteSkin(spritePrimitives[_local5]);
_local5--;
};
}
private function removeCurrentSkin():void{
var _local1:Skin = currentSkin.nextSkin;
_view.canvas.removeChild(currentSkin);
if (currentSkin.material != null){
currentSkin.material.clear(currentSkin);
};
currentSkin.nextSkin = null;
currentSkin.primitive = null;
currentSkin.material = null;
Skin.destroySkin(currentSkin);
currentSkin = _local1;
if (prevSkin == null){
firstSkin = currentSkin;
} else {
prevSkin.nextSkin = currentSkin;
};
}
public function get viewClipping():Boolean{
return (_viewClipping);
}
public function set fov(_arg1:Number):void{
_arg1 = ((_arg1)<0) ? 0 : ((_arg1)>(Math.PI - 0.0001)) ? (Math.PI - 0.0001) : _arg1;
if (_fov != _arg1){
if (!_orthographic){
addOperationToScene(calculatePlanesOperation);
};
_fov = _arg1;
};
}
private function calculatePlanes():void{
var _local9:Number;
var _local10:Number;
var _local11:Number;
var _local12:Number;
var _local13:Number;
var _local14:Number;
var _local15:Number;
var _local16:Number;
var _local17:Number;
var _local18:Number;
var _local19:Number;
var _local20:Number;
var _local21:Number;
var _local22:Number;
var _local23:Number;
var _local24:Number;
var _local25:Number;
var _local26:Number;
var _local27:Number;
var _local28:Number;
var _local29:Number;
var _local1:Number = (_view._width * 0.5);
var _local2:Number = (_view._height * 0.5);
var _local3:Number = (_transformation.a * _local1);
var _local4:Number = (_transformation.e * _local1);
var _local5:Number = (_transformation.i * _local1);
var _local6:Number = (_transformation.b * _local2);
var _local7:Number = (_transformation.f * _local2);
var _local8:Number = (_transformation.j * _local2);
if (_orthographic){
if (_viewClipping){
_local3 = (_local3 / _zoom);
_local4 = (_local4 / _zoom);
_local5 = (_local5 / _zoom);
_local6 = (_local6 / _zoom);
_local7 = (_local7 / _zoom);
_local8 = (_local8 / _zoom);
leftPlane.x = ((_transformation.f * _transformation.k) - (_transformation.j * _transformation.g));
leftPlane.y = ((_transformation.j * _transformation.c) - (_transformation.b * _transformation.k));
leftPlane.z = ((_transformation.b * _transformation.g) - (_transformation.f * _transformation.c));
leftOffset = ((((_transformation.d - _local3) * leftPlane.x) + ((_transformation.h - _local4) * leftPlane.y)) + ((_transformation.l - _local5) * leftPlane.z));
rightPlane.x = -(leftPlane.x);
rightPlane.y = -(leftPlane.y);
rightPlane.z = -(leftPlane.z);
rightOffset = ((((_transformation.d + _local3) * rightPlane.x) + ((_transformation.h + _local4) * rightPlane.y)) + ((_transformation.l + _local5) * rightPlane.z));
topPlane.x = ((_transformation.g * _transformation.i) - (_transformation.k * _transformation.e));
topPlane.y = ((_transformation.k * _transformation.a) - (_transformation.c * _transformation.i));
topPlane.z = ((_transformation.c * _transformation.e) - (_transformation.g * _transformation.a));
topOffset = ((((_transformation.d - _local6) * topPlane.x) + ((_transformation.h - _local7) * topPlane.y)) + ((_transformation.l - _local8) * topPlane.z));
bottomPlane.x = -(topPlane.x);
bottomPlane.y = -(topPlane.y);
bottomPlane.z = -(topPlane.z);
bottomOffset = ((((_transformation.d + _local6) * bottomPlane.x) + ((_transformation.h + _local7) * bottomPlane.y)) + ((_transformation.l + _local8) * bottomPlane.z));
};
} else {
focalLength = ((Math.sqrt(((_view._width * _view._width) + (_view._height * _view._height))) * 0.5) / Math.tan((0.5 * _fov)));
focalDistortion = (1 / (focalLength * focalLength));
if (_viewClipping){
_local13 = (_transformation.c * focalLength);
_local14 = (_transformation.g * focalLength);
_local15 = (_transformation.k * focalLength);
_local16 = ((-(_local3) - _local6) + _local13);
_local17 = ((-(_local4) - _local7) + _local14);
_local18 = ((-(_local5) - _local8) + _local15);
_local19 = ((_local3 - _local6) + _local13);
_local20 = ((_local4 - _local7) + _local14);
_local21 = ((_local5 - _local8) + _local15);
_local22 = ((-(_local3) + _local6) + _local13);
_local23 = ((-(_local4) + _local7) + _local14);
_local24 = ((-(_local5) + _local8) + _local15);
_local25 = ((_local3 + _local6) + _local13);
_local26 = ((_local4 + _local7) + _local14);
_local27 = ((_local5 + _local8) + _local15);
leftPlane.x = ((_local23 * _local18) - (_local24 * _local17));
leftPlane.y = ((_local24 * _local16) - (_local22 * _local18));
leftPlane.z = ((_local22 * _local17) - (_local23 * _local16));
leftOffset = (((_transformation.d * leftPlane.x) + (_transformation.h * leftPlane.y)) + (_transformation.l * leftPlane.z));
rightPlane.x = ((_local20 * _local27) - (_local21 * _local26));
rightPlane.y = ((_local21 * _local25) - (_local19 * _local27));
rightPlane.z = ((_local19 * _local26) - (_local20 * _local25));
rightOffset = (((_transformation.d * rightPlane.x) + (_transformation.h * rightPlane.y)) + (_transformation.l * rightPlane.z));
topPlane.x = ((_local17 * _local21) - (_local18 * _local20));
topPlane.y = ((_local18 * _local19) - (_local16 * _local21));
topPlane.z = ((_local16 * _local20) - (_local17 * _local19));
topOffset = (((_transformation.d * topPlane.x) + (_transformation.h * topPlane.y)) + (_transformation.l * topPlane.z));
bottomPlane.x = ((_local26 * _local24) - (_local27 * _local23));
bottomPlane.y = ((_local27 * _local22) - (_local25 * _local24));
bottomPlane.z = ((_local25 * _local23) - (_local26 * _local22));
bottomOffset = (((_transformation.d * bottomPlane.x) + (_transformation.h * bottomPlane.y)) + (_transformation.l * bottomPlane.z));
_local28 = Math.sqrt((((_local16 * _local16) + (_local17 * _local17)) + (_local18 * _local18)));
_local16 = (_local16 / _local28);
_local17 = (_local17 / _local28);
_local18 = (_local18 / _local28);
_local28 = Math.sqrt((((_local19 * _local19) + (_local20 * _local20)) + (_local21 * _local21)));
_local19 = (_local19 / _local28);
_local20 = (_local20 / _local28);
_local21 = (_local21 / _local28);
_local28 = Math.sqrt((((_local22 * _local22) + (_local23 * _local23)) + (_local24 * _local24)));
_local22 = (_local22 / _local28);
_local23 = (_local23 / _local28);
_local24 = (_local24 / _local28);
_local28 = Math.sqrt((((_local25 * _local25) + (_local26 * _local26)) + (_local27 * _local27)));
_local25 = (_local25 / _local28);
_local26 = (_local26 / _local28);
_local27 = (_local27 / _local28);
viewAngle = (((_local16 * direction.x) + (_local17 * direction.y)) + (_local18 * direction.z));
_local29 = (((_local19 * direction.x) + (_local20 * direction.y)) + (_local21 * direction.z));
viewAngle = ((_local29)<viewAngle) ? _local29 : viewAngle;
_local29 = (((_local22 * direction.x) + (_local23 * direction.y)) + (_local24 * direction.z));
viewAngle = ((_local29)<viewAngle) ? _local29 : viewAngle;
_local29 = (((_local25 * direction.x) + (_local26 * direction.y)) + (_local27 * direction.z));
viewAngle = ((_local29)<viewAngle) ? _local29 : viewAngle;
viewAngle = Math.sin(Math.acos(viewAngle));
} else {
viewAngle = 1;
};
};
if (_nearClipping){
if (_orthographic){
_local12 = (_nearClippingDistance / _zoom);
_local9 = ((_transformation.c * _local12) + _transformation.d);
_local10 = ((_transformation.g * _local12) + _transformation.h);
_local11 = ((_transformation.k * _local12) + _transformation.l);
} else {
_local9 = ((_transformation.c * _nearClippingDistance) + _transformation.d);
_local10 = ((_transformation.g * _nearClippingDistance) + _transformation.h);
_local11 = ((_transformation.k * _nearClippingDistance) + _transformation.l);
};
nearOffset = (((direction.x * _local9) + (direction.y * _local10)) + (direction.z * _local11));
};
if (_farClipping){
if (_orthographic){
_local12 = (_farClippingDistance / _zoom);
_local9 = ((_transformation.c * _local12) + _transformation.d);
_local10 = ((_transformation.g * _local12) + _transformation.h);
_local11 = ((_transformation.k * _local12) + _transformation.l);
} else {
_local9 = ((_transformation.c * _farClippingDistance) + _transformation.d);
_local10 = ((_transformation.g * _farClippingDistance) + _transformation.h);
_local11 = ((_transformation.k * _farClippingDistance) + _transformation.l);
};
farPlane.x = -(direction.x);
farPlane.y = -(direction.y);
farPlane.z = -(direction.z);
farOffset = (((farPlane.x * _local9) + (farPlane.y * _local10)) + (farPlane.z * _local11));
};
}
public function set zoom(_arg1:Number):void{
_arg1 = ((_arg1)<0) ? 0 : _arg1;
if (_zoom != _arg1){
if (_orthographic){
addOperationToScene(calculateMatrixOperation);
};
_zoom = _arg1;
};
}
public function get view():View{
return (_view);
}
private function render():void{
fullDraw = ((calculateMatrixOperation.queued) || (calculatePlanesOperation.queued));
uvMatricesCalculated.clear();
prevSkin = null;
currentSkin = firstSkin;
renderBSPNode(_scene.bsp);
while (currentSkin != null) {
removeCurrentSkin();
};
if (_view._interactive){
_view.checkMouseOverOut(true);
};
}
alternativa3d function addToView(_arg1:View):void{
firstSkin = ((_arg1.canvas.numChildren)>0) ? Skin(_arg1.canvas.getChildAt(0)) : null;
calculateTransformationOperation.addSequel(calculateMatrixOperation);
calculateMatrixOperation.addSequel(calculatePlanesOperation);
calculatePlanesOperation.addSequel(renderOperation);
if (_scene != null){
_scene.addOperation(calculateMatrixOperation);
_scene.changePrimitivesOperation.addSequel(renderOperation);
};
_view = _arg1;
}
private function calculateMatrix():void{
cameraMatrix.copy(_transformation);
cameraMatrix.invert();
if (_orthographic){
cameraMatrix.scale(_zoom, _zoom, _zoom);
};
direction.x = _transformation.c;
direction.y = _transformation.g;
direction.z = _transformation.k;
direction.normalize();
}
public function get fov():Number{
return (_fov);
}
private function sortSpritePrimitives(_arg1:int, _arg2:int):void{
var _local5:SpritePrimitive;
var _local7:SpritePrimitive;
var _local3:int = _arg1;
var _local4:int = _arg2;
var _local6:Number = spritePrimitives[((_arg2 + _arg1) >> 1)].screenDepth;
do {
while ((_local5 = spritePrimitives[_local3]).screenDepth < _local6) {
_local3++;
};
while (_local6 < (_local7 = spritePrimitives[_local4]).screenDepth) {
_local4--;
};
if (_local3 <= _local4){
var _temp1 = _local3;
_local3 = (_local3 + 1);
var _local8 = _temp1;
spritePrimitives[_local8] = _local7;
var _temp2 = _local4;
_local4 = (_local4 - 1);
var _local9 = _temp2;
spritePrimitives[_local9] = _local5;
};
} while (_local3 <= _local4);
if (_arg1 < _local4){
sortSpritePrimitives(_arg1, _local4);
};
if (_local3 < _arg2){
sortSpritePrimitives(_local3, _arg2);
};
}
public function get zoom():Number{
return (_zoom);
}
override protected function removeFromScene(_arg1:Scene3D):void{
super.removeFromScene(_arg1);
_arg1.removeOperation(calculateMatrixOperation);
_arg1.removeOperation(calculatePlanesOperation);
_arg1.removeOperation(renderOperation);
if (_view != null){
_arg1.changePrimitivesOperation.removeSequel(renderOperation);
};
}
private function drawSkin(_arg1:PolyPrimitive):void{
var _local2:Surface;
var _local3:SurfaceMaterial;
var _local4:uint;
var _local5:uint;
var _local6:Point3D;
var _local7:Point;
var _local8:DrawPoint;
var _local9:Boolean;
var _local10:Array;
var _local11:Number;
var _local12:Number;
var _local13:Number;
if (((((((!(fullDraw)) && (!((currentSkin == null))))) && ((currentSkin.primitive == _arg1)))) && (!(_scene.changedPrimitives[_arg1])))){
prevSkin = currentSkin;
currentSkin = currentSkin.nextSkin;
} else {
_local2 = _arg1.face._surface;
if (_local2 == null){
return;
};
_local3 = _local2._material;
if ((((_local3 == null)) || (!(_local3.canDraw(_arg1))))){
return;
};
_local5 = _arg1.num;
_local9 = ((((!(_orthographic)) && (_local3.useUV))) && (_arg1.face.uvMatrixBase));
if (_local9){
_local4 = 0;
while (_local4 < _local5) {
_local6 = _arg1.points[_local4];
_local7 = _arg1.uvs[_local4];
_local8 = points1[_local4];
if (_local8 == null){
points1[_local4] = new DrawPoint(_local6.x, _local6.y, _local6.z, _local7.x, _local7.y);
} else {
_local8.x = _local6.x;
_local8.y = _local6.y;
_local8.z = _local6.z;
_local8.u = _local7.x;
_local8.v = _local7.y;
};
_local4++;
};
} else {
_local4 = 0;
while (_local4 < _local5) {
_local6 = _arg1.points[_local4];
_local8 = points1[_local4];
if (_local8 == null){
points1[_local4] = new DrawPoint(_local6.x, _local6.y, _local6.z);
} else {
_local8.x = _local6.x;
_local8.y = _local6.y;
_local8.z = _local6.z;
};
_local4++;
};
};
if (_viewClipping){
_local5 = clip(_local5, points1, points2, leftPlane, leftOffset, _local9);
if (_local5 < 3){
return;
};
_local5 = clip(_local5, points2, points1, rightPlane, rightOffset, _local9);
if (_local5 < 3){
return;
};
_local5 = clip(_local5, points1, points2, topPlane, topOffset, _local9);
if (_local5 < 3){
return;
};
_local5 = clip(_local5, points2, points1, bottomPlane, bottomOffset, _local9);
if (_local5 < 3){
return;
};
};
if (((_farClipping) && (_nearClipping))){
_local5 = clip(_local5, points1, points2, farPlane, farOffset, _local9);
if (_local5 < 3){
return;
};
_local5 = clip(_local5, points2, points1, direction, nearOffset, _local9);
if (_local5 < 3){
return;
};
} else {
if (_farClipping){
_local5 = clip(_local5, points1, points2, farPlane, farOffset, _local9);
if (_local5 < 3){
return;
};
_local10 = points1;
points1 = points2;
points2 = _local10;
} else {
if (_nearClipping){
_local5 = clip(_local5, points1, points2, direction, nearOffset, _local9);
if (_local5 < 3){
return;
};
_local10 = points1;
points1 = points2;
points2 = _local10;
};
};
};
if (((fullDraw) || (_scene.changedPrimitives[_arg1]))){
if (currentSkin == null){
addCurrentSkin();
} else {
if (((fullDraw) || (_scene.changedPrimitives[currentSkin.primitive]))){
currentSkin.material.clear(currentSkin);
} else {
insertCurrentSkin();
};
};
_local4 = 0;
while (_local4 < _local5) {
_local8 = points1[_local4];
_local11 = _local8.x;
_local12 = _local8.y;
_local13 = _local8.z;
_local8.x = ((((cameraMatrix.a * _local11) + (cameraMatrix.b * _local12)) + (cameraMatrix.c * _local13)) + cameraMatrix.d);
_local8.y = ((((cameraMatrix.e * _local11) + (cameraMatrix.f * _local12)) + (cameraMatrix.g * _local13)) + cameraMatrix.h);
_local8.z = ((((cameraMatrix.i * _local11) + (cameraMatrix.j * _local12)) + (cameraMatrix.k * _local13)) + cameraMatrix.l);
_local4++;
};
currentSkin.primitive = _arg1;
currentSkin.material = _local3;
_local3.draw(this, currentSkin, _local5, points1);
prevSkin = currentSkin;
currentSkin = currentSkin.nextSkin;
} else {
while (((!((currentSkin == null))) && (_scene.changedPrimitives[currentSkin.primitive]))) {
removeCurrentSkin();
};
if (currentSkin != null){
prevSkin = currentSkin;
currentSkin = currentSkin.nextSkin;
};
};
};
}
public function set farClipping(_arg1:Boolean):void{
if (_farClipping != _arg1){
_farClipping = _arg1;
addOperationToScene(calculatePlanesOperation);
};
}
override protected function addToScene(_arg1:Scene3D):void{
super.addToScene(_arg1);
if (_view != null){
_arg1.addOperation(calculatePlanesOperation);
_arg1.changePrimitivesOperation.addSequel(renderOperation);
};
}
public function get farClipping():Boolean{
return (_farClipping);
}
}
}//package alternativa.engine3d.core
Section 5
//Face (alternativa.engine3d.core.Face)
package alternativa.engine3d.core {
import flash.events.*;
import alternativa.types.*;
import flash.geom.*;
import alternativa.engine3d.*;
public final class Face implements IEventDispatcher {
alternativa3d var _aUV:Point;
alternativa3d var _cUV:Point;
alternativa3d var globalOffset:Number;
alternativa3d var _verticesCount:uint;
alternativa3d var calculateUVOperation:Operation;
private var dispatcher:EventDispatcher;
alternativa3d var uvMatrixBase:Matrix;
alternativa3d var updateMaterialOperation:Operation;
alternativa3d var uvMatrix:Matrix;
alternativa3d var _bUV:Point;
alternativa3d var calculateFragmentsUVOperation:Operation;
alternativa3d var _mesh:Mesh;
alternativa3d var _vertices:Array;
public var mouseEnabled:Boolean;// = true
alternativa3d var primitive:PolyPrimitive;
alternativa3d var updatePrimitiveOperation:Operation;
alternativa3d var globalNormal:Point3D;
alternativa3d var _surface:Surface;
alternativa3d var calculateNormalOperation:Operation;
private static const uvThreshold:Number = 0.000347222222222222;
public function Face(_arg1:Array){
var _local3:Vertex;
calculateNormalOperation = new Operation("calculateNormal", this, calculateNormal, Operation.FACE_CALCULATE_NORMAL);
calculateUVOperation = new Operation("calculateUV", this, calculateUV, Operation.FACE_CALCULATE_UV);
updatePrimitiveOperation = new Operation("updatePrimitive", this, updatePrimitive, Operation.FACE_UPDATE_PRIMITIVE);
updateMaterialOperation = new Operation("updateMaterial", this, updateMaterial, Operation.FACE_UPDATE_MATERIAL);
calculateFragmentsUVOperation = new Operation("calculateFragmentsUV", this, calculateFragmentsUV, Operation.FACE_CALCULATE_FRAGMENTS_UV);
globalNormal = new Point3D();
super();
_vertices = _arg1;
_verticesCount = _arg1.length;
primitive = PolyPrimitive.createPolyPrimitive();
primitive.face = this;
primitive.num = _verticesCount;
var _local2:uint;
while (_local2 < _verticesCount) {
_local3 = _arg1[_local2];
primitive.points.push(_local3.globalCoords);
primitive.uvs.push(null);
_local3.addToFace(this);
_local2++;
};
calculateNormalOperation.addSequel(updatePrimitiveOperation);
calculateUVOperation.addSequel(calculateFragmentsUVOperation);
calculateUVOperation.addSequel(updateMaterialOperation);
}
private function calculatePrimitiveUV(_arg1:PolyPrimitive):void{
var _local2:Array;
var _local3:Array;
var _local4:Array;
var _local5:Array;
var _local6:Array;
var _local7:Array;
var _local8:uint;
var _local9:uint;
var _local10:Point3D;
var _local11:Point;
var _local12:Point;
var _local13:Point;
var _local14:Number;
var _local15:Boolean;
var _local16:uint;
var _local17:Boolean;
if (_arg1.backFragment != null){
_local2 = _arg1.points;
_local3 = _arg1.backFragment.points;
_local4 = _arg1.frontFragment.points;
_local5 = _arg1.uvs;
_local6 = _arg1.backFragment.uvs;
_local7 = _arg1.frontFragment.uvs;
_local8 = 0;
_local9 = 0;
_local15 = true;
_local16 = 0;
while (_local16 < _arg1.num) {
_local17 = true;
_local10 = _local2[_local16];
if (_local10 == _local4[_local9]){
if (_local7[_local9] == null){
_local7[_local9] = _local5[_local16];
};
_local17 = false;
_local9++;
};
if (_local10 == _local3[_local8]){
if (_local6[_local8] == null){
_local6[_local8] = _local5[_local16];
};
_local17 = false;
_local8++;
};
if (_local17){
_local12 = _local5[((_local16)==0) ? (_arg1.num - 1) : (_local16 - 1)];
_local13 = _local5[_local16];
_local14 = (_local15) ? _arg1.splitTime1 : _arg1.splitTime2;
_local11 = _local7[_local9];
if (_local11 == null){
_local11 = new Point((_local12.x + ((_local13.x - _local12.x) * _local14)), (_local12.y + ((_local13.y - _local12.y) * _local14)));
_local7[_local9] = _local11;
_local6[_local8] = _local11;
} else {
_local11.x = (_local12.x + ((_local13.x - _local12.x) * _local14));
_local11.y = (_local12.y + ((_local13.y - _local12.y) * _local14));
};
_local15 = false;
_local9++;
_local8++;
if (_local10 == _local4[_local9]){
if (_local7[_local9] == null){
_local7[_local9] = _local5[_local16];
};
_local9++;
};
if (_local10 == _local3[_local8]){
if (_local6[_local8] == null){
_local6[_local8] = _local5[_local16];
};
_local8++;
};
};
_local16++;
};
if (_local9 < _arg1.frontFragment.num){
_local12 = _local5[(_arg1.num - 1)];
_local13 = _local5[0];
_local14 = (_local15) ? _arg1.splitTime1 : _arg1.splitTime2;
_local11 = _local7[_local9];
if (_local11 == null){
_local11 = new Point((_local12.x + ((_local13.x - _local12.x) * _local14)), (_local12.y + ((_local13.y - _local12.y) * _local14)));
_local7[_local9] = _local11;
_local6[_local8] = _local11;
} else {
_local11.x = (_local12.x + ((_local13.x - _local12.x) * _local14));
_local11.y = (_local12.y + ((_local13.y - _local12.y) * _local14));
};
};
calculatePrimitiveUV(_arg1.backFragment);
calculatePrimitiveUV(_arg1.frontFragment);
};
}
private function calculateUV():void{
var _local1:uint;
var _local2:Point;
var _local3:Number;
var _local4:Number;
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:Number;
var _local9:Point3D;
var _local10:Point3D;
var _local11:Point3D;
var _local12:Number;
var _local13:Number;
var _local14:Number;
var _local15:Number;
var _local16:Number;
var _local17:Number;
var _local18:Number;
var _local19:Number;
var _local20:Point3D;
if (((((!((_aUV == null))) && (!((_bUV == null))))) && (!((_cUV == null))))){
_local3 = (_bUV.x - _aUV.x);
_local4 = (_bUV.y - _aUV.y);
_local5 = (_cUV.x - _aUV.x);
_local6 = (_cUV.y - _aUV.y);
_local7 = ((_local3 * _local6) - (_local4 * _local5));
if ((((_local7 < uvThreshold)) && ((_local7 > -(uvThreshold))))){
if ((((((((_local3 < uvThreshold)) && ((_local3 > -(uvThreshold))))) && ((_local4 < uvThreshold)))) && ((_local4 > -(uvThreshold))))){
if ((((((((_local5 < uvThreshold)) && ((_local5 > -(uvThreshold))))) && ((_local6 < uvThreshold)))) && ((_local6 > -(uvThreshold))))){
_local3 = uvThreshold;
_local6 = uvThreshold;
} else {
_local8 = Math.sqrt(((_local5 * _local5) + (_local6 * _local6)));
_local3 = ((uvThreshold * _local6) / _local8);
_local4 = ((-(uvThreshold) * _local5) / _local8);
};
} else {
if ((((((((_local5 < uvThreshold)) && ((_local5 > -(uvThreshold))))) && ((_local6 < uvThreshold)))) && ((_local6 > -(uvThreshold))))){
_local8 = Math.sqrt(((_local3 * _local3) + (_local4 * _local4)));
_local5 = ((-(uvThreshold) * _local4) / _local8);
_local6 = ((uvThreshold * _local3) / _local8);
} else {
_local8 = Math.sqrt(((_local3 * _local3) + (_local4 * _local4)));
_local5 = (_local5 + ((uvThreshold * _local4) / _local8));
_local6 = (_local6 - ((uvThreshold * _local3) / _local8));
};
};
_local7 = ((_local3 * _local6) - (_local4 * _local5));
primitive.uvs[0] = _aUV;
primitive.uvs[1] = new Point((_aUV.x + _local3), (_aUV.y + _local4));
primitive.uvs[2] = new Point((_aUV.x + _local5), (_aUV.y + _local6));
} else {
primitive.uvs[0] = _aUV;
primitive.uvs[1] = _bUV;
primitive.uvs[2] = _cUV;
};
if (uvMatrixBase == null){
uvMatrixBase = new Matrix();
uvMatrix = new Matrix();
};
uvMatrixBase.a = (_local6 / _local7);
uvMatrixBase.b = (-(_local4) / _local7);
uvMatrixBase.c = (-(_local5) / _local7);
uvMatrixBase.d = (_local3 / _local7);
uvMatrixBase.tx = -(((uvMatrixBase.a * _aUV.x) + (uvMatrixBase.c * _aUV.y)));
uvMatrixBase.ty = -(((uvMatrixBase.b * _aUV.x) + (uvMatrixBase.d * _aUV.y)));
if (_verticesCount > 3){
_local9 = primitive.points[0];
_local10 = primitive.points[1];
_local11 = primitive.points[2];
if (((globalNormal.x)<0) ? -(globalNormal.x) : globalNormal.x > ((globalNormal.y)<0) ? -(globalNormal.y) : globalNormal.y){
if (((globalNormal.x)<0) ? -(globalNormal.x) : globalNormal.x > ((globalNormal.z)<0) ? -(globalNormal.z) : globalNormal.z){
_local12 = (_local10.y - _local9.y);
_local13 = (_local10.z - _local9.z);
_local14 = (_local11.y - _local9.y);
_local15 = (_local11.z - _local9.z);
_local7 = ((_local12 * _local15) - (_local14 * _local13));
_local1 = 3;
while (_local1 < _verticesCount) {
_local20 = primitive.points[_local1];
_local16 = (_local20.y - _local9.y);
_local17 = (_local20.z - _local9.z);
_local18 = (((_local16 * _local15) - (_local14 * _local17)) / _local7);
_local19 = (((_local12 * _local17) - (_local16 * _local13)) / _local7);
_local2 = primitive.uvs[_local1];
if (_local2 == null){
_local2 = new Point();
primitive.uvs[_local1] = _local2;
};
_local2.x = ((_aUV.x + (_local3 * _local18)) + (_local5 * _local19));
_local2.y = ((_aUV.y + (_local4 * _local18)) + (_local6 * _local19));
_local1++;
};
} else {
_local12 = (_local10.x - _local9.x);
_local13 = (_local10.y - _local9.y);
_local14 = (_local11.x - _local9.x);
_local15 = (_local11.y - _local9.y);
_local7 = ((_local12 * _local15) - (_local14 * _local13));
_local1 = 3;
while (_local1 < _verticesCount) {
_local20 = primitive.points[_local1];
_local16 = (_local20.x - _local9.x);
_local17 = (_local20.y - _local9.y);
_local18 = (((_local16 * _local15) - (_local14 * _local17)) / _local7);
_local19 = (((_local12 * _local17) - (_local16 * _local13)) / _local7);
_local2 = primitive.uvs[_local1];
if (_local2 == null){
_local2 = new Point();
primitive.uvs[_local1] = _local2;
};
_local2.x = ((_aUV.x + (_local3 * _local18)) + (_local5 * _local19));
_local2.y = ((_aUV.y + (_local4 * _local18)) + (_local6 * _local19));
_local1++;
};
};
} else {
if (((globalNormal.y)<0) ? -(globalNormal.y) : globalNormal.y > ((globalNormal.z)<0) ? -(globalNormal.z) : globalNormal.z){
_local12 = (_local10.x - _local9.x);
_local13 = (_local10.z - _local9.z);
_local14 = (_local11.x - _local9.x);
_local15 = (_local11.z - _local9.z);
_local7 = ((_local12 * _local15) - (_local14 * _local13));
_local1 = 3;
while (_local1 < _verticesCount) {
_local20 = primitive.points[_local1];
_local16 = (_local20.x - _local9.x);
_local17 = (_local20.z - _local9.z);
_local18 = (((_local16 * _local15) - (_local14 * _local17)) / _local7);
_local19 = (((_local12 * _local17) - (_local16 * _local13)) / _local7);
_local2 = primitive.uvs[_local1];
if (_local2 == null){
_local2 = new Point();
primitive.uvs[_local1] = _local2;
};
_local2.x = ((_aUV.x + (_local3 * _local18)) + (_local5 * _local19));
_local2.y = ((_aUV.y + (_local4 * _local18)) + (_local6 * _local19));
_local1++;
};
} else {
_local12 = (_local10.x - _local9.x);
_local13 = (_local10.y - _local9.y);
_local14 = (_local11.x - _local9.x);
_local15 = (_local11.y - _local9.y);
_local7 = ((_local12 * _local15) - (_local14 * _local13));
_local1 = 3;
while (_local1 < _verticesCount) {
_local20 = primitive.points[_local1];
_local16 = (_local20.x - _local9.x);
_local17 = (_local20.y - _local9.y);
_local18 = (((_local16 * _local15) - (_local14 * _local17)) / _local7);
_local19 = (((_local12 * _local17) - (_local16 * _local13)) / _local7);
_local2 = primitive.uvs[_local1];
if (_local2 == null){
_local2 = new Point();
primitive.uvs[_local1] = _local2;
};
_local2.x = ((_aUV.x + (_local3 * _local18)) + (_local5 * _local19));
_local2.y = ((_aUV.y + (_local4 * _local18)) + (_local6 * _local19));
_local1++;
};
};
};
};
} else {
uvMatrixBase = null;
uvMatrix = null;
_local1 = 0;
while (_local1 < _verticesCount) {
primitive.uvs[_local1] = null;
_local1++;
};
};
}
alternativa3d function addToMesh(_arg1:Mesh):void{
_arg1.changeCoordsOperation.addSequel(updatePrimitiveOperation);
_arg1.changeRotationOrScaleOperation.addSequel(calculateNormalOperation);
_arg1.calculateMobilityOperation.addSequel(updatePrimitiveOperation);
_mesh = _arg1;
}
public function set aUV(_arg1:Point):void{
if (_aUV != null){
if (_arg1 != null){
if (!_aUV.equals(_arg1)){
_aUV.x = _arg1.x;
_aUV.y = _arg1.y;
if (_mesh != null){
_mesh.addOperationToScene(calculateUVOperation);
};
};
} else {
_aUV = null;
if (_mesh != null){
_mesh.addOperationToScene(calculateUVOperation);
};
};
} else {
if (_arg1 != null){
_aUV = _arg1.clone();
if (_mesh != null){
_mesh.addOperationToScene(calculateUVOperation);
};
};
};
}
public function set bUV(_arg1:Point):void{
if (_bUV != null){
if (_arg1 != null){
if (!_bUV.equals(_arg1)){
_bUV.x = _arg1.x;
_bUV.y = _arg1.y;
if (_mesh != null){
_mesh.addOperationToScene(calculateUVOperation);
};
};
} else {
_bUV = null;
if (_mesh != null){
_mesh.addOperationToScene(calculateUVOperation);
};
};
} else {
if (_arg1 != null){
_bUV = _arg1.clone();
if (_mesh != null){
_mesh.addOperationToScene(calculateUVOperation);
};
};
};
}
alternativa3d function removeFromSurface(_arg1:Surface):void{
_arg1.changeMaterialOperation.removeSequel(updateMaterialOperation);
if (_arg1._material != null){
_mesh.addOperationToScene(updateMaterialOperation);
};
_surface = null;
}
public function set cUV(_arg1:Point):void{
if (_cUV != null){
if (_arg1 != null){
if (!_cUV.equals(_arg1)){
_cUV.x = _arg1.x;
_cUV.y = _arg1.y;
if (_mesh != null){
_mesh.addOperationToScene(calculateUVOperation);
};
};
} else {
_cUV = null;
if (_mesh != null){
_mesh.addOperationToScene(calculateUVOperation);
};
};
} else {
if (_arg1 != null){
_cUV = _arg1.clone();
if (_mesh != null){
_mesh.addOperationToScene(calculateUVOperation);
};
};
};
}
private function updateMaterial():void{
if (!updatePrimitiveOperation.queued){
changePrimitive(primitive);
};
}
alternativa3d function addToSurface(_arg1:Surface):void{
_arg1.changeMaterialOperation.addSequel(updateMaterialOperation);
if (((!((_mesh == null))) && (((((!((_surface == null))) && (!((_surface._material == _arg1._material))))) || ((((_surface == null)) && (!((_arg1._material == null))))))))){
_mesh.addOperationToScene(updateMaterialOperation);
};
_surface = _arg1;
}
public function willTrigger(_arg1:String):Boolean{
if (dispatcher != null){
return (dispatcher.willTrigger(_arg1));
};
return (false);
}
public function get id():Object{
return (((_mesh)!=null) ? _mesh.getFaceId(this) : null);
}
public function get verticesCount():uint{
return (_verticesCount);
}
private function updatePrimitive():void{
var _local1:Vertex = _vertices[0];
globalOffset = (((_local1.globalCoords.x * globalNormal.x) + (_local1.globalCoords.y * globalNormal.y)) + (_local1.globalCoords.z * globalNormal.z));
removePrimitive(primitive);
primitive.mobility = _mesh.inheritedMobility;
_mesh._scene.addPrimitives.push(primitive);
}
private function removePrimitiveUV(_arg1:PolyPrimitive):void{
var _local2:uint;
while (_local2 < _arg1.num) {
_arg1.uvs[_local2] = null;
_local2++;
};
if (_arg1.backFragment != null){
removePrimitiveUV(_arg1.backFragment);
removePrimitiveUV(_arg1.frontFragment);
};
}
public function get bUV():Point{
return (((_bUV)!=null) ? _bUV.clone() : null);
}
private function changePrimitive(_arg1:PolyPrimitive):void{
if (_arg1.backFragment != null){
changePrimitive(_arg1.backFragment);
changePrimitive(_arg1.frontFragment);
} else {
_mesh._scene.changedPrimitives[_arg1] = true;
};
}
public function get surface():Surface{
return (_surface);
}
alternativa3d function removeVertices():void{
var _local2:Vertex;
var _local1:uint;
while (_local1 < _verticesCount) {
_local2 = _vertices.pop();
primitive.points.pop();
_local2.removeFromFace(this);
_local1++;
};
_verticesCount = 0;
}
private function calculateFragmentsUV():void{
if (!updatePrimitiveOperation.queued){
if (uvMatrixBase != null){
calculatePrimitiveUV(primitive);
} else {
removePrimitiveUV(primitive);
};
};
}
private function removePrimitive(_arg1:PolyPrimitive):void{
if (_arg1.backFragment != null){
removePrimitive(_arg1.backFragment);
removePrimitive(_arg1.frontFragment);
_arg1.backFragment = null;
_arg1.frontFragment = null;
if (_arg1 != this.primitive){
_arg1.parent = null;
_arg1.sibling = null;
PolyPrimitive.destroyPolyPrimitive(_arg1);
};
} else {
if (_arg1.node != null){
_mesh._scene.removeBSPPrimitive(_arg1);
};
};
}
public function dispatchEvent(_arg1:Event):Boolean{
if (dispatcher != null){
dispatcher.dispatchEvent(_arg1);
};
return (false);
}
public function removeEventListener(_arg1:String, _arg2:Function, _arg3:Boolean=false):void{
if (dispatcher != null){
_arg3 = false;
dispatcher.removeEventListener(_arg1, _arg2, _arg3);
};
}
public function get cUV():Point{
return (((_cUV)!=null) ? _cUV.clone() : null);
}
public function addEventListener(_arg1:String, _arg2:Function, _arg3:Boolean=false, _arg4:int=0, _arg5:Boolean=false):void{
if (dispatcher == null){
dispatcher = new EventDispatcher(this);
};
_arg3 = false;
dispatcher.addEventListener(_arg1, _arg2, _arg3, _arg4, _arg5);
}
public function get aUV():Point{
return (((_aUV)!=null) ? _aUV.clone() : null);
}
alternativa3d function removeFromMesh(_arg1:Mesh):void{
_arg1.changeCoordsOperation.removeSequel(updatePrimitiveOperation);
_arg1.changeRotationOrScaleOperation.removeSequel(calculateNormalOperation);
_arg1.calculateMobilityOperation.removeSequel(updatePrimitiveOperation);
_mesh = null;
}
alternativa3d function removeFromScene(_arg1:Scene3D):void{
_arg1.removeOperation(calculateUVOperation);
_arg1.removeOperation(calculateFragmentsUVOperation);
_arg1.removeOperation(calculateNormalOperation);
_arg1.removeOperation(updatePrimitiveOperation);
_arg1.removeOperation(updateMaterialOperation);
removePrimitive(primitive);
_arg1.addOperation(_arg1.calculateBSPOperation);
updatePrimitiveOperation.removeSequel(_arg1.calculateBSPOperation);
updateMaterialOperation.removeSequel(_arg1.changePrimitivesOperation);
}
public function toString():String{
var _local3:Vertex;
var _local1:String = (("[Face ID:" + id) + ((_verticesCount)>0) ? " vertices:" : "");
var _local2:uint;
while (_local2 < _verticesCount) {
_local3 = _vertices[_local2];
_local1 = (_local1 + (_local3.id + ((_local2)<(_verticesCount - 1)) ? ", " : ""));
_local2++;
};
_local1 = (_local1 + "]");
return (_local1);
}
private function calculateNormal():void{
var _local1:Vertex = _vertices[0];
var _local2:Point3D = _local1.globalCoords;
_local1 = _vertices[1];
var _local3:Point3D = _local1.globalCoords;
var _local4:Number = (_local3.x - _local2.x);
var _local5:Number = (_local3.y - _local2.y);
var _local6:Number = (_local3.z - _local2.z);
_local1 = _vertices[2];
var _local7:Point3D = _local1.globalCoords;
var _local8:Number = (_local7.x - _local2.x);
var _local9:Number = (_local7.y - _local2.y);
var _local10:Number = (_local7.z - _local2.z);
globalNormal.x = ((_local10 * _local5) - (_local9 * _local6));
globalNormal.y = ((_local8 * _local6) - (_local10 * _local4));
globalNormal.z = ((_local9 * _local4) - (_local8 * _local5));
globalNormal.normalize();
}
public function get edgeJoinedFaces():Set{
var _local3:Vertex;
var _local4:Vertex;
var _local5:*;
var _local6:Face;
var _local1:Set = new Set(true);
var _local2:uint;
while (_local2 < _verticesCount) {
_local3 = _vertices[_local2];
_local4 = _vertices[((_local2)<(_verticesCount - 1)) ? (_local2 + 1) : 0];
for (_local5 in _local3._faces) {
_local6 = _local5;
if (((!((_local6 == this))) && ((_local6._vertices.indexOf(_local4) >= 0)))){
_local1[_local6] = true;
};
};
_local2++;
};
return (_local1);
}
alternativa3d function getUVFast(_arg1:Point3D, _arg2:Point3D):Point{
var _local3:uint;
if ((((((_aUV == null)) || ((_bUV == null)))) || ((_cUV == null)))){
return (null);
};
if (((_arg2.x)<0) ? -(_arg2.x) : _arg2.x > ((_arg2.y)<0) ? -(_arg2.y) : _arg2.y){
if (((_arg2.x)<0) ? -(_arg2.x) : _arg2.x > ((_arg2.z)<0) ? -(_arg2.z) : _arg2.z){
_local3 = 0;
} else {
_local3 = 2;
};
} else {
if (((_arg2.y)<0) ? -(_arg2.y) : _arg2.y > ((_arg2.z)<0) ? -(_arg2.z) : _arg2.z){
_local3 = 1;
} else {
_local3 = 2;
};
};
var _local4:Vertex = _vertices[0];
var _local5:Point3D = _local4._coords;
_local4 = _vertices[1];
var _local6:Point3D = _local4._coords;
_local4 = _vertices[2];
var _local7:Point3D = _local4._coords;
var _local8:Number = ((_local3)==0) ? (_local6.y - _local5.y) : (_local6.x - _local5.x);
var _local9:Number = ((_local3)==2) ? (_local6.y - _local5.y) : (_local6.z - _local5.z);
var _local10:Number = ((_local3)==0) ? (_local7.y - _local5.y) : (_local7.x - _local5.x);
var _local11:Number = ((_local3)==2) ? (_local7.y - _local5.y) : (_local7.z - _local5.z);
var _local12:Number = ((_local8 * _local11) - (_local10 * _local9));
var _local13:Number = ((_local3)==0) ? (_arg1.y - _local5.y) : (_arg1.x - _local5.x);
var _local14:Number = ((_local3)==2) ? (_arg1.y - _local5.y) : (_arg1.z - _local5.z);
var _local15:Number = (((_local13 * _local11) - (_local10 * _local14)) / _local12);
var _local16:Number = (((_local8 * _local14) - (_local13 * _local9)) / _local12);
var _local17:Number = (_bUV.x - _aUV.x);
var _local18:Number = (_bUV.y - _aUV.y);
var _local19:Number = (_cUV.x - _aUV.x);
var _local20:Number = (_cUV.y - _aUV.y);
return (new Point(((_aUV.x + (_local17 * _local15)) + (_local19 * _local16)), ((_aUV.y + (_local18 * _local15)) + (_local20 * _local16))));
}
public function get normal():Point3D{
var _local12:Number;
var _local1:Point3D = new Point3D();
var _local2:Vertex = _vertices[0];
var _local3:Point3D = _local2.coords;
_local2 = _vertices[1];
var _local4:Point3D = _local2.coords;
var _local5:Number = (_local4.x - _local3.x);
var _local6:Number = (_local4.y - _local3.y);
var _local7:Number = (_local4.z - _local3.z);
_local2 = _vertices[2];
var _local8:Point3D = _local2.coords;
var _local9:Number = (_local8.x - _local3.x);
var _local10:Number = (_local8.y - _local3.y);
var _local11:Number = (_local8.z - _local3.z);
_local1.x = ((_local11 * _local6) - (_local10 * _local7));
_local1.y = ((_local9 * _local7) - (_local11 * _local5));
_local1.z = ((_local10 * _local5) - (_local9 * _local6));
if (((((!((_local1.x == 0))) || (!((_local1.y == 0))))) || (!((_local1.z == 0))))){
_local12 = Math.sqrt((((_local1.x * _local1.x) + (_local1.y * _local1.y)) + (_local1.z * _local1.z)));
_local1.x = (_local1.x / _local12);
_local1.y = (_local1.y / _local12);
_local1.z = (_local1.z / _local12);
};
return (_local1);
}
public function getUV(_arg1:Point3D):Point{
return (getUVFast(_arg1, normal));
}
public function get vertices():Array{
return (new Array().concat(_vertices));
}
public function hasEventListener(_arg1:String):Boolean{
if (dispatcher != null){
return (dispatcher.hasEventListener(_arg1));
};
return (false);
}
public function get mesh():Mesh{
return (_mesh);
}
alternativa3d function addToScene(_arg1:Scene3D):void{
_arg1.addOperation(calculateNormalOperation);
_arg1.addOperation(calculateUVOperation);
updatePrimitiveOperation.addSequel(_arg1.calculateBSPOperation);
updateMaterialOperation.addSequel(_arg1.changePrimitivesOperation);
}
}
}//package alternativa.engine3d.core
Section 6
//Mesh (alternativa.engine3d.core.Mesh)
package alternativa.engine3d.core {
import alternativa.types.*;
import alternativa.engine3d.materials.*;
import flash.geom.*;
import alternativa.utils.*;
import alternativa.engine3d.errors.*;
import alternativa.engine3d.*;
public class Mesh extends Object3D {
alternativa3d var _surfaces:Map;
private var surfaceIDCounter:uint;// = 0
alternativa3d var _vertices:Map;
private var faceIDCounter:uint;// = 0
alternativa3d var _faces:Map;
private var vertexIDCounter:uint;// = 0
private static var counter:uint = 0;
public function Mesh(_arg1:String=null){
_vertices = new Map();
_faces = new Map();
_surfaces = new Map();
super(_arg1);
}
public function createVertex(_arg1:Number=0, _arg2:Number=0, _arg3:Number=0, _arg4:Object=null):Vertex{
if (_arg4 != null){
if (_vertices[_arg4] != undefined){
if ((_vertices[_arg4] is Vertex)){
throw (new VertexExistsError(_arg4, this));
};
throw (new InvalidIDError(_arg4, this));
};
} else {
while (_vertices[vertexIDCounter] != undefined) {
vertexIDCounter++;
};
_arg4 = vertexIDCounter;
};
var _local5:Vertex = new Vertex(_arg1, _arg2, _arg3);
if (_scene != null){
_local5.addToScene(_scene);
};
_local5.addToMesh(this);
_vertices[_arg4] = _local5;
return (_local5);
}
public function removeFace(_arg1:Object):Face{
var _local2 = (_arg1 is Face);
if (_arg1 == null){
throw (new FaceNotFoundError(null, this));
};
if (_local2){
if (Face(_arg1)._mesh != this){
throw (new FaceNotFoundError(_arg1, this));
};
} else {
if (_faces[_arg1] == undefined){
throw (new FaceNotFoundError(_arg1, this));
};
if (!(_faces[_arg1] is Face)){
throw (new InvalidIDError(_arg1, this));
};
};
var _local3:Face = (_local2) ? Face(_arg1) : _faces[_arg1];
var _local4:Object = (_local2) ? getFaceId(Face(_arg1)) : _arg1;
_local3.removeVertices();
if (_local3._surface != null){
_local3._surface._faces.remove(_local3);
_local3.removeFromSurface(_local3._surface);
};
if (_scene != null){
_local3.removeFromScene(_scene);
};
_local3.removeFromMesh(this);
delete _faces[_local4];
return (_local3);
}
public function hasSurface(_arg1:Object):Boolean{
if (_arg1 == null){
throw (new SurfaceNotFoundError(null, this));
};
if ((_arg1 is Surface)){
return ((_arg1._mesh == this));
};
if (_surfaces[_arg1] != undefined){
if ((_surfaces[_arg1] is Surface)){
return (true);
};
throw (new InvalidIDError(_arg1, this));
//unresolved jump
};
return (false);
}
public function removeSurface(_arg1:Object):Surface{
var _local2 = (_arg1 is Surface);
if (_arg1 == null){
throw (new SurfaceNotFoundError(null, this));
};
if (_local2){
if (Surface(_arg1)._mesh != this){
throw (new SurfaceNotFoundError(_arg1, this));
};
} else {
if (_surfaces[_arg1] == undefined){
throw (new SurfaceNotFoundError(_arg1, this));
};
if (!(_surfaces[_arg1] is Surface)){
throw (new InvalidIDError(_arg1, this));
};
};
var _local3:Surface = (_local2) ? Surface(_arg1) : _surfaces[_arg1];
var _local4:Object = (_local2) ? getSurfaceId(Surface(_arg1)) : _arg1;
if (_scene != null){
_local3.removeFromScene(_scene);
};
_local3.removeFaces();
_local3.removeFromMesh(this);
delete _surfaces[_local4];
return (_local3);
}
public function moveAllFacesToSurface(_arg1:Object=null, _arg2:Boolean=false):Surface{
var _local3:Surface;
var _local4:Object;
var _local5:Face;
var _local6:Map;
var _local7:*;
var _local8:Surface;
if ((_arg1 is Surface)){
if (_arg1._mesh == this){
_local3 = Surface(_arg1);
} else {
throw (new SurfaceNotFoundError(_arg1, this));
};
} else {
if (_surfaces[_arg1] == undefined){
_local3 = createSurface(null, _arg1);
_local4 = _arg1;
} else {
if ((_surfaces[_arg1] is Surface)){
_local3 = _surfaces[_arg1];
} else {
throw (new InvalidIDError(_arg1, this));
};
};
};
for each (_local5 in _faces) {
if (_local5._surface != _local3){
_local3.addFace(_local5);
};
};
if (_arg2){
if (_local4 == null){
_local4 = getSurfaceId(_local3);
};
_local6 = new Map();
_local6[_local4] = _local3;
delete _surfaces[_local4];
for (_local7 in _surfaces) {
_local8 = _surfaces[_local7];
if (_scene != null){
_local8.removeFromScene(_scene);
};
_local8.removeFromMesh(this);
delete _surfaces[_local7];
};
_surfaces = _local6;
};
return (_local3);
}
public function getFaceId(_arg1:Face):Object{
var _local2:Object;
if (_arg1 == null){
throw (new FaceNotFoundError(null, this));
};
if (_arg1._mesh != this){
throw (new FaceNotFoundError(_arg1, this));
};
for (_local2 in _faces) {
if (_faces[_local2] == _arg1){
return (_local2);
};
};
throw (new FaceNotFoundError(_arg1, this));
}
public function removeVertex(_arg1:Object):Vertex{
var _local2 = (_arg1 is Vertex);
if (_arg1 == null){
throw (new VertexNotFoundError(null, this));
};
if (_local2){
if (Vertex(_arg1)._mesh != this){
throw (new VertexNotFoundError(_arg1, this));
};
} else {
if (_vertices[_arg1] == undefined){
throw (new VertexNotFoundError(_arg1, this));
};
if (!(_vertices[_arg1] is Vertex)){
throw (new InvalidIDError(_arg1, this));
};
};
var _local3:Vertex = (_local2) ? Vertex(_arg1) : _vertices[_arg1];
var _local4:Object = (_local2) ? getVertexId(Vertex(_arg1)) : _arg1;
if (_scene != null){
_local3.removeFromScene(_scene);
};
_local3.removeFromMesh(this);
delete _vertices[_local4];
return (_local3);
}
public function setMaterialToSurface(_arg1:SurfaceMaterial, _arg2:Object):void{
var _local3 = (_arg2 is Surface);
if (_arg2 == null){
throw (new SurfaceNotFoundError(null, this));
};
if (_local3){
if (Surface(_arg2)._mesh != this){
throw (new SurfaceNotFoundError(_arg2, this));
};
} else {
if (_surfaces[_arg2] == undefined){
throw (new SurfaceNotFoundError(_arg2, this));
};
if (!(_surfaces[_arg2] is Surface)){
throw (new InvalidIDError(_arg2, this));
};
};
var _local4:Surface = (_local3) ? Surface(_arg2) : _surfaces[_arg2];
_local4.material = _arg1;
}
public function createSurface(_arg1:Array=null, _arg2:Object=null):Surface{
var _local4:uint;
var _local5:uint;
if (_arg2 != null){
if (_surfaces[_arg2] != undefined){
if ((_surfaces[_arg2] is Surface)){
throw (new SurfaceExistsError(_arg2, this));
};
throw (new InvalidIDError(_arg2, this));
};
} else {
while (_surfaces[surfaceIDCounter] != undefined) {
surfaceIDCounter++;
};
_arg2 = surfaceIDCounter;
};
var _local3:Surface = new Surface();
if (_scene != null){
_local3.addToScene(_scene);
};
_local3.addToMesh(this);
_surfaces[_arg2] = _local3;
if (_arg1 != null){
_local4 = _arg1.length;
_local5 = 0;
while (_local5 < _local4) {
_local3.addFace(_arg1[_local5]);
_local5++;
};
};
return (_local3);
}
override protected function clonePropertiesFrom(_arg1:Object3D):void{
var _local3:*;
var _local4:int;
var _local5:int;
var _local7:Map;
var _local8:Vertex;
var _local9:Face;
var _local10:Array;
var _local11:Face;
var _local12:Surface;
var _local13:Array;
var _local14:Surface;
var _local15:SurfaceMaterial;
super.clonePropertiesFrom(_arg1);
var _local2:Mesh = Mesh(_arg1);
var _local6:Map = new Map(true);
for (_local3 in _local2._vertices) {
_local8 = _local2._vertices[_local3];
_local6[_local8] = createVertex(_local8.x, _local8.y, _local8.z, _local3);
};
_local7 = new Map(true);
for (_local3 in _local2._faces) {
_local9 = _local2._faces[_local3];
_local4 = _local9._vertices.length;
_local10 = new Array(_local4);
_local5 = 0;
while (_local5 < _local4) {
_local10[_local5] = _local6[_local9._vertices[_local5]];
_local5++;
};
_local11 = createFace(_local10, _local3);
_local11.aUV = _local9._aUV;
_local11.bUV = _local9._bUV;
_local11.cUV = _local9._cUV;
_local7[_local9] = _local11;
};
for (_local3 in _local2._surfaces) {
_local12 = _local2._surfaces[_local3];
_local13 = _local12._faces.toArray();
_local4 = _local13.length;
_local5 = 0;
while (_local5 < _local4) {
_local13[_local5] = _local7[_local13[_local5]];
_local5++;
};
_local14 = createSurface(_local13, _local3);
_local15 = _local12.material;
if (_local15 != null){
_local14.material = SurfaceMaterial(_local15.clone());
};
};
}
public function getVertexById(_arg1:Object):Vertex{
if (_arg1 == null){
throw (new VertexNotFoundError(null, this));
};
if (_vertices[_arg1] == undefined){
throw (new VertexNotFoundError(_arg1, this));
};
if ((_vertices[_arg1] is Vertex)){
return (_vertices[_arg1]);
};
throw (new InvalidIDError(_arg1, this));
}
public function cloneMaterialToAllSurfaces(_arg1:SurfaceMaterial):void{
var _local2:Surface;
for each (_local2 in _surfaces) {
_local2.material = ((_arg1)!=null) ? SurfaceMaterial(_arg1.clone()) : null;
};
}
public function hasFace(_arg1:Object):Boolean{
if (_arg1 == null){
throw (new FaceNotFoundError(null, this));
};
if ((_arg1 is Face)){
return ((_arg1._mesh == this));
};
if (_faces[_arg1] != undefined){
if ((_faces[_arg1] is Face)){
return (true);
};
throw (new InvalidIDError(_arg1, this));
//unresolved jump
};
return (false);
}
override alternativa3d function setScene(_arg1:Scene3D):void{
var _local2:Vertex;
var _local3:Face;
var _local4:Surface;
if (_scene != _arg1){
if (_arg1 != null){
for each (_local2 in _vertices) {
_local2.addToScene(_arg1);
};
for each (_local3 in _faces) {
_local3.addToScene(_arg1);
};
for each (_local4 in _surfaces) {
_local4.addToScene(_arg1);
};
} else {
for each (_local2 in _vertices) {
_local2.removeFromScene(_scene);
};
for each (_local3 in _faces) {
_local3.removeFromScene(_scene);
};
for each (_local4 in _surfaces) {
_local4.removeFromScene(_scene);
};
};
};
super.setScene(_arg1);
}
public function createFace(_arg1:Array, _arg2:Object=null):Face{
var _local5:Vertex;
if (_arg1 == null){
throw (new FaceNeedMoreVerticesError(this));
};
if (_arg2 != null){
if (_faces[_arg2] != undefined){
if ((_faces[_arg2] is Face)){
throw (new FaceExistsError(_arg2, this));
};
throw (new InvalidIDError(_arg2, this));
};
} else {
while (_faces[faceIDCounter] != undefined) {
faceIDCounter++;
};
_arg2 = faceIDCounter;
};
var _local3:uint = _arg1.length;
if (_local3 < 3){
throw (new FaceNeedMoreVerticesError(this, _local3));
};
var _local4:Array = new Array();
var _local6:uint;
while (_local6 < _local3) {
if ((_arg1[_local6] is Vertex)){
_local5 = _arg1[_local6];
if (_local5._mesh != this){
throw (new VertexNotFoundError(_arg1[_local6], this));
};
} else {
if (_vertices[_arg1[_local6]] == null){
throw (new VertexNotFoundError(_arg1[_local6], this));
};
if (!(_vertices[_arg1[_local6]] is Vertex)){
throw (new InvalidIDError(_arg1[_local6], this));
};
_local5 = _vertices[_arg1[_local6]];
};
_local4.push(_local5);
_local6++;
};
var _local7:Face = new Face(_local4);
if (_scene != null){
_local7.addToScene(_scene);
};
_local7.addToMesh(this);
_faces[_arg2] = _local7;
return (_local7);
}
public function getVertexId(_arg1:Vertex):Object{
var _local2:Object;
if (_arg1 == null){
throw (new VertexNotFoundError(null, this));
};
if (_arg1._mesh != this){
throw (new VertexNotFoundError(_arg1, this));
};
for (_local2 in _vertices) {
if (_vertices[_local2] == _arg1){
return (_local2);
};
};
throw (new VertexNotFoundError(_arg1, this));
}
public function getFaceById(_arg1:Object):Face{
if (_arg1 == null){
throw (new FaceNotFoundError(null, this));
};
if (_faces[_arg1] == undefined){
throw (new FaceNotFoundError(_arg1, this));
};
if ((_faces[_arg1] is Face)){
return (_faces[_arg1]);
};
throw (new InvalidIDError(_arg1, this));
}
public function hasVertex(_arg1:Object):Boolean{
if (_arg1 == null){
throw (new VertexNotFoundError(null, this));
};
if ((_arg1 is Vertex)){
return ((_arg1._mesh == this));
};
if (_vertices[_arg1] != undefined){
if ((_vertices[_arg1] is Vertex)){
return (true);
};
throw (new InvalidIDError(_arg1, this));
//unresolved jump
};
return (false);
}
override protected function createEmptyObject():Object3D{
return (new Mesh());
}
public function get surfaces():Map{
return (_surfaces.clone());
}
public function getSurfaceById(_arg1:Object):Surface{
if (_arg1 == null){
throw (new SurfaceNotFoundError(null, this));
};
if (_surfaces[_arg1] == undefined){
throw (new SurfaceNotFoundError(_arg1, this));
};
if ((_surfaces[_arg1] is Surface)){
return (_surfaces[_arg1]);
};
throw (new InvalidIDError(_arg1, this));
}
override protected function defaultName():String{
return (("mesh" + ++counter));
}
public function setUVsToFace(_arg1:Point, _arg2:Point, _arg3:Point, _arg4:Object):void{
var _local5 = (_arg4 is Face);
if (_arg4 == null){
throw (new FaceNotFoundError(null, this));
};
if (_local5){
if (Face(_arg4)._mesh != this){
throw (new FaceNotFoundError(_arg4, this));
};
} else {
if (_faces[_arg4] == undefined){
throw (new FaceNotFoundError(_arg4, this));
};
if (!(_faces[_arg4] is Face)){
throw (new InvalidIDError(_arg4, this));
};
};
var _local6:Face = (_local5) ? Face(_arg4) : _faces[_arg4];
_local6.aUV = _arg1;
_local6.bUV = _arg2;
_local6.cUV = _arg3;
}
public function getSurfaceId(_arg1:Surface):Object{
var _local2:Object;
if (_arg1 == null){
throw (new SurfaceNotFoundError(null, this));
};
if (_arg1._mesh != this){
throw (new SurfaceNotFoundError(_arg1, this));
};
for (_local2 in _surfaces) {
if (_surfaces[_local2] == _arg1){
return (_local2);
};
};
return (null);
}
public function get faces():Map{
return (_faces.clone());
}
public function get vertices():Map{
return (_vertices.clone());
}
override public function toString():String{
return ((((((((("[" + ObjectUtils.getClassName(this)) + " ") + _name) + " vertices: ") + _vertices.length) + " faces: ") + _faces.length) + "]"));
}
}
}//package alternativa.engine3d.core
Section 7
//Object3D (alternativa.engine3d.core.Object3D)
package alternativa.engine3d.core {
import flash.events.*;
import alternativa.types.*;
import alternativa.utils.*;
import alternativa.engine3d.errors.*;
import alternativa.engine3d.*;
public class Object3D implements IEventDispatcher {
alternativa3d var _mobility:int;// = 0
alternativa3d var calculateTransformationOperation:Operation;
alternativa3d var changeCoordsOperation:Operation;
alternativa3d var _rotationX:Number;// = 0
alternativa3d var _rotationY:Number;// = 0
alternativa3d var _rotationZ:Number;// = 0
alternativa3d var _transformation:Matrix3D;
alternativa3d var _coords:Point3D;
alternativa3d var calculateMobilityOperation:Operation;
alternativa3d var _children:Set;
alternativa3d var _name:String;
alternativa3d var _scaleX:Number;// = 1
alternativa3d var changeRotationOrScaleOperation:Operation;
alternativa3d var _scaleZ:Number;// = 1
alternativa3d var _scaleY:Number;// = 1
alternativa3d var _scene:Scene3D;
alternativa3d var globalCoords:Point3D;
alternativa3d var inheritedMobility:int;
private var dispatcher:EventDispatcher;
alternativa3d var _parent:Object3D;
public var mouseEnabled:Boolean;// = true
alternativa3d static var matrix1:Matrix3D = new Matrix3D();
alternativa3d static var matrix2:Matrix3D = new Matrix3D();
private static var counter:uint = 0;
public function Object3D(_arg1:String=null){
changeRotationOrScaleOperation = new Operation("changeRotationOrScale", this);
changeCoordsOperation = new Operation("changeCoords", this);
calculateTransformationOperation = new Operation("calculateTransformation", this, calculateTransformation, Operation.OBJECT_CALCULATE_TRANSFORMATION);
calculateMobilityOperation = new Operation("calculateMobility", this, calculateMobility, Operation.OBJECT_CALCULATE_MOBILITY);
_children = new Set();
_coords = new Point3D();
_transformation = new Matrix3D();
globalCoords = new Point3D();
super();
_name = ((_arg1)!=null) ? _arg1 : defaultName();
changeRotationOrScaleOperation.addSequel(calculateTransformationOperation);
changeCoordsOperation.addSequel(calculateTransformationOperation);
}
public function addChild(_arg1:Object3D):Object3D{
var _local2:Object3D;
if (_arg1 == null){
throw (new Object3DHierarchyError(null, this));
};
if (_arg1._parent == this){
return (_arg1);
};
if (_arg1 == this){
throw (new Object3DHierarchyError(this, this));
};
if (_arg1._scene == _scene){
_local2 = _parent;
while (_local2 != null) {
if (_arg1 == _local2){
throw (new Object3DHierarchyError(_arg1, this));
};
_local2 = _local2._parent;
};
};
if (_arg1._parent != null){
_arg1._parent._children.remove(_arg1);
} else {
if (((!((_arg1._scene == null))) && ((_arg1._scene._root == _arg1)))){
_arg1._scene.root = null;
};
};
_children.add(_arg1);
_arg1.setParent(this);
_arg1.setLevel(((calculateTransformationOperation.priority & 0xFFFFFF) + 1));
_arg1.setScene(_scene);
return (_arg1);
}
public function set z(_arg1:Number):void{
if (_coords.z != _arg1){
_coords.z = _arg1;
addOperationToScene(changeCoordsOperation);
};
}
public function get children():Set{
return (_children.clone());
}
public function get transformation():Matrix3D{
var _local1:Matrix3D = new Matrix3D();
getTransformation(_local1);
return (_local1);
}
alternativa3d function getTransformation(_arg1:Matrix3D):Boolean{
var _local3:Object3D;
var _local2:Object3D = _scene._root;
var _local4:Object3D = this;
do {
if (((_local4.changeCoordsOperation.queued) || (_local4.changeRotationOrScaleOperation.queued))){
_local3 = _local4._parent;
};
_local4 = _local4._parent;
} while (_local4 != _local2);
if (_local3 != null){
_arg1.toTransform(_coords.x, _coords.y, _coords.z, _rotationX, _rotationY, _rotationZ, _scaleX, _scaleY, _scaleZ);
_local4 = this;
while ((_local4 = _local4._parent) != _local3) {
matrix1.toTransform(_local4._coords.x, _local4._coords.y, _local4._coords.z, _local4._rotationX, _local4._rotationY, _local4._rotationZ, _local4._scaleX, _local4._scaleY, _local4._scaleZ);
_arg1.combine(matrix1);
};
if (_local3 != _local2){
_arg1.combine(_local3._transformation);
};
return (true);
};
_arg1.copy(_transformation);
return (false);
}
alternativa3d function calculateTransformation():void{
if (changeRotationOrScaleOperation.queued){
_transformation.toTransform(_coords.x, _coords.y, _coords.z, _rotationX, _rotationY, _rotationZ, _scaleX, _scaleY, _scaleZ);
if (_parent != null){
_transformation.combine(_parent._transformation);
};
globalCoords.x = _transformation.d;
globalCoords.y = _transformation.h;
globalCoords.z = _transformation.l;
} else {
globalCoords.copy(_coords);
if (_parent != null){
globalCoords.transform(_parent._transformation);
};
_transformation.offset(globalCoords.x, globalCoords.y, globalCoords.z);
};
}
public function set name(_arg1:String):void{
_name = _arg1;
}
public function get coords():Point3D{
return (_coords.clone());
}
alternativa3d function addOperationToScene(_arg1:Operation):void{
if (_scene != null){
_scene.addOperation(_arg1);
};
}
private function calculateMobility():void{
inheritedMobility = (((_parent)!=null) ? _parent.inheritedMobility : 0 + _mobility);
}
public function set rotationX(_arg1:Number):void{
if (_rotationX != _arg1){
_rotationX = _arg1;
addOperationToScene(changeRotationOrScaleOperation);
};
}
public function set coords(_arg1:Point3D):void{
if (!_coords.equals(_arg1)){
_coords.copy(_arg1);
addOperationToScene(changeCoordsOperation);
};
}
public function set rotationZ(_arg1:Number):void{
if (_rotationZ != _arg1){
_rotationZ = _arg1;
addOperationToScene(changeRotationOrScaleOperation);
};
}
protected function clonePropertiesFrom(_arg1:Object3D):void{
_name = _arg1._name;
_mobility = _arg1._mobility;
_coords.x = _arg1._coords.x;
_coords.y = _arg1._coords.y;
_coords.z = _arg1._coords.z;
_rotationX = _arg1._rotationX;
_rotationY = _arg1._rotationY;
_rotationZ = _arg1._rotationZ;
_scaleX = _arg1._scaleX;
_scaleY = _arg1._scaleY;
_scaleZ = _arg1._scaleZ;
}
public function dispatchEvent(_arg1:Event):Boolean{
if (dispatcher != null){
dispatcher.dispatchEvent(_arg1);
};
return (false);
}
alternativa3d function setLevel(_arg1:uint):void{
var _local2:*;
var _local3:Object3D;
calculateTransformationOperation.priority = ((calculateTransformationOperation.priority & 4278190080) | _arg1);
calculateMobilityOperation.priority = ((calculateMobilityOperation.priority & 4278190080) | _arg1);
for (_local2 in _children) {
_local3 = _local2;
_local3.setLevel((_arg1 + 1));
};
}
public function addEventListener(_arg1:String, _arg2:Function, _arg3:Boolean=false, _arg4:int=0, _arg5:Boolean=false):void{
if (dispatcher == null){
dispatcher = new EventDispatcher(this);
};
_arg3 = false;
dispatcher.addEventListener(_arg1, _arg2, _arg3, _arg4, _arg5);
}
public function get scaleY():Number{
return (_scaleY);
}
alternativa3d function setScene(_arg1:Scene3D):void{
var _local2:*;
var _local3:Object3D;
if (_scene != _arg1){
if (_scene != null){
removeFromScene(_scene);
};
if (_arg1 != null){
addToScene(_arg1);
};
_scene = _arg1;
} else {
addOperationToScene(changeRotationOrScaleOperation);
addOperationToScene(calculateMobilityOperation);
};
for (_local2 in _children) {
_local3 = _local2;
_local3.setScene(_scene);
};
}
public function get scaleX():Number{
return (_scaleX);
}
public function set mobility(_arg1:int):void{
if (_mobility != _arg1){
_mobility = _arg1;
addOperationToScene(calculateMobilityOperation);
};
}
public function get scaleZ():Number{
return (_scaleZ);
}
public function set rotationY(_arg1:Number):void{
if (_rotationY != _arg1){
_rotationY = _arg1;
addOperationToScene(changeRotationOrScaleOperation);
};
}
public function removeEventListener(_arg1:String, _arg2:Function, _arg3:Boolean=false):void{
if (dispatcher != null){
_arg3 = false;
dispatcher.removeEventListener(_arg1, _arg2, _arg3);
};
}
public function clone():Object3D{
var _local2:*;
var _local3:Object3D;
var _local1:Object3D = createEmptyObject();
_local1.clonePropertiesFrom(this);
for (_local2 in _children) {
_local3 = _local2;
_local1.addChild(_local3.clone());
};
return (_local1);
}
protected function createEmptyObject():Object3D{
return (new Object3D());
}
protected function defaultName():String{
return (("object" + ++counter));
}
public function get x():Number{
return (_coords.x);
}
public function get y():Number{
return (_coords.y);
}
public function get z():Number{
return (_coords.z);
}
public function toString():String{
return ((((("[" + ObjectUtils.getClassName(this)) + " ") + _name) + "]"));
}
public function willTrigger(_arg1:String):Boolean{
if (dispatcher != null){
return (dispatcher.willTrigger(_arg1));
};
return (false);
}
public function getChildByName(_arg1:String, _arg2:Boolean=false):Object3D{
var _local3:*;
var _local4:Object3D;
for (_local3 in _children) {
_local4 = _local3;
if (_local4._name == _arg1){
return (_local4);
};
};
if (_arg2){
for (_local3 in _children) {
_local4 = _local3;
_local4 = _local4.getChildByName(_arg1, true);
if (_local4 != null){
return (_local4);
};
};
};
return (null);
}
public function localToGlobal(_arg1:Point3D):Point3D{
if (_scene == null){
return (null);
};
var _local2:Point3D = _arg1.clone();
if (_parent == null){
return (_local2);
};
getTransformation(matrix2);
_local2.transform(matrix2);
return (_local2);
}
public function get name():String{
return (_name);
}
public function get scene():Scene3D{
return (_scene);
}
public function globalToLocal(_arg1:Point3D):Point3D{
var _local2:Point3D = _arg1.clone();
getTransformation(matrix2);
matrix2.invert();
_local2.transform(matrix2);
return (_local2);
}
public function get rotationX():Number{
return (_rotationX);
}
public function get rotationY():Number{
return (_rotationY);
}
public function get rotationZ():Number{
return (_rotationZ);
}
public function set scaleY(_arg1:Number):void{
if (_scaleY != _arg1){
_scaleY = _arg1;
addOperationToScene(changeRotationOrScaleOperation);
};
}
public function set scaleZ(_arg1:Number):void{
if (_scaleZ != _arg1){
_scaleZ = _arg1;
addOperationToScene(changeRotationOrScaleOperation);
};
}
public function set scaleX(_arg1:Number):void{
if (_scaleX != _arg1){
_scaleX = _arg1;
addOperationToScene(changeRotationOrScaleOperation);
};
}
public function get parent():Object3D{
return (_parent);
}
public function get mobility():int{
return (_mobility);
}
alternativa3d function setParent(_arg1:Object3D):void{
if (_parent != null){
removeParentSequels();
};
_parent = _arg1;
if (_arg1 != null){
addParentSequels();
};
}
private function removeParentSequels():void{
_parent.changeCoordsOperation.removeSequel(changeCoordsOperation);
_parent.changeRotationOrScaleOperation.removeSequel(changeRotationOrScaleOperation);
_parent.calculateMobilityOperation.removeSequel(calculateMobilityOperation);
}
private function addParentSequels():void{
_parent.changeCoordsOperation.addSequel(changeCoordsOperation);
_parent.changeRotationOrScaleOperation.addSequel(changeRotationOrScaleOperation);
_parent.calculateMobilityOperation.addSequel(calculateMobilityOperation);
}
protected function removeFromScene(_arg1:Scene3D):void{
_arg1.removeOperation(changeRotationOrScaleOperation);
_arg1.removeOperation(changeCoordsOperation);
_arg1.removeOperation(calculateMobilityOperation);
}
protected function addToScene(_arg1:Scene3D):void{
_arg1.addOperation(changeRotationOrScaleOperation);
_arg1.addOperation(calculateMobilityOperation);
}
public function set y(_arg1:Number):void{
if (_coords.y != _arg1){
_coords.y = _arg1;
addOperationToScene(changeCoordsOperation);
};
}
public function hasEventListener(_arg1:String):Boolean{
if (dispatcher != null){
return (dispatcher.hasEventListener(_arg1));
};
return (false);
}
public function set x(_arg1:Number):void{
if (_coords.x != _arg1){
_coords.x = _arg1;
addOperationToScene(changeCoordsOperation);
};
}
public function removeChild(_arg1:Object3D):Object3D{
if (_arg1 == null){
throw (new Object3DNotFoundError(null, this));
};
if (_arg1._parent != this){
throw (new Object3DNotFoundError(_arg1, this));
};
_children.remove(_arg1);
_arg1.setParent(null);
_arg1.setScene(null);
return (_arg1);
}
alternativa3d function removeOperationFromScene(_arg1:Operation):void{
if (_scene != null){
_scene.removeOperation(_arg1);
};
}
}
}//package alternativa.engine3d.core
Section 8
//Operation (alternativa.engine3d.core.Operation)
package alternativa.engine3d.core {
import alternativa.types.*;
import alternativa.engine3d.*;
public class Operation {
alternativa3d var method:Function;
alternativa3d var priority:uint;
alternativa3d var name:String;
alternativa3d var queued:Boolean;// = false
private var sequel:Operation;
private var sequels:Set;
alternativa3d var object:Object;
alternativa3d static const SCENE_CLEAR_PRIMITIVES:uint = 234881024;
alternativa3d static const CAMERA_CALCULATE_PLANES:uint = 201326592;
alternativa3d static const OBJECT_CALCULATE_MOBILITY:uint = 33554432;
alternativa3d static const SCENE_CALCULATE_BSP:uint = 117440512;
alternativa3d static const FACE_CALCULATE_FRAGMENTS_UV:uint = 167772160;
alternativa3d static const FACE_CALCULATE_UV:uint = 83886080;
alternativa3d static const OBJECT_CALCULATE_TRANSFORMATION:uint = 16777216;
alternativa3d static const SPRITE_UPDATE_MATERIAL:uint = 150994944;
alternativa3d static const FACE_CALCULATE_NORMAL:uint = 67108864;
alternativa3d static const VERTEX_CALCULATE_COORDS:uint = 50331648;
alternativa3d static const FACE_UPDATE_PRIMITIVE:uint = 100663296;
alternativa3d static const CAMERA_CALCULATE_MATRIX:uint = 184549376;
alternativa3d static const CAMERA_RENDER:uint = 218103808;
alternativa3d static const FACE_UPDATE_MATERIAL:uint = 134217728;
public function Operation(_arg1:String, _arg2:Object=null, _arg3:Function=null, _arg4:uint=0){
this.object = _arg2;
this.method = _arg3;
this.name = _arg1;
this.priority = _arg4;
}
alternativa3d function addSequel(_arg1:Operation):void{
if (sequel == null){
if (sequels == null){
sequel = _arg1;
} else {
sequels[_arg1] = true;
};
} else {
if (sequel != _arg1){
sequels = new Set(true);
sequels[sequel] = true;
sequels[_arg1] = true;
sequel = null;
};
};
}
public function toString():String{
return ((((((((("[Operation " + (priority >>> 24)) + "/") + (priority & 0xFFFFFF)) + " ") + object) + ".") + name) + "]"));
}
alternativa3d function removeSequel(_arg1:Operation):void{
var _local2:*;
var _local3:Boolean;
if (sequel == null){
if (sequels != null){
delete sequels[_arg1];
_local3 = false;
for (_local2 in sequels) {
if (_local3){
_local3 = false;
break;
};
_local3 = true;
};
if (_local3){
sequel = _local2;
sequels = null;
};
};
} else {
if (sequel == _arg1){
sequel = null;
};
};
}
alternativa3d function collectSequels(_arg1:Array):void{
var _local2:*;
var _local3:Operation;
if (sequel == null){
for (_local2 in sequels) {
_local3 = _local2;
if (!_local3.queued){
_arg1.push(_local3);
_local3.queued = true;
_local3.collectSequels(_arg1);
};
};
} else {
if (!sequel.queued){
_arg1.push(sequel);
sequel.queued = true;
sequel.collectSequels(_arg1);
};
};
}
}
}//package alternativa.engine3d.core
Section 9
//PolyPrimitive (alternativa.engine3d.core.PolyPrimitive)
package alternativa.engine3d.core {
import alternativa.engine3d.*;
public class PolyPrimitive {
alternativa3d var sibling:PolyPrimitive;
public var splitQuality:Number;
alternativa3d var node:BSPNode;
alternativa3d var splitTime1:Number;
alternativa3d var num:uint;
alternativa3d var disbalance:int;
alternativa3d var splitTime2:Number;
alternativa3d var backFragment:PolyPrimitive;
alternativa3d var splits:uint;
alternativa3d var face:Face;
alternativa3d var frontFragment:PolyPrimitive;
alternativa3d var points:Array;
alternativa3d var parent:PolyPrimitive;
public var mobility:int;
alternativa3d var uvs:Array;
private static var collector:Array = new Array();
public function PolyPrimitive(){
points = new Array();
uvs = new Array();
super();
}
public function toString():String{
return ((("[Primitive " + face._mesh._name) + "]"));
}
alternativa3d static function destroyPolyPrimitive(_arg1:PolyPrimitive):void{
_arg1.face = null;
var _local2:uint;
while (_local2 < _arg1.num) {
_arg1.points.pop();
_arg1.uvs.pop();
_local2++;
};
collector.push(_arg1);
}
alternativa3d static function createPolyPrimitive():PolyPrimitive{
var _local1:PolyPrimitive;
_local1 = collector.pop();
if (_local1 != null){
return (_local1);
};
return (new (PolyPrimitive));
}
}
}//package alternativa.engine3d.core
Section 10
//Scene3D (alternativa.engine3d.core.Scene3D)
package alternativa.engine3d.core {
import alternativa.types.*;
import alternativa.engine3d.materials.*;
import flash.geom.*;
import flash.display.*;
import alternativa.engine3d.*;
public class Scene3D {
alternativa3d var changePrimitivesOperation:Operation;
alternativa3d var removeNodes:Set;
alternativa3d var _splitAnalysis:Boolean;// = true
alternativa3d var dummyOperation:Operation;
private var childPrimitives:Set;
alternativa3d var bsp:BSPNode;
alternativa3d var changedPrimitives:Set;
alternativa3d var _root:Object3D;
alternativa3d var _splitBalance:Number;// = 0
alternativa3d var dummyNode:BSPNode;
alternativa3d var clearPrimitivesOperation:Operation;
alternativa3d var updateBSPOperation:Operation;
alternativa3d var addPrimitives:Array;
alternativa3d var calculateBSPOperation:Operation;
alternativa3d var operations:Array;
private var _planeOffsetThreshold:Number;// = 0.01
public function Scene3D(){
updateBSPOperation = new Operation("updateBSP", this);
changePrimitivesOperation = new Operation("changePrimitives", this);
calculateBSPOperation = new Operation("calculateBSP", this, calculateBSP, Operation.SCENE_CALCULATE_BSP);
clearPrimitivesOperation = new Operation("clearPrimitives", this, clearPrimitives, Operation.SCENE_CLEAR_PRIMITIVES);
operations = new Array();
dummyOperation = new Operation("removed", this);
changedPrimitives = new Set();
childPrimitives = new Set();
addPrimitives = new Array();
removeNodes = new Set();
dummyNode = new BSPNode();
super();
updateBSPOperation.addSequel(calculateBSPOperation);
calculateBSPOperation.addSequel(changePrimitivesOperation);
changePrimitivesOperation.addSequel(clearPrimitivesOperation);
}
protected function childBSP(_arg1:BSPNode):void{
var _local2:PolyPrimitive;
var _local3:*;
if (((!((_arg1 == null))) && (!((_arg1 == dummyNode))))){
_local2 = _arg1.primitive;
if (_local2 != null){
childPrimitives[_local2] = true;
changedPrimitives[_local2] = true;
_arg1.primitive = null;
_local2.node = null;
} else {
for (_local3 in _arg1.backPrimitives) {
_local2 = _local3;
childPrimitives[_local2] = true;
changedPrimitives[_local2] = true;
_local2.node = null;
};
for (_local3 in _arg1.frontPrimitives) {
_local2 = _local3;
childPrimitives[_local2] = true;
changedPrimitives[_local2] = true;
_local2.node = null;
};
_arg1.backPrimitives = null;
_arg1.frontPrimitives = null;
};
childBSP(_arg1.back);
childBSP(_arg1.front);
_arg1.parent = null;
_arg1.back = null;
_arg1.front = null;
BSPNode.destroyBSPNode(_arg1);
};
}
private function drawBSPNode(_arg1:BSPNode, _arg2:Sprite, _arg3:Number, _arg4:Number, _arg5:Number):void{
var _local8:PolyPrimitive;
var _local11:SpriteTextureMaterial;
var _local6:Shape = new Shape();
_arg2.addChild(_local6);
_local6.x = _arg3;
_local6.y = _arg4;
var _local7:uint = 0xFF0000;
if (_arg1.primitive != null){
_local8 = _arg1.primitive;
} else {
if (_arg1.frontPrimitives != null){
_local8 = _arg1.frontPrimitives.peek();
};
};
if (_local8 != null){
if (_local8.face == null){
_local11 = ((_local8 as SpritePrimitive).sprite._material as SpriteTextureMaterial);
if (((!((_local11 == null))) && (!((_local11._texture == null))))){
_local7 = _local11._texture._bitmapData.getPixel(0, 0);
};
} else {
if (((!((_local8.face._surface == null))) && (!((_local8.face._surface._material == null))))){
if ((_local8.face._surface._material is FillMaterial)){
_local7 = FillMaterial(_local8.face._surface._material)._color;
};
if ((_local8.face._surface._material is WireMaterial)){
_local7 = WireMaterial(_local8.face._surface._material)._color;
};
if ((((_local8.face._surface._material is TextureMaterial)) && (!((TextureMaterial(_local8.face._surface._material)._texture == null))))){
_local7 = TextureMaterial(_local8.face._surface._material).texture._bitmapData.getPixel(0, 0);
};
};
};
};
if (_arg1 == dummyNode){
_local7 = 0xFF00FF;
};
_local6.graphics.beginFill(_local7);
_local6.graphics.drawCircle(0, 0, 3);
_local6.graphics.endFill();
var _local9:Number = 100;
var _local10:Number = 20;
if (_arg1.back != null){
_arg2.graphics.lineStyle(0, 0x660000);
_arg2.graphics.moveTo(_arg3, _arg4);
_arg2.graphics.lineTo((_arg3 - (_local9 * _arg5)), (_arg4 + _local10));
drawBSPNode(_arg1.back, _arg2, (_arg3 - (_local9 * _arg5)), (_arg4 + _local10), (_arg5 * 0.8));
};
if (_arg1.front != null){
_arg2.graphics.lineStyle(0, 0x6600);
_arg2.graphics.moveTo(_arg3, _arg4);
_arg2.graphics.lineTo((_arg3 + (_local9 * _arg5)), (_arg4 + _local10));
drawBSPNode(_arg1.front, _arg2, (_arg3 + (_local9 * _arg5)), (_arg4 + _local10), (_arg5 * 0.8));
};
}
alternativa3d function removeBSPPrimitive(_arg1:PolyPrimitive):void{
var _local4:*;
var _local5:BSPNode;
var _local2:BSPNode = _arg1.node;
_arg1.node = null;
var _local3:Boolean;
changedPrimitives[_arg1] = true;
if (_local2.primitive == _arg1){
removeNodes[_local2] = true;
_local2.primitive = null;
} else {
if (_local2.frontPrimitives[_arg1]){
delete _local2.frontPrimitives[_arg1];
for (_local4 in _local2.frontPrimitives) {
if (_local3){
_local3 = false;
break;
};
_local3 = true;
};
if (_local4 == null){
_local5 = _local2.back;
_local2.back = _local2.front;
_local2.front = _local5;
_local2.normal.invert();
_local2.offset = -(_local2.offset);
for (_local4 in _local2.backPrimitives) {
if (_local3){
_local3 = false;
break;
};
_local3 = true;
};
if (_local3){
_local2.primitive = _local4;
_local2.mobility = _local2.primitive.mobility;
_local2.frontPrimitives = null;
} else {
_local2.frontPrimitives = _local2.backPrimitives;
if (_arg1.mobility == _local2.mobility){
_local2.mobility = int.MAX_VALUE;
for (_local4 in _local2.frontPrimitives) {
_arg1 = _local4;
_local2.mobility = ((_local2.mobility)>_arg1.mobility) ? _arg1.mobility : _local2.mobility;
};
};
};
_local2.backPrimitives = null;
} else {
if (((_local3) && ((_local2.backPrimitives == null)))){
_local2.primitive = _local4;
_local2.mobility = _local2.primitive.mobility;
_local2.frontPrimitives = null;
} else {
if (_arg1.mobility == _local2.mobility){
_local2.mobility = int.MAX_VALUE;
for (_local4 in _local2.backPrimitives) {
_arg1 = _local4;
_local2.mobility = ((_local2.mobility)>_arg1.mobility) ? _arg1.mobility : _local2.mobility;
};
for (_local4 in _local2.frontPrimitives) {
_arg1 = _local4;
_local2.mobility = ((_local2.mobility)>_arg1.mobility) ? _arg1.mobility : _local2.mobility;
};
};
};
};
} else {
delete _local2.backPrimitives[_arg1];
for (_local4 in _local2.backPrimitives) {
break;
};
if (_local4 == null){
for (_local4 in _local2.frontPrimitives) {
if (_local3){
_local3 = false;
break;
};
_local3 = true;
};
if (_local3){
_local2.primitive = _local4;
_local2.mobility = _local2.primitive.mobility;
_local2.frontPrimitives = null;
} else {
if (_arg1.mobility == _local2.mobility){
_local2.mobility = int.MAX_VALUE;
for (_local4 in _local2.frontPrimitives) {
_arg1 = _local4;
_local2.mobility = ((_local2.mobility)>_arg1.mobility) ? _arg1.mobility : _local2.mobility;
};
};
};
_local2.backPrimitives = null;
} else {
if (_arg1.mobility == _local2.mobility){
_local2.mobility = int.MAX_VALUE;
for (_local4 in _local2.backPrimitives) {
_arg1 = _local4;
_local2.mobility = ((_local2.mobility)>_arg1.mobility) ? _arg1.mobility : _local2.mobility;
};
for (_local4 in _local2.frontPrimitives) {
_arg1 = _local4;
_local2.mobility = ((_local2.mobility)>_arg1.mobility) ? _arg1.mobility : _local2.mobility;
};
};
};
};
};
}
private function analyseSplitQuality():void{
var _local1:uint;
var _local5:PolyPrimitive;
var _local6:Point3D;
var _local7:Number;
var _local8:uint;
var _local9:PolyPrimitive;
var _local10:Boolean;
var _local11:Boolean;
var _local12:uint;
var _local13:Point3D;
var _local14:Number;
var _local2:uint = addPrimitives.length;
var _local3:uint;
var _local4:uint;
_local1 = 0;
while (_local1 < _local2) {
_local5 = addPrimitives[_local1];
if (_local5.face == null){
} else {
_local5.splits = 0;
_local5.disbalance = 0;
_local6 = _local5.face.globalNormal;
_local7 = _local5.face.globalOffset;
_local8 = 0;
while (_local8 < _local2) {
if (_local1 != _local8){
_local9 = addPrimitives[_local8];
if (_local9.face == null){
} else {
if (_local5.mobility <= _local9.mobility){
_local10 = false;
_local11 = false;
_local12 = 0;
while (_local12 < _local9.num) {
_local13 = _local9.points[_local12];
_local14 = ((((_local13.x * _local6.x) + (_local13.y * _local6.y)) + (_local13.z * _local6.z)) - _local7);
if (_local14 > _planeOffsetThreshold){
if (!_local10){
_local5.disbalance++;
_local10 = true;
};
if (_local11){
_local5.splits++;
break;
};
} else {
if (_local14 < -(_planeOffsetThreshold)){
if (!_local11){
_local5.disbalance--;
_local11 = true;
};
if (_local10){
_local5.splits++;
break;
};
};
};
_local12++;
};
};
};
};
_local8++;
};
_local5.disbalance = ((_local5.disbalance)>0) ? _local5.disbalance : -(_local5.disbalance);
_local3 = ((_local3)>_local5.splits) ? _local3 : _local5.splits;
_local4 = ((_local4)>_local5.disbalance) ? _local4 : _local5.disbalance;
};
_local1++;
};
_local1 = 0;
while (_local1 < _local2) {
_local5 = addPrimitives[_local1];
_local5.splitQuality = ((((1 - _splitBalance) * _local5.splits) / _local3) + ((_splitBalance * _local5.disbalance) / _local4));
_local1++;
};
}
private function clearPrimitives():void{
changedPrimitives.clear();
}
public function get splitAnalysis():Boolean{
return (_splitAnalysis);
}
public function get planeOffsetThreshold():Number{
return (_planeOffsetThreshold);
}
alternativa3d function sortOperations(_arg1:int, _arg2:int):void{
var _local5:Operation;
var _local7:Operation;
var _local3:int = _arg1;
var _local4:int = _arg2;
var _local6:uint = operations[((_arg2 + _arg1) >> 1)].priority;
do {
while ((_local5 = operations[_local3]).priority < _local6) {
_local3++;
};
while (_local6 < (_local7 = operations[_local4]).priority) {
_local4--;
};
if (_local3 <= _local4){
var _temp1 = _local3;
_local3 = (_local3 + 1);
var _local8 = _temp1;
operations[_local8] = _local7;
var _temp2 = _local4;
_local4 = (_local4 - 1);
var _local9 = _temp2;
operations[_local9] = _local5;
};
} while (_local3 <= _local4);
if (_arg1 < _local4){
sortOperations(_arg1, _local4);
};
if (_local3 < _arg2){
sortOperations(_local3, _arg2);
};
}
public function set splitAnalysis(_arg1:Boolean):void{
if (_splitAnalysis != _arg1){
_splitAnalysis = _arg1;
addOperation(updateBSPOperation);
};
}
alternativa3d function sortPrimitives(_arg1:int, _arg2:int):void{
var _local5:PolyPrimitive;
var _local9:PolyPrimitive;
var _local3:int = _arg1;
var _local4:int = _arg2;
var _local6:PolyPrimitive = addPrimitives[((_arg2 + _arg1) >> 1)];
var _local7:int = _local6.mobility;
var _local8:Number = _local6.splitQuality;
do {
while (((((_local5 = addPrimitives[_local3]).mobility > _local7)) || ((((_local5.mobility == _local7)) && ((_local5.splitQuality > _local8)))))) {
_local3++;
};
while ((((_local7 > (_local9 = addPrimitives[_local4]).mobility)) || ((((_local7 == _local9.mobility)) && ((_local8 > _local9.splitQuality)))))) {
_local4--;
};
if (_local3 <= _local4){
var _temp1 = _local3;
_local3 = (_local3 + 1);
var _local10 = _temp1;
addPrimitives[_local10] = _local9;
var _temp2 = _local4;
_local4 = (_local4 - 1);
var _local11 = _temp2;
addPrimitives[_local11] = _local5;
};
} while (_local3 <= _local4);
if (_arg1 < _local4){
sortPrimitives(_arg1, _local4);
};
if (_local3 < _arg2){
sortPrimitives(_local3, _arg2);
};
}
private function assemblePrimitive(_arg1:PolyPrimitive):void{
if (((!((_arg1.sibling == null))) && (canAssemble(_arg1.sibling)))){
assemblePrimitive(_arg1.parent);
_arg1.sibling.sibling = null;
_arg1.sibling.parent = null;
PolyPrimitive.destroyPolyPrimitive(_arg1.sibling);
_arg1.sibling = null;
_arg1.parent.backFragment = null;
_arg1.parent.frontFragment = null;
_arg1.parent = null;
PolyPrimitive.destroyPolyPrimitive(_arg1);
} else {
addPrimitives.push(_arg1);
};
}
public function set planeOffsetThreshold(_arg1:Number):void{
_arg1 = ((_arg1)<0) ? 0 : _arg1;
if (_planeOffsetThreshold != _arg1){
_planeOffsetThreshold = _arg1;
addOperation(updateBSPOperation);
};
}
protected function removeBSPNode(_arg1:BSPNode):BSPNode{
var _local2:BSPNode;
if (_arg1 != null){
_arg1.back = removeBSPNode(_arg1.back);
_arg1.front = removeBSPNode(_arg1.front);
if (!removeNodes[_arg1]){
_local2 = _arg1;
if (_arg1.back != null){
if (_arg1.back != dummyNode){
_arg1.back.parent = _arg1;
} else {
_arg1.back = null;
};
};
if (_arg1.front != null){
if (_arg1.front != dummyNode){
_arg1.front.parent = _arg1;
} else {
_arg1.front = null;
};
};
} else {
if (_arg1.back == null){
if (_arg1.front != null){
_local2 = _arg1.front;
_arg1.front = null;
};
} else {
if (_arg1.front == null){
_local2 = _arg1.back;
_arg1.back = null;
} else {
childBSP(_arg1.back);
childBSP(_arg1.front);
_local2 = dummyNode;
_arg1.back = null;
_arg1.front = null;
};
};
delete removeNodes[_arg1];
_arg1.parent = null;
BSPNode.destroyBSPNode(_arg1);
};
};
return (_local2);
}
private function canAssemble(_arg1:PolyPrimitive):Boolean{
var _local2:PolyPrimitive;
var _local3:PolyPrimitive;
var _local4:Boolean;
var _local5:Boolean;
if (childPrimitives[_arg1]){
delete childPrimitives[_arg1];
return (true);
};
_local2 = _arg1.backFragment;
_local3 = _arg1.frontFragment;
if (_local2 != null){
_local4 = canAssemble(_local2);
_local5 = canAssemble(_local3);
if (((_local4) && (_local5))){
_local2.parent = null;
_local3.parent = null;
_local2.sibling = null;
_local3.sibling = null;
_arg1.backFragment = null;
_arg1.frontFragment = null;
PolyPrimitive.destroyPolyPrimitive(_local2);
PolyPrimitive.destroyPolyPrimitive(_local3);
return (true);
};
if (_local4){
addPrimitives.push(_local2);
};
if (_local5){
addPrimitives.push(_local3);
};
};
return (false);
}
alternativa3d function removeOperation(_arg1:Operation):void{
if (_arg1.queued){
operations[operations.indexOf(_arg1)] = dummyOperation;
_arg1.queued = false;
};
}
public function set root(_arg1:Object3D):void{
if (_root != _arg1){
if (_arg1 != null){
if (_arg1._parent != null){
_arg1._parent._children.remove(_arg1);
} else {
if (((!((_arg1._scene == null))) && ((_arg1._scene._root == _arg1)))){
_arg1._scene.root = null;
};
};
_arg1.setParent(null);
_arg1.setScene(this);
_arg1.setLevel(0);
};
if (_root != null){
_root.setParent(null);
_root.setScene(null);
};
_root = _arg1;
};
}
alternativa3d function addOperation(_arg1:Operation):void{
if (!_arg1.queued){
operations.push(_arg1);
_arg1.queued = true;
};
}
public function hasChanges():Boolean{
var _local1:int = operations.length;
var _local2:int;
while (_local2 < _local1) {
if (operations[_local2] != dummyOperation){
return (true);
};
_local2++;
};
return (false);
}
public function set splitBalance(_arg1:Number):void{
_arg1 = ((_arg1)<0) ? 0 : ((_arg1)>1) ? 1 : _arg1;
if (_splitBalance != _arg1){
_splitBalance = _arg1;
if (_splitAnalysis){
addOperation(updateBSPOperation);
};
};
}
public function drawBSP(_arg1:Sprite):void{
_arg1.graphics.clear();
while (_arg1.numChildren > 0) {
_arg1.removeChildAt(0);
};
if (bsp != null){
drawBSPNode(bsp, _arg1, 0, 0, 1);
};
}
protected function addBSP(_arg1:BSPNode, _arg2:PolyPrimitive):void{
var _local3:Point3D;
var _local4:Point3D;
var _local5:*;
var _local6:PolyPrimitive;
var _local7:Array;
var _local8:Array;
var _local9:Boolean;
var _local10:Boolean;
var _local11:uint;
var _local12:Number;
var _local13:PolyPrimitive;
var _local14:PolyPrimitive;
var _local15:Boolean;
var _local16:Number;
var _local17:Number;
var _local18:Number;
var _local19:uint;
var _local20:Number;
var _local21:Point;
if ((((_arg2.mobility < _arg1.mobility)) || (((_arg1.sprited) && (!((_arg2.face == null))))))){
if (_arg1.primitive != null){
childPrimitives[_arg1.primitive] = true;
changedPrimitives[_arg1.primitive] = true;
_arg1.primitive.node = null;
} else {
for (_local5 in _arg1.backPrimitives) {
_local6 = _local5;
childPrimitives[_local6] = true;
changedPrimitives[_local6] = true;
_local6.node = null;
};
for (_local5 in _arg1.frontPrimitives) {
_local6 = _local5;
childPrimitives[_local6] = true;
changedPrimitives[_local6] = true;
_local6.node = null;
};
};
childBSP(_arg1.back);
childBSP(_arg1.front);
assembleChildPrimitives();
if (_splitAnalysis){
analyseSplitQuality();
sortPrimitives(0, (addPrimitives.length - 1));
} else {
sortPrimitivesByMobility(0, (addPrimitives.length - 1));
};
_arg1.primitive = _arg2;
changedPrimitives[_arg2] = true;
_arg2.node = _arg1;
_arg1.normal.copy(_arg2.face.globalNormal);
_arg1.offset = _arg2.face.globalOffset;
_arg1.sprited = false;
_arg1.mobility = _arg2.mobility;
_arg1.backPrimitives = null;
_arg1.frontPrimitives = null;
_arg1.back = null;
_arg1.front = null;
} else {
_local4 = _arg1.normal;
_local7 = _arg2.points;
_local8 = _arg2.uvs;
_local9 = false;
_local10 = false;
_local11 = 0;
while (_local11 < _arg2.num) {
_local3 = _local7[_local11];
_local12 = ((((_local3.x * _local4.x) + (_local3.y * _local4.y)) + (_local3.z * _local4.z)) - _arg1.offset);
if (_local12 > _planeOffsetThreshold){
_local9 = true;
if (_local10){
break;
};
} else {
if (_local12 < -(_planeOffsetThreshold)){
_local10 = true;
if (_local9){
break;
};
};
};
_local11++;
};
if (((((!(_local9)) && (!(_local10)))) && (((!((_arg2.face == null))) || (_arg1.sprited))))){
_arg2.node = _arg1;
if (_arg1.primitive != null){
_arg1.frontPrimitives = new Set(true);
_arg1.frontPrimitives[_arg1.primitive] = true;
_arg1.primitive = null;
};
if ((((_arg2.face == null)) || ((Point3D.dot(_arg2.face.globalNormal, _local4) > 0)))){
_arg1.frontPrimitives[_arg2] = true;
} else {
if (_arg1.backPrimitives == null){
_arg1.backPrimitives = new Set(true);
};
_arg1.backPrimitives[_arg2] = true;
};
changedPrimitives[_arg2] = true;
} else {
if (!_local10){
if (_arg1.front == null){
_arg1.front = BSPNode.createBSPNode(_arg2);
_arg1.front.parent = _arg1;
changedPrimitives[_arg2] = true;
} else {
addBSP(_arg1.front, _arg2);
};
} else {
if (!_local9){
if (_arg1.back == null){
_arg1.back = BSPNode.createBSPNode(_arg2);
_arg1.back.parent = _arg1;
changedPrimitives[_arg2] = true;
} else {
addBSP(_arg1.back, _arg2);
};
} else {
_local13 = PolyPrimitive.createPolyPrimitive();
_local14 = PolyPrimitive.createPolyPrimitive();
_local15 = true;
_local3 = _local7[0];
_local16 = ((((_local3.x * _local4.x) + (_local3.y * _local4.y)) + (_local3.z * _local4.z)) - _arg1.offset);
_local17 = _local16;
_local11 = 0;
while (_local11 < _arg2.num) {
if (_local11 < (_arg2.num - 1)){
_local19 = (_local11 + 1);
_local3 = _local7[_local19];
_local18 = ((((_local3.x * _local4.x) + (_local3.y * _local4.y)) + (_local3.z * _local4.z)) - _arg1.offset);
} else {
_local19 = 0;
_local18 = _local16;
};
if (_local17 > _planeOffsetThreshold){
_local14.points.push(_local7[_local11]);
_local14.uvs.push(_arg2.uvs[_local11]);
} else {
if (_local17 < -(_planeOffsetThreshold)){
_local13.points.push(_local7[_local11]);
_local13.uvs.push(_arg2.uvs[_local11]);
} else {
_local13.points.push(_local7[_local11]);
_local13.uvs.push(_arg2.uvs[_local11]);
_local14.points.push(_local7[_local11]);
_local14.uvs.push(_arg2.uvs[_local11]);
};
};
if ((((((_local17 > _planeOffsetThreshold)) && ((_local18 < -(_planeOffsetThreshold))))) || ((((_local17 < -(_planeOffsetThreshold))) && ((_local18 > _planeOffsetThreshold)))))){
_local20 = (_local17 / (_local17 - _local18));
_local3 = Point3D.interpolate(_local7[_local11], _local7[_local19], _local20);
_local13.points.push(_local3);
_local14.points.push(_local3);
if (_arg2.face.uvMatrixBase != null){
_local21 = Point.interpolate(_local8[_local19], _local8[_local11], _local20);
} else {
_local21 = null;
};
_local13.uvs.push(_local21);
_local14.uvs.push(_local21);
if (_local15){
_arg2.splitTime1 = _local20;
_local15 = false;
} else {
_arg2.splitTime2 = _local20;
};
};
_local17 = _local18;
_local11++;
};
_local13.num = _local13.points.length;
_local14.num = _local14.points.length;
_local13.mobility = _arg2.mobility;
_local14.mobility = _arg2.mobility;
_local13.face = _arg2.face;
_local14.face = _arg2.face;
_local13.parent = _arg2;
_local14.parent = _arg2;
_local13.sibling = _local14;
_local14.sibling = _local13;
_arg2.backFragment = _local13;
_arg2.frontFragment = _local14;
if (_arg1.back == null){
_arg1.back = BSPNode.createBSPNode(_local13);
_arg1.back.parent = _arg1;
changedPrimitives[_local13] = true;
} else {
addBSP(_arg1.back, _local13);
};
if (_arg1.front == null){
_arg1.front = BSPNode.createBSPNode(_local14);
_arg1.front.parent = _arg1;
changedPrimitives[_local14] = true;
} else {
addBSP(_arg1.front, _local14);
};
};
};
};
};
}
public function get root():Object3D{
return (_root);
}
public function calculate():void{
var _local1:Operation;
var _local2:uint;
var _local3:uint;
if (operations[0] != undefined){
_local2 = operations.length;
_local3 = 0;
while (_local3 < _local2) {
_local1 = operations[_local3];
_local1.collectSequels(operations);
_local3++;
};
_local2 = operations.length;
sortOperations(0, (_local2 - 1));
_local3 = 0;
while (_local3 < _local2) {
_local1 = operations[_local3];
if (_local1.method != null){
_local1.method();
};
_local3++;
};
_local3 = 0;
while (_local3 < _local2) {
_local1 = operations.pop();
_local1.queued = false;
_local3++;
};
};
}
public function get splitBalance():Number{
return (_splitBalance);
}
alternativa3d function sortPrimitivesByMobility(_arg1:int, _arg2:int):void{
var _local5:PolyPrimitive;
var _local7:PolyPrimitive;
var _local3:int = _arg1;
var _local4:int = _arg2;
var _local6:int = addPrimitives[((_arg2 + _arg1) >> 1)].mobility;
do {
while ((_local5 = addPrimitives[_local3]).mobility > _local6) {
_local3++;
};
while (_local6 > (_local7 = addPrimitives[_local4]).mobility) {
_local4--;
};
if (_local3 <= _local4){
var _temp1 = _local3;
_local3 = (_local3 + 1);
var _local8 = _temp1;
addPrimitives[_local8] = _local7;
var _temp2 = _local4;
_local4 = (_local4 - 1);
var _local9 = _temp2;
addPrimitives[_local9] = _local5;
};
} while (_local3 <= _local4);
if (_arg1 < _local4){
sortPrimitivesByMobility(_arg1, _local4);
};
if (_local3 < _arg2){
sortPrimitivesByMobility(_local3, _arg2);
};
}
protected function assembleChildPrimitives():void{
var _local1:PolyPrimitive;
while ((_local1 = childPrimitives.take()) != null) {
assemblePrimitive(_local1);
};
}
protected function calculateBSP():void{
var _local1:*;
var _local2:PolyPrimitive;
var _local3:BSPNode;
var _local4:BSPNode;
var _local5:BSPNode;
var _local6:BSPNode;
if (updateBSPOperation.queued){
removeNodes.clear();
childBSP(bsp);
bsp = null;
assembleChildPrimitives();
} else {
if (!removeNodes.isEmpty()){
while ((_local3 = removeNodes.peek()) != null) {
_local4 = _local3;
while ((_local3 = _local3.parent) != null) {
if (removeNodes[_local3]){
_local4 = _local3;
};
};
_local5 = _local4.parent;
_local6 = removeBSPNode(_local4);
if (_local6 == dummyNode){
_local6 = null;
};
if (_local5 != null){
if (_local5.front == _local4){
_local5.front = _local6;
} else {
_local5.back = _local6;
};
} else {
bsp = _local6;
};
if (_local6 != null){
_local6.parent = _local5;
};
};
assembleChildPrimitives();
};
};
if (addPrimitives[0] != undefined){
if (_splitAnalysis){
analyseSplitQuality();
sortPrimitives(0, (addPrimitives.length - 1));
} else {
sortPrimitivesByMobility(0, (addPrimitives.length - 1));
};
if (bsp == null){
_local2 = addPrimitives.pop();
bsp = BSPNode.createBSPNode(_local2);
changedPrimitives[_local2] = true;
};
while ((_local2 = addPrimitives.pop()) != null) {
addBSP(bsp, _local2);
};
};
}
}
}//package alternativa.engine3d.core
Section 11
//Sprite3D (alternativa.engine3d.core.Sprite3D)
package alternativa.engine3d.core {
import alternativa.engine3d.materials.*;
import alternativa.engine3d.*;
public class Sprite3D extends Object3D {
alternativa3d var _materialScale:Number;
alternativa3d var _material:SpriteMaterial;
alternativa3d var primitive:SpritePrimitive;
alternativa3d var updateMaterialOperation:Operation;
private static var counter:uint = 0;
public function Sprite3D(_arg1:String=null){
updateMaterialOperation = new Operation("updateSpriteMaterial", this, updateMaterial, Operation.SPRITE_UPDATE_MATERIAL);
super(_arg1);
primitive = new SpritePrimitive();
primitive.sprite = this;
primitive.points = [this.globalCoords];
primitive.num = 1;
primitive.mobility = int.MAX_VALUE;
}
override protected function removeFromScene(_arg1:Scene3D):void{
_arg1.removeOperation(updateMaterialOperation);
if (primitive.node != null){
_arg1.removeBSPPrimitive(primitive);
};
_arg1.addOperation(_arg1.calculateBSPOperation);
calculateTransformationOperation.removeSequel(_arg1.calculateBSPOperation);
updateMaterialOperation.removeSequel(_arg1.changePrimitivesOperation);
if (_material != null){
_material.removeFromScene(_arg1);
};
super.removeFromScene(_arg1);
}
public function get material():SpriteMaterial{
return (_material);
}
override alternativa3d function calculateTransformation():void{
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;
super.calculateTransformation();
updatePrimitive();
if (changeRotationOrScaleOperation.queued){
_local1 = _transformation.a;
_local2 = _transformation.b;
_local3 = _transformation.c;
_local4 = _transformation.e;
_local5 = _transformation.f;
_local6 = _transformation.g;
_local7 = _transformation.i;
_local8 = _transformation.j;
_local9 = _transformation.k;
_materialScale = (((Math.sqrt((((_local1 * _local1) + (_local4 * _local4)) + (_local7 * _local7))) + Math.sqrt((((_local2 * _local2) + (_local5 * _local5)) + (_local8 * _local8)))) + Math.sqrt((((_local3 * _local3) + (_local6 * _local6)) + (_local9 * _local9)))) / 3);
};
}
private function updateMaterial():void{
if (!calculateTransformationOperation.queued){
_scene.changedPrimitives[primitive] = true;
};
}
override protected function createEmptyObject():Object3D{
return (new Sprite3D());
}
alternativa3d function addMaterialChangedOperationToScene():void{
if (_scene != null){
_scene.addOperation(updateMaterialOperation);
};
}
override protected function clonePropertiesFrom(_arg1:Object3D):void{
super.clonePropertiesFrom(_arg1);
material = ((_arg1 as Sprite3D).material.clone() as SpriteMaterial);
}
override protected function defaultName():String{
return (("sprite" + ++counter));
}
public function set material(_arg1:SpriteMaterial):void{
if (_material != _arg1){
if (_material != null){
_material.removeFromSprite(this);
if (_scene != null){
_material.removeFromScene(_scene);
};
};
if (_arg1 != null){
if (_arg1._sprite != null){
_arg1._sprite.material = null;
};
_arg1.addToSprite(this);
if (_scene != null){
_arg1.addToScene(_scene);
};
};
_material = _arg1;
addMaterialChangedOperationToScene();
};
}
private function updatePrimitive():void{
if (primitive.node != null){
_scene.removeBSPPrimitive(primitive);
};
_scene.addPrimitives.push(primitive);
}
override protected function addToScene(_arg1:Scene3D):void{
super.addToScene(_arg1);
calculateTransformationOperation.addSequel(_arg1.calculateBSPOperation);
updateMaterialOperation.addSequel(_arg1.changePrimitivesOperation);
if (_material != null){
_material.addToScene(_arg1);
};
}
}
}//package alternativa.engine3d.core
Section 12
//SpritePrimitive (alternativa.engine3d.core.SpritePrimitive)
package alternativa.engine3d.core {
import alternativa.engine3d.*;
public class SpritePrimitive extends PolyPrimitive {
alternativa3d var sprite:Sprite3D;
alternativa3d var screenDepth:Number;
public function SpritePrimitive(){
uvs = null;
}
override public function toString():String{
return ((("[SpritePrimitive " + sprite.toString()) + "]"));
}
}
}//package alternativa.engine3d.core
Section 13
//Surface (alternativa.engine3d.core.Surface)
package alternativa.engine3d.core {
import flash.events.*;
import alternativa.types.*;
import alternativa.engine3d.materials.*;
import alternativa.engine3d.errors.*;
import alternativa.engine3d.*;
public class Surface implements IEventDispatcher {
alternativa3d var _material:SurfaceMaterial;
alternativa3d var _mesh:Mesh;
public var mouseEnabled:Boolean;// = true
alternativa3d var changeFacesOperation:Operation;
private var dispatcher:EventDispatcher;
alternativa3d var changeMaterialOperation:Operation;
alternativa3d var _faces:Set;
public function Surface(){
changeFacesOperation = new Operation("changeFaces", this);
changeMaterialOperation = new Operation("changeMaterial", this);
_faces = new Set();
super();
}
public function dispatchEvent(_arg1:Event):Boolean{
if (dispatcher != null){
dispatcher.dispatchEvent(_arg1);
};
return (false);
}
public function removeFace(_arg1:Object):void{
var _local2 = (_arg1 is Face);
if (_mesh == null){
throw (new FaceNotFoundError(_arg1, this));
};
if (_arg1 == null){
throw (new FaceNotFoundError(null, this));
};
if (_local2){
if (Face(_arg1)._mesh != _mesh){
throw (new FaceNotFoundError(_arg1, this));
};
} else {
if (_mesh._faces[_arg1] == undefined){
throw (new FaceNotFoundError(_arg1, this));
};
if (!(_mesh._faces[_arg1] is Face)){
throw (new InvalidIDError(_arg1, this));
};
};
var _local3:Face = (_local2) ? Face(_arg1) : _mesh._faces[_arg1];
if (!_faces.has(_local3)){
throw (new FaceNotFoundError(_local3, this));
};
_faces.remove(_local3);
_local3.removeFromSurface(this);
_mesh.addOperationToScene(changeFacesOperation);
}
alternativa3d function addToMesh(_arg1:Mesh):void{
if (_material != null){
_material.addToMesh(_arg1);
};
_mesh = _arg1;
}
public function removeEventListener(_arg1:String, _arg2:Function, _arg3:Boolean=false):void{
if (dispatcher != null){
_arg3 = false;
dispatcher.removeEventListener(_arg1, _arg2, _arg3);
};
}
public function addEventListener(_arg1:String, _arg2:Function, _arg3:Boolean=false, _arg4:int=0, _arg5:Boolean=false):void{
if (dispatcher == null){
dispatcher = new EventDispatcher(this);
};
_arg3 = false;
dispatcher.addEventListener(_arg1, _arg2, _arg3, _arg4, _arg5);
}
alternativa3d function removeFaces():void{
var _local1:*;
var _local2:Face;
for (_local1 in _faces) {
_local2 = _local1;
_faces.remove(_local2);
_local2.removeFromSurface(this);
};
}
public function set material(_arg1:SurfaceMaterial):void{
if (_material != _arg1){
if (_material != null){
_material.removeFromSurface(this);
if (_mesh != null){
_material.removeFromMesh(_mesh);
if (_mesh._scene != null){
_material.removeFromScene(_mesh._scene);
};
};
};
if (_arg1 != null){
if (_arg1._surface != null){
_arg1._surface.material = null;
};
_arg1.addToSurface(this);
if (_mesh != null){
_arg1.addToMesh(_mesh);
if (_mesh._scene != null){
_arg1.addToScene(_mesh._scene);
};
};
};
_material = _arg1;
addMaterialChangedOperationToScene();
};
}
public function get id():Object{
return (((_mesh)!=null) ? _mesh.getSurfaceId(this) : null);
}
alternativa3d function removeFromScene(_arg1:Scene3D):void{
_arg1.removeOperation(changeFacesOperation);
_arg1.removeOperation(changeMaterialOperation);
if (_material != null){
_material.removeFromScene(_arg1);
};
}
alternativa3d function removeFromMesh(_arg1:Mesh):void{
if (_material != null){
_material.removeFromMesh(_arg1);
};
_mesh = null;
}
public function addFace(_arg1:Object):void{
var _local2 = (_arg1 is Face);
if (_mesh == null){
throw (new FaceNotFoundError(_arg1, this));
};
if (_arg1 == null){
throw (new FaceNotFoundError(null, this));
};
if (_local2){
if (Face(_arg1)._mesh != _mesh){
throw (new FaceNotFoundError(_arg1, this));
};
} else {
if (_mesh._faces[_arg1] == undefined){
throw (new FaceNotFoundError(_arg1, this));
};
if (!(_mesh._faces[_arg1] is Face)){
throw (new InvalidIDError(_arg1, this));
};
};
var _local3:Face = (_local2) ? Face(_arg1) : _mesh._faces[_arg1];
if (_faces.has(_local3)){
throw (new FaceExistsError(_local3, this));
};
if (_local3._surface != null){
_local3._surface._faces.remove(_local3);
_local3.removeFromSurface(_local3._surface);
};
_faces.add(_local3);
_local3.addToSurface(this);
_mesh.addOperationToScene(changeFacesOperation);
}
public function willTrigger(_arg1:String):Boolean{
if (dispatcher != null){
return (dispatcher.willTrigger(_arg1));
};
return (false);
}
public function toString():String{
var _local4:*;
var _local5:Face;
var _local1:uint = _faces.length;
var _local2:String = (("[Surface ID:" + id) + ((_local1)>0) ? " faces:" : "");
var _local3:uint;
for (_local4 in _faces) {
_local5 = _local4;
_local2 = (_local2 + (_local5.id + ((_local3)<(_local1 - 1)) ? ", " : ""));
_local3++;
};
_local2 = (_local2 + "]");
return (_local2);
}
public function get mesh():Mesh{
return (_mesh);
}
public function hasEventListener(_arg1:String):Boolean{
if (dispatcher != null){
return (dispatcher.hasEventListener(_arg1));
};
return (false);
}
public function get faces():Set{
return (_faces.clone());
}
alternativa3d function addToScene(_arg1:Scene3D):void{
if (_material != null){
_material.addToScene(_arg1);
};
}
alternativa3d function addMaterialChangedOperationToScene():void{
if (_mesh != null){
_mesh.addOperationToScene(changeMaterialOperation);
};
}
public function get material():SurfaceMaterial{
return (_material);
}
}
}//package alternativa.engine3d.core
Section 14
//Vertex (alternativa.engine3d.core.Vertex)
package alternativa.engine3d.core {
import alternativa.types.*;
import alternativa.engine3d.*;
public final class Vertex {
alternativa3d var _mesh:Mesh;
alternativa3d var changeCoordsOperation:Operation;
alternativa3d var globalCoords:Point3D;
alternativa3d var calculateCoordsOperation:Operation;
alternativa3d var _faces:Set;
alternativa3d var _coords:Point3D;
public function Vertex(_arg1:Number=0, _arg2:Number=0, _arg3:Number=0){
changeCoordsOperation = new Operation("changeCoords", this);
calculateCoordsOperation = new Operation("calculateCoords", this, calculateCoords, Operation.VERTEX_CALCULATE_COORDS);
_faces = new Set();
globalCoords = new Point3D();
super();
_coords = new Point3D(_arg1, _arg2, _arg3);
changeCoordsOperation.addSequel(calculateCoordsOperation);
}
alternativa3d function addToFace(_arg1:Face):void{
changeCoordsOperation.addSequel(_arg1.calculateUVOperation);
changeCoordsOperation.addSequel(_arg1.calculateNormalOperation);
_faces.add(_arg1);
}
alternativa3d function removeFromFace(_arg1:Face):void{
changeCoordsOperation.removeSequel(_arg1.calculateUVOperation);
changeCoordsOperation.removeSequel(_arg1.calculateNormalOperation);
_faces.remove(_arg1);
}
alternativa3d function addToMesh(_arg1:Mesh):void{
_arg1.changeCoordsOperation.addSequel(calculateCoordsOperation);
_arg1.changeRotationOrScaleOperation.addSequel(calculateCoordsOperation);
_mesh = _arg1;
}
public function get id():Object{
return (((_mesh)!=null) ? _mesh.getVertexId(this) : null);
}
public function get coords():Point3D{
return (_coords.clone());
}
alternativa3d function removeFromMesh(_arg1:Mesh):void{
var _local2:*;
var _local3:Face;
_arg1.changeCoordsOperation.removeSequel(calculateCoordsOperation);
_arg1.changeRotationOrScaleOperation.removeSequel(calculateCoordsOperation);
for (_local2 in _faces) {
_local3 = _local2;
_arg1.removeFace(_local3);
};
_mesh = null;
}
private function calculateCoords():void{
globalCoords.copy(_coords);
globalCoords.transform(_mesh._transformation);
}
alternativa3d function removeFromScene(_arg1:Scene3D):void{
_arg1.removeOperation(calculateCoordsOperation);
_arg1.removeOperation(changeCoordsOperation);
}
public function toString():String{
return ((((((((("[Vertex ID:" + id) + " ") + _coords.x.toFixed(2)) + ", ") + _coords.y.toFixed(2)) + ", ") + _coords.z.toFixed(2)) + "]"));
}
public function get mesh():Mesh{
return (_mesh);
}
public function set x(_arg1:Number):void{
if (_coords.x != _arg1){
_coords.x = _arg1;
if (_mesh != null){
_mesh.addOperationToScene(changeCoordsOperation);
};
};
}
public function set y(_arg1:Number):void{
if (_coords.y != _arg1){
_coords.y = _arg1;
if (_mesh != null){
_mesh.addOperationToScene(changeCoordsOperation);
};
};
}
public function set z(_arg1:Number):void{
if (_coords.z != _arg1){
_coords.z = _arg1;
if (_mesh != null){
_mesh.addOperationToScene(changeCoordsOperation);
};
};
}
public function get faces():Set{
return (_faces.clone());
}
public function get x():Number{
return (_coords.x);
}
public function get y():Number{
return (_coords.y);
}
public function get z():Number{
return (_coords.z);
}
public function set coords(_arg1:Point3D):void{
if (!_coords.equals(_arg1)){
_coords.copy(_arg1);
if (_mesh != null){
_mesh.addOperationToScene(changeCoordsOperation);
};
};
}
alternativa3d function addToScene(_arg1:Scene3D):void{
_arg1.addOperation(calculateCoordsOperation);
}
}
}//package alternativa.engine3d.core
Section 15
//Skin (alternativa.engine3d.display.Skin)
package alternativa.engine3d.display {
import alternativa.engine3d.core.*;
import alternativa.engine3d.materials.*;
import flash.display.*;
import alternativa.engine3d.*;
public class Skin extends Sprite {
alternativa3d var nextSkin:Skin;
alternativa3d var material:Material;
alternativa3d var primitive:PolyPrimitive;
alternativa3d var gfx:Graphics;
private static var collector:Array = new Array();
public function Skin(){
gfx = graphics;
super();
}
alternativa3d static function createSkin():Skin{
var _local1:Skin;
_local1 = collector.pop();
if (_local1 != null){
return (_local1);
};
return (new (Skin));
}
alternativa3d static function destroySkin(_arg1:Skin):void{
collector.push(_arg1);
}
}
}//package alternativa.engine3d.display
Section 16
//View (alternativa.engine3d.display.View)
package alternativa.engine3d.display {
import flash.events.*;
import alternativa.engine3d.core.*;
import alternativa.types.*;
import flash.geom.*;
import flash.display.*;
import alternativa.engine3d.events.*;
import alternativa.engine3d.*;
public class View extends Sprite {
private var pressedObject:Object3D;
private var inverseMatrix:Matrix3D;
private var localCursor3DCoords:Point3D;
private var currentObject:Object3D;
private var pressedFace:Face;
alternativa3d var _interactive:Boolean;
private var lastMouseEvent:MouseEvent;
private var stagePoint:Point;
private var pressedSurface:Surface;
private var _camera:Camera3D;
alternativa3d var _height:Number;
alternativa3d var _width:Number;
private var globalCursor3DCoords:Point3D;
private var objectUnderPoint:Object3D;
private var faceUnderPoint:Face;
private var lineVector:Point3D;
alternativa3d var canvas:Sprite;
private var uvPoint:Point;
private var currentSurface:Surface;
private var currentFace:Face;
private var linePoint:Point3D;
public function View(_arg1:Camera3D=null, _arg2:Number=0, _arg3:Number=0){
stagePoint = new Point();
lineVector = new Point3D();
linePoint = new Point3D();
globalCursor3DCoords = new Point3D();
localCursor3DCoords = new Point3D();
uvPoint = new Point();
inverseMatrix = new Matrix3D();
super();
canvas = new Sprite();
canvas.mouseEnabled = false;
canvas.mouseChildren = false;
canvas.tabEnabled = false;
canvas.tabChildren = false;
addChild(canvas);
this.camera = _arg1;
this.width = _arg2;
this.height = _arg3;
}
private function getInteractiveObjectUnderPoint(_arg1:Number, _arg2:Number):void{
var _local4:Skin;
var _local6:Sprite3D;
faceUnderPoint = null;
objectUnderPoint = null;
stagePoint.x = _arg1;
stagePoint.y = _arg2;
var _local3:Array = stage.getObjectsUnderPoint(stagePoint);
var _local5:int = (_local3.length - 1);
while (_local5 >= 0) {
_local4 = (_local3[_local5] as Skin);
if (((!((_local4 == null))) && ((_local4.parent.parent == this)))){
if (_local4.primitive.face != null){
if (_local4.primitive.face._mesh.mouseEnabled){
faceUnderPoint = _local4.primitive.face;
objectUnderPoint = faceUnderPoint._mesh;
return;
};
} else {
_local6 = (_local4.primitive as SpritePrimitive).sprite;
if (_local6.mouseEnabled){
objectUnderPoint = _local6;
return;
};
};
};
_local5--;
};
}
private function processMouseWheel():void{
var _local1:MouseEvent3D;
if (objectUnderPoint == null){
return;
};
if (faceUnderPoint != null){
currentFace = faceUnderPoint;
currentSurface = faceUnderPoint._surface;
if (currentFace.mouseEnabled){
_local1 = createFullMouseEvent3D(MouseEvent3D.MOUSE_WHEEL, currentObject, currentSurface, currentFace);
currentFace.dispatchEvent(_local1);
};
if (currentSurface.mouseEnabled){
_local1 = createFullMouseEvent3D(MouseEvent3D.MOUSE_WHEEL, currentObject, currentSurface, currentFace);
currentSurface.dispatchEvent(_local1);
};
} else {
currentFace = null;
currentSurface = null;
};
currentObject = objectUnderPoint;
_local1 = createFullMouseEvent3D(MouseEvent3D.MOUSE_WHEEL, currentObject, currentSurface, currentFace);
currentObject.dispatchEvent(_local1);
}
override public function set width(_arg1:Number):void{
if (_width != _arg1){
_width = _arg1;
canvas.x = (_width * 0.5);
if (_camera != null){
camera.addOperationToScene(camera.calculatePlanesOperation);
};
};
}
private function createSimpleMouseEvent3D(_arg1:String, _arg2:Object3D, _arg3:Surface, _arg4:Face):MouseEvent3D{
var _local5:Boolean = ((lastMouseEvent == null)) ? false : lastMouseEvent.altKey;
var _local6:Boolean = ((lastMouseEvent == null)) ? false : lastMouseEvent.ctrlKey;
var _local7:Boolean = ((lastMouseEvent == null)) ? false : lastMouseEvent.shiftKey;
var _local8:int = ((lastMouseEvent == null)) ? 0 : lastMouseEvent.delta;
return (new MouseEvent3D(_arg1, this, _arg2, _arg3, _arg4, NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN, _local5, _local6, _local7, _local8));
}
override public function getObjectsUnderPoint(_arg1:Point):Array{
var _local7:Skin;
var _local2:Point = localToGlobal(_arg1);
var _local3:Array = stage.getObjectsUnderPoint(_local2);
var _local4:Array = new Array();
var _local5:uint = _local3.length;
var _local6:uint;
while (_local6 < _local5) {
_local7 = (_local3[_local6] as Skin);
if (((!((_local7 == null))) && ((_local7.parent.parent == this)))){
if (_local7.primitive.face != null){
_local4.push(_local7.primitive.face);
} else {
_local4.push((_local7.primitive as SpritePrimitive).sprite);
};
};
_local6++;
};
return (_local4);
}
alternativa3d function checkMouseOverOut(_arg1:Boolean=false):void{
var _local2:MouseEvent3D;
var _local3:Surface;
var _local4:Boolean;
var _local5:Boolean;
var _local6:Boolean;
if (_arg1){
getInteractiveObjectUnderPoint(stage.mouseX, stage.mouseY);
getInteractiveObjectPointProperties((mouseX - (_width >> 1)), (mouseY - (_height >> 1)));
};
if (objectUnderPoint == null){
if (currentFace != null){
if (currentFace.mouseEnabled){
_local2 = createSimpleMouseEvent3D(MouseEvent3D.MOUSE_OUT, currentObject, currentSurface, currentFace);
currentFace.dispatchEvent(_local2);
};
if (currentSurface.mouseEnabled){
_local2 = createSimpleMouseEvent3D(MouseEvent3D.MOUSE_OUT, currentObject, currentSurface, currentFace);
currentSurface.dispatchEvent(_local2);
};
};
if (currentObject != null){
_local2 = createSimpleMouseEvent3D(MouseEvent3D.MOUSE_OUT, currentObject, currentSurface, currentFace);
currentObject.dispatchEvent(_local2);
};
currentFace = null;
currentSurface = null;
currentObject = null;
} else {
if (faceUnderPoint != null){
_local3 = faceUnderPoint._surface;
};
if (faceUnderPoint != currentFace){
if (((!((currentFace == null))) && (currentFace.mouseEnabled))){
_local2 = createSimpleMouseEvent3D(MouseEvent3D.MOUSE_OUT, currentObject, currentSurface, currentFace);
currentFace.dispatchEvent(_local2);
};
_local4 = true;
if (_local3 != currentSurface){
if (((!((currentSurface == null))) && (currentSurface.mouseEnabled))){
_local2 = createSimpleMouseEvent3D(MouseEvent3D.MOUSE_OUT, currentObject, currentSurface, currentFace);
currentSurface.dispatchEvent(_local2);
};
_local5 = true;
};
};
if (objectUnderPoint != currentObject){
if (currentObject != null){
_local2 = createSimpleMouseEvent3D(MouseEvent3D.MOUSE_OUT, currentObject, currentSurface, currentFace);
currentObject.dispatchEvent(_local2);
};
_local6 = true;
};
currentFace = faceUnderPoint;
currentSurface = _local3;
currentObject = objectUnderPoint;
if (currentFace != null){
if (((_local4) && (currentFace.mouseEnabled))){
_local2 = createFullMouseEvent3D(MouseEvent3D.MOUSE_OVER, currentObject, currentSurface, currentFace);
currentFace.dispatchEvent(_local2);
};
if (((_local5) && (currentSurface.mouseEnabled))){
_local2 = createFullMouseEvent3D(MouseEvent3D.MOUSE_OVER, currentObject, currentSurface, currentFace);
currentSurface.dispatchEvent(_local2);
};
};
if (_local6){
_local2 = createFullMouseEvent3D(MouseEvent3D.MOUSE_OVER, currentObject, currentSurface, currentFace);
currentObject.dispatchEvent(_local2);
};
};
}
public function get camera():Camera3D{
return (_camera);
}
override public function get height():Number{
return (_height);
}
public function getObjectUnderPoint(_arg1:Point):Object{
var _local4:Skin;
var _local2:Point = localToGlobal(_arg1);
var _local3:Array = stage.getObjectsUnderPoint(_local2);
var _local5:int = (_local3.length - 1);
while (_local5 >= 0) {
_local4 = (_local3[_local5] as Skin);
if (((!((_local4 == null))) && ((_local4.parent.parent == this)))){
return (((_local4.primitive.face)!=null) ? _local4.primitive.face : (_local4.primitive as SpritePrimitive).sprite);
};
_local5--;
};
return (null);
}
private function processMouseUp():void{
var _local1:MouseEvent3D;
if (objectUnderPoint == null){
pressedFace = null;
pressedSurface = null;
pressedObject = null;
return;
};
if (faceUnderPoint != null){
currentFace = faceUnderPoint;
currentSurface = faceUnderPoint._surface;
} else {
currentFace = null;
currentSurface = null;
};
currentObject = objectUnderPoint;
if (((!((currentFace == null))) && (currentFace.mouseEnabled))){
_local1 = createFullMouseEvent3D(MouseEvent3D.MOUSE_UP, currentObject, currentSurface, currentFace);
currentFace.dispatchEvent(_local1);
};
if (((!((currentSurface == null))) && (currentSurface.mouseEnabled))){
_local1 = createFullMouseEvent3D(MouseEvent3D.MOUSE_UP, currentObject, currentSurface, currentFace);
currentSurface.dispatchEvent(_local1);
};
_local1 = createFullMouseEvent3D(MouseEvent3D.MOUSE_UP, currentObject, currentSurface, currentFace);
currentObject.dispatchEvent(_local1);
if (((((!((currentFace == null))) && ((currentFace == pressedFace)))) && (currentFace.mouseEnabled))){
_local1 = createFullMouseEvent3D(MouseEvent3D.CLICK, currentObject, currentSurface, currentFace);
currentFace.dispatchEvent(_local1);
};
if (((((!((currentSurface == null))) && ((currentSurface == pressedSurface)))) && (currentSurface.mouseEnabled))){
_local1 = createFullMouseEvent3D(MouseEvent3D.CLICK, currentObject, currentSurface, currentFace);
currentSurface.dispatchEvent(_local1);
};
if (currentObject == pressedObject){
_local1 = createFullMouseEvent3D(MouseEvent3D.CLICK, currentObject, currentSurface, currentFace);
currentObject.dispatchEvent(_local1);
};
pressedFace = null;
pressedSurface = null;
pressedObject = null;
}
private function onMouseEvent(_arg1:MouseEvent):void{
lastMouseEvent = _arg1;
getInteractiveObjectUnderPoint(stage.mouseX, stage.mouseY);
getInteractiveObjectPointProperties((mouseX - (_width >> 1)), (mouseY - (_height >> 1)));
switch (_arg1.type){
case MouseEvent.MOUSE_MOVE:
processMouseMove();
break;
case MouseEvent.MOUSE_OUT:
stage.addEventListener(MouseEvent.MOUSE_UP, stageMouseUp);
checkMouseOverOut();
break;
case MouseEvent.MOUSE_DOWN:
processMouseDown();
break;
case MouseEvent.MOUSE_UP:
processMouseUp();
break;
case MouseEvent.MOUSE_WHEEL:
processMouseWheel();
break;
};
lastMouseEvent = null;
}
private function processMouseDown():void{
var _local1:MouseEvent3D;
if (objectUnderPoint == null){
return;
};
if (faceUnderPoint != null){
currentFace = faceUnderPoint;
currentSurface = faceUnderPoint._surface;
} else {
currentFace = null;
currentSurface = null;
};
currentObject = (pressedObject = objectUnderPoint);
if (((!((currentFace == null))) && (currentFace.mouseEnabled))){
pressedFace = currentFace;
_local1 = createFullMouseEvent3D(MouseEvent3D.MOUSE_DOWN, currentObject, currentSurface, currentFace);
currentFace.dispatchEvent(_local1);
};
if (((!((currentSurface == null))) && (currentSurface.mouseEnabled))){
pressedSurface = currentSurface;
_local1 = createFullMouseEvent3D(MouseEvent3D.MOUSE_DOWN, currentObject, currentSurface, currentFace);
currentSurface.dispatchEvent(_local1);
};
_local1 = createFullMouseEvent3D(MouseEvent3D.MOUSE_DOWN, currentObject, currentSurface, currentFace);
currentObject.dispatchEvent(_local1);
}
private function stageMouseUp(_arg1:MouseEvent):void{
pressedFace = null;
pressedSurface = null;
pressedObject = null;
stage.removeEventListener(MouseEvent.MOUSE_UP, stageMouseUp);
}
public function get3DCoords(_arg1:Point, _arg2:Number):Point3D{
var _local3:Number;
if (_camera == null){
return (null);
};
if (_camera._orthographic){
return (new Point3D((_arg1.x - (_width >> 1)), (_arg1.y - (_height >> 1)), _arg2));
};
_local3 = (_arg2 / _camera.focalLength);
return (new Point3D(((_arg1.x - (_width >> 1)) * _local3), ((_arg1.y - (_height >> 1)) * _local3), _arg2));
}
public function set camera(_arg1:Camera3D):void{
var _local2:Skin;
var _local3:Skin;
if (_camera != _arg1){
if (_camera != null){
_camera.removeFromView(this);
};
if (_arg1 != null){
if (_arg1._view != null){
_arg1._view.camera = null;
};
_arg1.addToView(this);
} else {
if (canvas.numChildren > 0){
_local2 = Skin(canvas.getChildAt(0));
while (_local2 != null) {
_local3 = _local2.nextSkin;
canvas.removeChild(_local2);
if (_local2.material != null){
_local2.material.clear(_local2);
};
_local2.nextSkin = null;
_local2.primitive = null;
_local2.material = null;
Skin.destroySkin(_local2);
_local2 = _local3;
};
};
};
_camera = _arg1;
};
}
public function set interactive(_arg1:Boolean):void{
if (_interactive == _arg1){
return;
};
_interactive = _arg1;
if (_interactive){
addEventListener(MouseEvent.MOUSE_DOWN, onMouseEvent);
addEventListener(MouseEvent.MOUSE_UP, onMouseEvent);
addEventListener(MouseEvent.MOUSE_MOVE, onMouseEvent);
addEventListener(MouseEvent.MOUSE_WHEEL, onMouseEvent);
addEventListener(MouseEvent.MOUSE_OUT, onMouseEvent);
} else {
removeEventListener(MouseEvent.MOUSE_DOWN, onMouseEvent);
removeEventListener(MouseEvent.MOUSE_UP, onMouseEvent);
removeEventListener(MouseEvent.MOUSE_MOVE, onMouseEvent);
removeEventListener(MouseEvent.MOUSE_WHEEL, onMouseEvent);
removeEventListener(MouseEvent.MOUSE_OUT, onMouseEvent);
pressedFace = (currentFace = null);
pressedSurface = (currentSurface = null);
pressedObject = (currentObject = null);
};
}
override public function set height(_arg1:Number):void{
if (_height != _arg1){
_height = _arg1;
canvas.y = (_height * 0.5);
if (_camera != null){
camera.addOperationToScene(camera.calculatePlanesOperation);
};
};
}
private function getInteractiveObjectPointProperties(_arg1:Number, _arg2:Number):void{
var _local3:Number;
var _local4:Number;
var _local5:Number;
var _local7:Point3D;
var _local8:Number;
var _local9:Point;
if (objectUnderPoint == null){
return;
};
var _local6:Matrix3D = _camera._transformation;
if (_camera._orthographic){
_local4 = 0;
_local3 = _local4;
_local5 = 1;
linePoint.x = (_arg1 / _camera.zoom);
linePoint.y = (_arg2 / _camera.zoom);
linePoint.z = 0;
linePoint.transform(_local6);
} else {
_local3 = _arg1;
_local4 = _arg2;
_local5 = _camera.focalLength;
linePoint.copy(_camera.globalCoords);
};
lineVector.x = (((_local3 * _local6.a) + (_local4 * _local6.b)) + (_local5 * _local6.c));
lineVector.y = (((_local3 * _local6.e) + (_local4 * _local6.f)) + (_local5 * _local6.g));
lineVector.z = (((_local3 * _local6.i) + (_local4 * _local6.j)) + (_local5 * _local6.k));
if (faceUnderPoint != null){
_local7 = faceUnderPoint.globalNormal;
_local8 = faceUnderPoint.globalOffset;
} else {
_local7 = lineVector.clone();
_local7.multiply(-1);
globalCursor3DCoords.copy(objectUnderPoint._coords);
globalCursor3DCoords.transform(objectUnderPoint._transformation);
_local8 = Point3D.dot(globalCursor3DCoords, _local7);
};
getLineAndPlaneIntersection(linePoint, lineVector, _local7, _local8, globalCursor3DCoords);
inverseMatrix.copy(((faceUnderPoint)!=null) ? faceUnderPoint._mesh : objectUnderPoint._transformation);
inverseMatrix.invert();
localCursor3DCoords.copy(globalCursor3DCoords);
localCursor3DCoords.transform(inverseMatrix);
if (faceUnderPoint != null){
_local9 = faceUnderPoint.getUV(localCursor3DCoords);
if (_local9 != null){
uvPoint.x = _local9.x;
uvPoint.y = _local9.y;
} else {
uvPoint.x = NaN;
uvPoint.y = NaN;
};
};
}
public function get interactive():Boolean{
return (_interactive);
}
private function processMouseMove():void{
var _local1:MouseEvent3D;
checkMouseOverOut();
if (currentFace != null){
if (currentFace.mouseEnabled){
_local1 = createFullMouseEvent3D(MouseEvent3D.MOUSE_MOVE, currentObject, currentSurface, currentFace);
currentFace.dispatchEvent(_local1);
};
if (currentSurface.mouseEnabled){
_local1 = createFullMouseEvent3D(MouseEvent3D.MOUSE_MOVE, currentObject, currentSurface, currentFace);
currentSurface.dispatchEvent(_local1);
};
};
if (currentObject != null){
_local1 = createFullMouseEvent3D(MouseEvent3D.MOUSE_MOVE, currentObject, currentSurface, currentFace);
currentObject.dispatchEvent(_local1);
};
}
private function createFullMouseEvent3D(_arg1:String, _arg2:Object3D, _arg3:Surface, _arg4:Face):MouseEvent3D{
var _local5:Boolean = ((lastMouseEvent == null)) ? false : lastMouseEvent.altKey;
var _local6:Boolean = ((lastMouseEvent == null)) ? false : lastMouseEvent.ctrlKey;
var _local7:Boolean = ((lastMouseEvent == null)) ? false : lastMouseEvent.shiftKey;
var _local8:int = ((lastMouseEvent == null)) ? 0 : lastMouseEvent.delta;
return (new MouseEvent3D(_arg1, this, _arg2, _arg3, _arg4, globalCursor3DCoords.x, globalCursor3DCoords.y, globalCursor3DCoords.z, localCursor3DCoords.x, localCursor3DCoords.y, localCursor3DCoords.z, uvPoint.x, uvPoint.y, _local5, _local6, _local7, _local8));
}
override public function get width():Number{
return (_width);
}
public function projectPoint(_arg1:Point3D):Point3D{
var _local4:Number;
if ((((_camera == null)) || ((_camera._scene == null)))){
return (null);
};
var _local2:Matrix3D = Object3D.matrix2;
var _local3:Number = _camera.focalLength;
if (camera.getTransformation(_local2)){
_local2.invert();
if (_camera._orthographic){
_local4 = _camera.zoom;
_local2.scale(_local4, _local4, _local4);
};
} else {
if (((_camera._orthographic) && (_camera.calculateMatrixOperation.queued))){
_local2.invert();
_local4 = _camera.zoom;
_local2.scale(_local4, _local4, _local4);
} else {
_local2 = _camera.cameraMatrix;
};
};
if (((!(_camera._orthographic)) && (_camera.calculatePlanesOperation.queued))){
_local3 = ((0.5 * Math.sqrt(((_height * _height) + (_width * _width)))) / Math.tan((0.5 * _camera._fov)));
};
var _local5:Number = ((((_local2.a * _arg1.x) + (_local2.b * _arg1.y)) + (_local2.c * _arg1.z)) + _local2.d);
var _local6:Number = ((((_local2.e * _arg1.x) + (_local2.f * _arg1.y)) + (_local2.g * _arg1.z)) + _local2.h);
var _local7:Number = ((((_local2.i * _arg1.x) + (_local2.j * _arg1.y)) + (_local2.k * _arg1.z)) + _local2.l);
if (_camera._orthographic){
return (new Point3D((_local5 + (_width >> 1)), (_local6 + (_height >> 1)), _local7));
};
return (new Point3D((((_local5 * _local3) / _local7) + (_width >> 1)), (((_local6 * _local3) / _local7) + (_height >> 1)), _local7));
}
private function getLineAndPlaneIntersection(_arg1:Point3D, _arg2:Point3D, _arg3:Point3D, _arg4:Number, _arg5:Point3D):void{
var _local9:Number;
var _local10:Number;
var _local11:Number;
var _local6:Number = (((_arg3.x * _arg2.x) + (_arg3.y * _arg2.y)) + (_arg3.z * _arg2.z));
if (_local6 == 0){
_arg5.x = NaN;
_arg5.y = NaN;
_arg5.z = NaN;
return;
};
var _local7:int;
var _local8:Number = _arg2.x;
if ((((_local8 < _arg2.y)) && ((_local8 > -(_arg2.y))))){
_local8 = _arg2.y;
_local7 = 1;
};
if ((((_local8 < _arg2.z)) && ((_local8 > -(_arg2.z))))){
_local7 = 2;
};
switch (_local7){
case 0:
_local9 = ((((_arg4 * _arg2.x) + (_arg3.y * ((_arg1.x * _arg2.y) - (_arg1.y * _arg2.x)))) + (_arg3.z * ((_arg1.x * _arg2.z) - (_arg1.z * _arg2.x)))) / _local6);
_arg5.x = _local9;
_arg5.y = ((((_local9 - _arg1.x) * _arg2.y) / _arg2.x) + _arg1.y);
_arg5.z = ((((_local9 - _arg1.x) * _arg2.z) / _arg2.x) + _arg1.z);
break;
case 1:
_local10 = ((((_arg4 * _arg2.y) + (_arg3.x * ((_arg1.y * _arg2.x) - (_arg1.x * _arg2.y)))) + (_arg3.z * ((_arg1.y * _arg2.z) - (_arg1.z * _arg2.y)))) / _local6);
_arg5.x = ((((_local10 - _arg1.y) * _arg2.x) / _arg2.y) + _arg1.x);
_arg5.y = _local10;
_arg5.z = ((((_local10 - _arg1.y) * _arg2.z) / _arg2.y) + _arg1.z);
break;
case 2:
_local11 = ((((_arg4 * _arg2.z) + (_arg3.x * ((_arg1.z * _arg2.x) - (_arg1.x * _arg2.z)))) + (_arg3.y * ((_arg1.z * _arg2.y) - (_arg1.y * _arg2.z)))) / _local6);
_arg5.x = ((((_local11 - _arg1.z) * _arg2.x) / _arg2.z) + _arg1.x);
_arg5.y = ((((_local11 - _arg1.z) * _arg2.y) / _arg2.z) + _arg1.y);
_arg5.z = _local11;
break;
};
}
}
}//package alternativa.engine3d.display
Section 17
//Engine3DError (alternativa.engine3d.errors.Engine3DError)
package alternativa.engine3d.errors {
public class Engine3DError extends Error {
public var source:Object;
public function Engine3DError(_arg1:String="", _arg2:Object=null){
super(_arg1);
this.source = _arg2;
this.name = "Engine3DError";
}
}
}//package alternativa.engine3d.errors
Section 18
//FaceExistsError (alternativa.engine3d.errors.FaceExistsError)
package alternativa.engine3d.errors {
import alternativa.engine3d.core.*;
import alternativa.utils.*;
public class FaceExistsError extends ObjectExistsError {
public function FaceExistsError(_arg1:Object=null, _arg2:Object=null){
var _local3:String;
if ((_arg2 is Mesh)){
_local3 = "Mesh ";
} else {
if ((_arg2 is Surface)){
_local3 = "Surface ";
};
};
if ((_arg1 is Face)){
_local3 = (_local3 + "%1. Face %2 already exists.");
} else {
_local3 = (_local3 + "%1. Face with ID '%2' already exists.");
};
super(TextUtils.insertVars(_local3, _arg2, _arg1), _arg1, _arg2);
this.name = "FaceExistsError";
}
}
}//package alternativa.engine3d.errors
Section 19
//FaceNeedMoreVerticesError (alternativa.engine3d.errors.FaceNeedMoreVerticesError)
package alternativa.engine3d.errors {
import alternativa.engine3d.core.*;
import alternativa.utils.*;
public class FaceNeedMoreVerticesError extends Engine3DError {
public var count:uint;
public function FaceNeedMoreVerticesError(_arg1:Mesh=null, _arg2:uint=0){
super(TextUtils.insertVars("Mesh %1. %2 vertices not enough for face creation.", _arg1, _arg2), _arg1);
this.count = _arg2;
this.name = "FaceNeedMoreVerticesError";
}
}
}//package alternativa.engine3d.errors
Section 20
//FaceNotFoundError (alternativa.engine3d.errors.FaceNotFoundError)
package alternativa.engine3d.errors {
import alternativa.engine3d.core.*;
import alternativa.utils.*;
public class FaceNotFoundError extends ObjectNotFoundError {
public function FaceNotFoundError(_arg1:Object=null, _arg2:Object=null){
var _local3:String;
if ((_arg2 is Mesh)){
_local3 = "Mesh ";
} else {
_local3 = "Surface ";
};
if ((_arg1 is Face)){
_local3 = (_local3 + "%1. Face %2 not found.");
} else {
_local3 = (_local3 + "%1. Face with ID '%2' not found.");
};
super(TextUtils.insertVars(_local3, _arg2, _arg1), _arg1, _arg2);
this.name = "FaceNotFoundError";
}
}
}//package alternativa.engine3d.errors
Section 21
//InvalidIDError (alternativa.engine3d.errors.InvalidIDError)
package alternativa.engine3d.errors {
import alternativa.engine3d.core.*;
import alternativa.utils.*;
public class InvalidIDError extends Engine3DError {
public var id:Object;
public function InvalidIDError(_arg1:Object=null, _arg2:Object=null){
var _local3:String;
if ((_arg2 is Mesh)){
_local3 = "Mesh %2. ";
} else {
if ((_arg2 is Surface)){
_local3 = "Surface %2. ";
};
};
super(TextUtils.insertVars((_local3 + "ID %1 is reserved and cannot be used"), [_arg1, _arg2]), _arg2);
this.id = _arg1;
this.name = "InvalidIDError";
}
}
}//package alternativa.engine3d.errors
Section 22
//Object3DHierarchyError (alternativa.engine3d.errors.Object3DHierarchyError)
package alternativa.engine3d.errors {
import alternativa.engine3d.core.*;
import alternativa.utils.*;
public class Object3DHierarchyError extends Engine3DError {
public var object:Object3D;
public function Object3DHierarchyError(_arg1:Object3D=null, _arg2:Object3D=null){
super(TextUtils.insertVars("Object3D %1. Object %2 cannot be added", _arg2, _arg1), _arg2);
this.object = _arg1;
this.name = "Object3DHierarchyError";
}
}
}//package alternativa.engine3d.errors
Section 23
//Object3DNotFoundError (alternativa.engine3d.errors.Object3DNotFoundError)
package alternativa.engine3d.errors {
import alternativa.engine3d.core.*;
import alternativa.utils.*;
public class Object3DNotFoundError extends ObjectNotFoundError {
public function Object3DNotFoundError(_arg1:Object3D=null, _arg2:Object3D=null){
super(TextUtils.insertVars("Object3D %1. Object %2 not in child list", _arg2, _arg1), _arg1, _arg2);
this.name = "Object3DNotFoundError";
}
}
}//package alternativa.engine3d.errors
Section 24
//ObjectExistsError (alternativa.engine3d.errors.ObjectExistsError)
package alternativa.engine3d.errors {
public class ObjectExistsError extends Engine3DError {
public var object:Object;
public function ObjectExistsError(_arg1:String="", _arg2:Object=null, _arg3:Object=null){
super(_arg1, _arg3);
this.object = _arg2;
this.name = "ObjectExistsError";
}
}
}//package alternativa.engine3d.errors
Section 25
//ObjectNotFoundError (alternativa.engine3d.errors.ObjectNotFoundError)
package alternativa.engine3d.errors {
public class ObjectNotFoundError extends Engine3DError {
public var object:Object;
public function ObjectNotFoundError(_arg1:String="", _arg2:Object=null, _arg3:Object=null){
super(_arg1, _arg3);
this.object = _arg2;
this.name = "ObjectNotFoundError";
}
}
}//package alternativa.engine3d.errors
Section 26
//SurfaceExistsError (alternativa.engine3d.errors.SurfaceExistsError)
package alternativa.engine3d.errors {
import alternativa.engine3d.core.*;
import alternativa.utils.*;
public class SurfaceExistsError extends ObjectExistsError {
public function SurfaceExistsError(_arg1:Object=null, _arg2:Mesh=null){
super(TextUtils.insertVars("Mesh %1. Surface with ID '%2' already exists.", _arg2, _arg1), _arg1, _arg2);
this.name = "SurfaceExistsError";
}
}
}//package alternativa.engine3d.errors
Section 27
//SurfaceNotFoundError (alternativa.engine3d.errors.SurfaceNotFoundError)
package alternativa.engine3d.errors {
import alternativa.engine3d.core.*;
import alternativa.utils.*;
public class SurfaceNotFoundError extends ObjectNotFoundError {
public function SurfaceNotFoundError(_arg1:Object=null, _arg2:Mesh=null){
if (_arg2 == null){
};
if ((_arg1 is Surface)){
message = "Mesh %1. Surface %2 not found.";
} else {
message = "Mesh %1. Surface with ID '%2' not found.";
};
super(TextUtils.insertVars(message, _arg2, _arg1), _arg1, _arg2);
this.name = "SurfaceNotFoundError";
}
}
}//package alternativa.engine3d.errors
Section 28
//VertexExistsError (alternativa.engine3d.errors.VertexExistsError)
package alternativa.engine3d.errors {
import alternativa.engine3d.core.*;
import alternativa.utils.*;
public class VertexExistsError extends ObjectExistsError {
public function VertexExistsError(_arg1:Object=null, _arg2:Mesh=null){
super(TextUtils.insertVars("Mesh %1. Vertex with ID '%2' already exists.", _arg2, _arg1), _arg1, _arg2);
this.name = "VertexExistsError";
}
}
}//package alternativa.engine3d.errors
Section 29
//VertexNotFoundError (alternativa.engine3d.errors.VertexNotFoundError)
package alternativa.engine3d.errors {
import alternativa.engine3d.core.*;
import alternativa.utils.*;
public class VertexNotFoundError extends ObjectNotFoundError {
public function VertexNotFoundError(_arg1:Object=null, _arg2:Mesh=null){
if ((_arg1 is Vertex)){
message = "Mesh %1. Vertex %2 not found.";
} else {
message = "Mesh %1. Vertex with ID '%2' not found.";
};
super(TextUtils.insertVars(message, _arg2, _arg1), _arg1, _arg2);
this.name = "VertexNotFoundError";
}
}
}//package alternativa.engine3d.errors
Section 30
//MouseEvent3D (alternativa.engine3d.events.MouseEvent3D)
package alternativa.engine3d.events {
import flash.events.*;
import alternativa.engine3d.core.*;
import alternativa.engine3d.display.*;
public class MouseEvent3D extends Event {
public var shiftKey:Boolean;
public var localX:Number;
public var localY:Number;
public var localZ:Number;
public var globalX:Number;
public var globalY:Number;
public var globalZ:Number;
public var face:Face;
public var view:View;
public var surface:Surface;
public var ctrlKey:Boolean;
public var u:Number;
public var altKey:Boolean;
public var delta:int;
public var v:Number;
public var object:Object3D;
public static const MOUSE_WHEEL:String = "mouseWheel";
public static const MOUSE_DOWN:String = "mouseDown";
public static const MOUSE_MOVE:String = "mouseMove";
public static const MOUSE_OVER:String = "mouseOver";
public static const CLICK:String = "click";
public static const MOUSE_OUT:String = "mouseOut";
public static const MOUSE_UP:String = "mouseUp";
public function MouseEvent3D(_arg1:String, _arg2:View, _arg3:Object3D, _arg4:Surface, _arg5:Face, _arg6:Number=NaN, _arg7:Number=NaN, _arg8:Number=NaN, _arg9:Number=NaN, _arg10:Number=NaN, _arg11:Number=NaN, _arg12:Number=NaN, _arg13:Number=NaN, _arg14:Boolean=false, _arg15:Boolean=false, _arg16:Boolean=false, _arg17:int=0){
super(_arg1);
this.object = _arg3;
this.surface = _arg4;
this.face = _arg5;
this.globalX = _arg6;
this.globalY = _arg7;
this.globalZ = _arg8;
this.localX = _arg9;
this.localY = _arg10;
this.localZ = _arg11;
this.u = _arg12;
this.v = _arg13;
this.altKey = _arg14;
this.ctrlKey = _arg15;
this.shiftKey = _arg16;
this.delta = _arg17;
}
override public function toString():String{
return (formatToString("MouseEvent3D", "object", "surface", "face", "globalX", "globalY", "globalZ", "localX", "localY", "localZ", "u", "v", "delta", "altKey", "ctrlKey", "shiftKey"));
}
override public function clone():Event{
return (new MouseEvent3D(type, view, object, surface, face, globalX, globalY, globalZ, localX, localY, localZ, u, v, altKey, ctrlKey, shiftKey, delta));
}
}
}//package alternativa.engine3d.events
Section 31
//DrawPoint (alternativa.engine3d.materials.DrawPoint)
package alternativa.engine3d.materials {
public final class DrawPoint {
public var u:Number;
public var v:Number;
public var x:Number;
public var y:Number;
public var z:Number;
public function DrawPoint(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number=0, _arg5:Number=0){
this.x = _arg1;
this.y = _arg2;
this.z = _arg3;
this.u = _arg4;
this.v = _arg5;
}
}
}//package alternativa.engine3d.materials
Section 32
//FillMaterial (alternativa.engine3d.materials.FillMaterial)
package alternativa.engine3d.materials {
import alternativa.engine3d.core.*;
import alternativa.engine3d.display.*;
import flash.display.*;
import alternativa.engine3d.*;
public class FillMaterial extends SurfaceMaterial {
alternativa3d var _color:uint;
alternativa3d var _wireThickness:Number;
alternativa3d var _wireColor:uint;
public function FillMaterial(_arg1:uint, _arg2:Number=1, _arg3:String="normal", _arg4:Number=-1, _arg5:uint=0){
super(_arg2, _arg3);
_color = _arg1;
_wireThickness = _arg4;
_wireColor = _arg5;
}
public function get color():uint{
return (_color);
}
public function set color(_arg1:uint):void{
if (_color != _arg1){
_color = _arg1;
markToChange();
};
}
override alternativa3d function draw(_arg1:Camera3D, _arg2:Skin, _arg3:uint, _arg4:Array):void{
var _local5:uint;
var _local6:DrawPoint;
var _local8:Number;
_arg2.alpha = _alpha;
_arg2.blendMode = _blendMode;
var _local7:Graphics = _arg2.gfx;
if (_arg1._orthographic){
_local7.beginFill(_color);
if (_wireThickness >= 0){
_local7.lineStyle(_wireThickness, _wireColor);
};
_local6 = _arg4[0];
_local7.moveTo(_local6.x, _local6.y);
_local5 = 1;
while (_local5 < _arg3) {
_local6 = _arg4[_local5];
_local7.lineTo(_local6.x, _local6.y);
_local5++;
};
if (_wireThickness >= 0){
_local6 = _arg4[0];
_local7.lineTo(_local6.x, _local6.y);
};
} else {
_local7.beginFill(_color);
if (_wireThickness >= 0){
_local7.lineStyle(_wireThickness, _wireColor);
};
_local6 = _arg4[0];
_local8 = (_arg1.focalLength / _local6.z);
_local7.moveTo((_local6.x * _local8), (_local6.y * _local8));
_local5 = 1;
while (_local5 < _arg3) {
_local6 = _arg4[_local5];
_local8 = (_arg1.focalLength / _local6.z);
_local7.lineTo((_local6.x * _local8), (_local6.y * _local8));
_local5++;
};
if (_wireThickness >= 0){
_local6 = _arg4[0];
_local8 = (_arg1.focalLength / _local6.z);
_local7.lineTo((_local6.x * _local8), (_local6.y * _local8));
};
};
}
public function get wireColor():uint{
return (_wireColor);
}
public function get wireThickness():Number{
return (_wireThickness);
}
public function set wireColor(_arg1:uint):void{
if (_wireColor != _arg1){
_wireColor = _arg1;
markToChange();
};
}
override public function clone():Material{
var _local1:FillMaterial = new FillMaterial(_color, _alpha, _blendMode, _wireThickness, _wireColor);
return (_local1);
}
public function set wireThickness(_arg1:Number):void{
if (_wireThickness != _arg1){
_wireThickness = _arg1;
markToChange();
};
}
}
}//package alternativa.engine3d.materials
Section 33
//Material (alternativa.engine3d.materials.Material)
package alternativa.engine3d.materials {
import alternativa.engine3d.display.*;
import alternativa.engine3d.*;
public class Material {
alternativa3d var _blendMode:String;
alternativa3d var _alpha:Number;
public function Material(_arg1:Number, _arg2:String){
_alpha = _arg1;
_blendMode = _arg2;
}
public function clone():Material{
return (new Material(_alpha, _blendMode));
}
public function get blendMode():String{
return (_blendMode);
}
alternativa3d function clear(_arg1:Skin):void{
_arg1.gfx.clear();
}
protected function markToChange():void{
}
public function set blendMode(_arg1:String):void{
if (_blendMode != _arg1){
_blendMode = _arg1;
markToChange();
};
}
public function set alpha(_arg1:Number):void{
if (_alpha != _arg1){
_alpha = _arg1;
markToChange();
};
}
public function get alpha():Number{
return (_alpha);
}
}
}//package alternativa.engine3d.materials
Section 34
//SpriteMaterial (alternativa.engine3d.materials.SpriteMaterial)
package alternativa.engine3d.materials {
import alternativa.engine3d.core.*;
import alternativa.engine3d.display.*;
import alternativa.engine3d.*;
public class SpriteMaterial extends Material {
alternativa3d var _sprite:Sprite3D;
public function SpriteMaterial(_arg1:Number=1, _arg2:String="normal"){
super(_arg1, _arg2);
}
alternativa3d function addToScene(_arg1:Scene3D):void{
}
alternativa3d function addToSprite(_arg1:Sprite3D):void{
_sprite = _arg1;
}
public function get sprite():Sprite3D{
return (_sprite);
}
alternativa3d function removeFromSprite(_arg1:Sprite3D):void{
_sprite = null;
}
alternativa3d function canDraw(_arg1:Camera3D):Boolean{
return (true);
}
alternativa3d function draw(_arg1:Camera3D, _arg2:Skin):void{
_arg2.alpha = _alpha;
_arg2.blendMode = _blendMode;
}
override public function clone():Material{
return (new SpriteMaterial(_alpha, _blendMode));
}
alternativa3d function removeFromScene(_arg1:Scene3D):void{
}
override protected function markToChange():void{
if (_sprite != null){
_sprite.addMaterialChangedOperationToScene();
};
}
}
}//package alternativa.engine3d.materials
Section 35
//SpriteTextureMaterial (alternativa.engine3d.materials.SpriteTextureMaterial)
package alternativa.engine3d.materials {
import alternativa.engine3d.core.*;
import alternativa.types.*;
import alternativa.engine3d.display.*;
import flash.geom.*;
import alternativa.engine3d.*;
public class SpriteTextureMaterial extends SpriteMaterial {
alternativa3d var _smooth:Boolean;
alternativa3d var _originY:Number;
alternativa3d var _originX:Number;
alternativa3d var _texture:Texture;
private static var drawRect:Rectangle = new Rectangle();
private static var textureMatrix:Matrix = new Matrix();
public function SpriteTextureMaterial(_arg1:Texture, _arg2:Number=1, _arg3:Boolean=false, _arg4:String="normal", _arg5:Number=0.5, _arg6:Number=0.5){
super(_arg2, _arg4);
_texture = _arg1;
_smooth = _arg3;
_originX = _arg5;
_originY = _arg6;
}
public function get texture():Texture{
return (_texture);
}
public function set smooth(_arg1:Boolean):void{
if (_smooth != _arg1){
_smooth = _arg1;
markToChange();
};
}
override alternativa3d function draw(_arg1:Camera3D, _arg2:Skin):void{
_arg2.alpha = _alpha;
_arg2.blendMode = _blendMode;
_arg2.gfx.beginBitmapFill(_texture._bitmapData, textureMatrix, false, _smooth);
_arg2.gfx.drawRect(drawRect.x, drawRect.y, drawRect.width, drawRect.height);
}
public function set originX(_arg1:Number):void{
if (_originX != _arg1){
_originX = _arg1;
markToChange();
};
}
public function get smooth():Boolean{
return (_smooth);
}
public function get originX():Number{
return (_originX);
}
public function get originY():Number{
return (_originY);
}
public function set texture(_arg1:Texture):void{
if (_texture != _arg1){
_texture = _arg1;
markToChange();
};
}
override alternativa3d function canDraw(_arg1:Camera3D):Boolean{
var _local9:Number;
var _local10:Number;
var _local13:Number;
if (_texture == null){
return (false);
};
var _local2:Matrix3D = _arg1.cameraMatrix;
var _local3:Number = _sprite.globalCoords.x;
var _local4:Number = _sprite.globalCoords.y;
var _local5:Number = _sprite.globalCoords.z;
var _local6:Number = ((((_local2.a * _local3) + (_local2.b * _local4)) + (_local2.c * _local5)) + _local2.d);
var _local7:Number = ((((_local2.e * _local3) + (_local2.f * _local4)) + (_local2.g * _local5)) + _local2.h);
var _local8:Number = ((((_local2.i * _local3) + (_local2.j * _local4)) + (_local2.k * _local5)) + _local2.l);
if (_arg1._orthographic){
if (((((_arg1._nearClipping) && ((_local8 < _arg1._nearClippingDistance)))) || (((_arg1._farClipping) && ((_local8 > _arg1._farClippingDistance)))))){
return (false);
};
_local9 = ((_texture._width * _arg1._zoom) * _sprite._materialScale);
_local10 = ((_texture._height * _arg1._zoom) * _sprite._materialScale);
_local3 = (_local6 - (_local9 * _originX));
_local4 = (_local7 - (_local10 * _originY));
} else {
if ((((((_local8 <= 0)) || (((_arg1._nearClipping) && ((_local8 < _arg1._nearClippingDistance)))))) || (((_arg1._farClipping) && ((_local8 > _arg1._farClippingDistance)))))){
return (false);
};
_local13 = (_arg1.focalLength / _local8);
_local9 = ((_texture._width * _local13) * _sprite._materialScale);
_local10 = ((_texture._height * _local13) * _sprite._materialScale);
_local3 = ((_local6 * _local13) - (_local9 * _originX));
_local4 = ((_local7 * _local13) - (_local10 * _originY));
};
var _local11:Number = (_arg1._view._width * 0.5);
var _local12:Number = (_arg1._view._height * 0.5);
if (((_arg1._viewClipping) && ((((((((_local3 >= _local11)) || ((_local4 >= _local12)))) || (((_local3 + _local9) <= -(_local11))))) || (((_local4 + _local10) <= -(_local12))))))){
return (false);
};
textureMatrix.a = (_local9 / _texture._width);
textureMatrix.d = (_local10 / _texture._height);
textureMatrix.tx = _local3;
textureMatrix.ty = _local4;
if (_arg1._viewClipping){
if (_local3 < -(_local11)){
_local9 = (_local9 - (-(_local11) - _local3));
_local3 = -(_local11);
};
if ((_local3 + _local9) > _local11){
_local9 = (_local11 - _local3);
};
if (_local4 < -(_local12)){
_local10 = (_local10 - (-(_local12) - _local4));
_local4 = -(_local12);
};
if ((_local4 + _local10) > _local12){
_local10 = (_local12 - _local4);
};
};
drawRect.x = _local3;
drawRect.y = _local4;
drawRect.width = _local9;
drawRect.height = _local10;
return (true);
}
override public function clone():Material{
return (new SpriteTextureMaterial(_texture, _alpha, _smooth, _blendMode, _originX, _originY));
}
public function set originY(_arg1:Number):void{
if (_originY != _arg1){
_originY = _arg1;
markToChange();
};
}
}
}//package alternativa.engine3d.materials
Section 36
//SurfaceMaterial (alternativa.engine3d.materials.SurfaceMaterial)
package alternativa.engine3d.materials {
import alternativa.engine3d.core.*;
import alternativa.engine3d.display.*;
import alternativa.engine3d.*;
public class SurfaceMaterial extends Material {
alternativa3d var useUV:Boolean;// = false
alternativa3d var _surface:Surface;
public function SurfaceMaterial(_arg1:Number=1, _arg2:String="normal"){
super(_arg1, _arg2);
}
alternativa3d function draw(_arg1:Camera3D, _arg2:Skin, _arg3:uint, _arg4:Array):void{
_arg2.alpha = _alpha;
_arg2.blendMode = _blendMode;
}
alternativa3d function addToMesh(_arg1:Mesh):void{
}
public function get surface():Surface{
return (_surface);
}
alternativa3d function addToSurface(_arg1:Surface):void{
_surface = _arg1;
}
alternativa3d function canDraw(_arg1:PolyPrimitive):Boolean{
return (true);
}
alternativa3d function addToScene(_arg1:Scene3D):void{
}
override protected function markToChange():void{
if (_surface != null){
_surface.addMaterialChangedOperationToScene();
};
}
alternativa3d function removeFromMesh(_arg1:Mesh):void{
}
override public function clone():Material{
return (new SurfaceMaterial(_alpha, _blendMode));
}
alternativa3d function removeFromScene(_arg1:Scene3D):void{
}
alternativa3d function removeFromSurface(_arg1:Surface):void{
_surface = null;
}
}
}//package alternativa.engine3d.materials
Section 37
//TextureMaterial (alternativa.engine3d.materials.TextureMaterial)
package alternativa.engine3d.materials {
import alternativa.engine3d.core.*;
import alternativa.types.*;
import alternativa.engine3d.display.*;
import flash.geom.*;
import flash.display.*;
import alternativa.engine3d.*;
public class TextureMaterial extends SurfaceMaterial {
alternativa3d var _repeat:Boolean;
alternativa3d var _smooth:Boolean;
alternativa3d var _texture:Texture;
private var distortion:Number;
alternativa3d var _wireColor:uint;
private var focalLength:Number;
alternativa3d var _wireThickness:Number;
private var gfx:Graphics;
private var textureMatrix:Matrix;
alternativa3d var _precision:Number;
private static var stubMatrix:Matrix;
private static var stubBitmapData:BitmapData;
public function TextureMaterial(_arg1:Texture, _arg2:Number=1, _arg3:Boolean=true, _arg4:Boolean=false, _arg5:String="normal", _arg6:Number=-1, _arg7:uint=0, _arg8:Number=10){
textureMatrix = new Matrix();
super(_arg2, _arg5);
_texture = _arg1;
_repeat = _arg3;
_smooth = _arg4;
_wireThickness = _arg6;
_wireColor = _arg7;
_precision = _arg8;
useUV = true;
}
public function set wireColor(_arg1:uint):void{
if (_wireColor != _arg1){
_wireColor = _arg1;
markToChange();
};
}
override alternativa3d function draw(_arg1:Camera3D, _arg2:Skin, _arg3:uint, _arg4:Array):void{
var _local5:uint;
var _local6:DrawPoint;
var _local7:Number;
var _local8:Face;
var _local9:uint;
var _local10:uint;
var _local11:uint;
var _local12:uint;
var _local13:Boolean;
var _local14:DrawPoint;
var _local15:DrawPoint;
var _local16:DrawPoint;
var _local17:Number;
var _local18:Number;
var _local19:Number;
var _local20:Number;
var _local21:Number;
var _local22:Number;
var _local23:Number;
var _local24:Number;
var _local25:Number;
var _local26:Number;
var _local27:Number;
_arg2.alpha = _alpha;
_arg2.blendMode = _blendMode;
gfx = _arg2.gfx;
if (_arg2.primitive.face.uvMatrixBase == null){
if (stubBitmapData == null){
stubBitmapData = new BitmapData(2, 2, false, 0);
stubBitmapData.setPixel(0, 0, 0xFF00FF);
stubBitmapData.setPixel(1, 1, 0xFF00FF);
stubMatrix = new Matrix(10, 0, 0, 10, 0, 0);
};
gfx.beginBitmapFill(stubBitmapData, stubMatrix);
if (_arg1._orthographic){
if (_wireThickness >= 0){
gfx.lineStyle(_wireThickness, _wireColor);
};
_local6 = _arg4[0];
gfx.moveTo(_local6.x, _local6.y);
_local5 = 1;
while (_local5 < _arg3) {
_local6 = _arg4[_local5];
gfx.lineTo(_local6.x, _local6.y);
_local5++;
};
if (_wireThickness >= 0){
_local6 = _arg4[0];
gfx.lineTo(_local6.x, _local6.y);
};
} else {
if (_wireThickness >= 0){
gfx.lineStyle(_wireThickness, _wireColor);
};
_local6 = _arg4[0];
_local7 = (_arg1.focalLength / _local6.z);
gfx.moveTo((_local6.x * _local7), (_local6.y * _local7));
_local5 = 1;
while (_local5 < _arg3) {
_local6 = _arg4[_local5];
_local7 = (_arg1.focalLength / _local6.z);
gfx.lineTo((_local6.x * _local7), (_local6.y * _local7));
_local5++;
};
if (_wireThickness >= 0){
_local6 = _arg4[0];
_local7 = (_arg1.focalLength / _local6.z);
gfx.lineTo((_local6.x * _local7), (_local6.y * _local7));
};
};
return;
};
if (_arg1._orthographic){
_local8 = _arg2.primitive.face;
if (!_arg1.uvMatricesCalculated[_local8]){
_arg1.calculateUVMatrix(_local8, _texture._width, _texture._height);
};
gfx.beginBitmapFill(_texture._bitmapData, _local8.uvMatrix, _repeat, _smooth);
if (_wireThickness >= 0){
gfx.lineStyle(_wireThickness, _wireColor);
};
_local6 = _arg4[0];
gfx.moveTo(_local6.x, _local6.y);
_local5 = 1;
while (_local5 < _arg3) {
_local6 = _arg4[_local5];
gfx.lineTo(_local6.x, _local6.y);
_local5++;
};
if (_wireThickness >= 0){
_local6 = _arg4[0];
gfx.lineTo(_local6.x, _local6.y);
};
} else {
focalLength = _arg1.focalLength;
distortion = (_arg1.focalDistortion * _precision);
_local9 = 0;
_local10 = (_arg3 - 1);
_local11 = 1;
_local12 = ((_local10)>0) ? (_local10 - 1) : (_arg3 - 1);
_local13 = true;
_local14 = _arg4[_local10];
_local16 = _arg4[_local9];
if (_precision > 0){
_local17 = (_local14.x / _local14.z);
_local18 = (_local14.y / _local14.z);
_local21 = (_local16.x / _local16.z);
_local22 = (_local16.y / _local16.z);
_local23 = (((_local16.x + _local14.x) / (_local16.z + _local14.z)) - (0.5 * (_local21 + _local17)));
_local24 = (((_local16.y + _local14.y) / (_local16.z + _local14.z)) - (0.5 * (_local22 + _local18)));
_local27 = ((_local23 * _local23) + (_local24 * _local24));
while (_local9 != _local12) {
if (_local13){
_local14 = _arg4[_local9];
_local15 = _arg4[_local11];
_local16 = _arg4[_local10];
_local19 = _local17;
_local20 = _local18;
_local17 = _local21;
_local18 = _local22;
_local21 = _local19;
_local22 = _local20;
_local19 = (_local15.x / _local15.z);
_local20 = (_local15.y / _local15.z);
_local23 = (((_local15.x + _local16.x) / (_local15.z + _local16.z)) - (0.5 * (_local19 + _local21)));
_local24 = (((_local15.y + _local16.y) / (_local15.z + _local16.z)) - (0.5 * (_local20 + _local22)));
_local26 = ((_local23 * _local23) + (_local24 * _local24));
_local9 = _local11;
_local11 = ((_local9)<(_arg3 - 1)) ? (_local9 + 1) : 0;
} else {
_local14 = _arg4[_local12];
_local15 = _arg4[_local10];
_local16 = _arg4[_local9];
_local17 = _local19;
_local18 = _local20;
_local19 = _local21;
_local20 = _local22;
_local21 = _local17;
_local22 = _local18;
_local17 = (_local14.x / _local14.z);
_local18 = (_local14.y / _local14.z);
_local23 = (((_local16.x + _local14.x) / (_local16.z + _local14.z)) - (0.5 * (_local21 + _local17)));
_local24 = (((_local16.y + _local14.y) / (_local16.z + _local14.z)) - (0.5 * (_local22 + _local18)));
_local27 = ((_local23 * _local23) + (_local24 * _local24));
_local10 = _local12;
_local12 = ((_local10)>0) ? (_local10 - 1) : (_arg3 - 1);
};
if ((((_local19 - _local17) * (_local22 - _local18)) - ((_local20 - _local18) * (_local21 - _local17))) < -(_arg1.focalDistortion)){
_local23 = (((_local14.x + _local15.x) / (_local14.z + _local15.z)) - (0.5 * (_local17 + _local19)));
_local24 = (((_local14.y + _local15.y) / (_local14.z + _local15.z)) - (0.5 * (_local18 + _local20)));
_local25 = ((_local23 * _local23) + (_local24 * _local24));
bisection(_local14.x, _local14.y, _local14.z, _local14.u, _local14.v, _local15.x, _local15.y, _local15.z, _local15.u, _local15.v, _local16.x, _local16.y, _local16.z, _local16.u, _local16.v, _local25, _local26, _local27);
};
_local13 = !(_local13);
};
} else {
_local17 = ((focalLength * _local14.x) / _local14.z);
_local18 = ((focalLength * _local14.y) / _local14.z);
_local21 = ((focalLength * _local16.x) / _local16.z);
_local22 = ((focalLength * _local16.y) / _local16.z);
while (_local9 != _local12) {
if (_local13){
_local14 = _arg4[_local9];
_local15 = _arg4[_local11];
_local16 = _arg4[_local10];
_local19 = _local17;
_local20 = _local18;
_local17 = _local21;
_local18 = _local22;
_local21 = _local19;
_local22 = _local20;
_local19 = ((focalLength * _local15.x) / _local15.z);
_local20 = ((focalLength * _local15.y) / _local15.z);
_local9 = _local11;
_local11 = ((_local9)<(_arg3 - 1)) ? (_local9 + 1) : 0;
} else {
_local14 = _arg4[_local12];
_local15 = _arg4[_local10];
_local16 = _arg4[_local9];
_local17 = _local19;
_local18 = _local20;
_local19 = _local21;
_local20 = _local22;
_local21 = _local17;
_local22 = _local18;
_local17 = ((focalLength * _local14.x) / _local14.z);
_local18 = ((focalLength * _local14.y) / _local14.z);
_local10 = _local12;
_local12 = ((_local10)>0) ? (_local10 - 1) : (_arg3 - 1);
};
drawTriangle(_local17, _local18, _local14.u, _local14.v, _local19, _local20, _local15.u, _local15.v, _local21, _local22, _local16.u, _local16.v);
_local13 = !(_local13);
};
};
};
}
private function bisection(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Number, _arg6:Number, _arg7:Number, _arg8:Number, _arg9:Number, _arg10:Number, _arg11:Number, _arg12:Number, _arg13:Number, _arg14:Number, _arg15:Number, _arg16:Number, _arg17:Number, _arg18:Number):void{
var _local19:Number;
var _local20:Number;
var _local21:Number;
var _local22:Number;
var _local23:Number;
var _local24:Number;
var _local25:Number;
var _local26:Number;
var _local27:Number;
var _local28:Number;
if (_arg16 > _arg17){
if (_arg16 > _arg18){
if (_arg16 > distortion){
_local19 = (0.5 * (_arg1 + _arg6));
_local20 = (0.5 * (_arg2 + _arg7));
_local21 = (0.5 * (_arg3 + _arg8));
_local22 = (0.5 * (_arg4 + _arg9));
_local23 = (0.5 * (_arg5 + _arg10));
_local24 = (((_arg1 + _local19) / (_arg3 + _local21)) - (0.5 * ((_arg1 / _arg3) + (_local19 / _local21))));
_local25 = (((_arg2 + _local20) / (_arg3 + _local21)) - (0.5 * ((_arg2 / _arg3) + (_local20 / _local21))));
_local26 = ((_local24 * _local24) + (_local25 * _local25));
_local24 = (((_arg6 + _local19) / (_arg8 + _local21)) - (0.5 * ((_arg6 / _arg8) + (_local19 / _local21))));
_local25 = (((_arg7 + _local20) / (_arg8 + _local21)) - (0.5 * ((_arg7 / _arg8) + (_local20 / _local21))));
_local27 = ((_local24 * _local24) + (_local25 * _local25));
_local24 = (((_arg11 + _local19) / (_arg13 + _local21)) - (0.5 * ((_arg11 / _arg13) + (_local19 / _local21))));
_local25 = (((_arg12 + _local20) / (_arg13 + _local21)) - (0.5 * ((_arg12 / _arg13) + (_local20 / _local21))));
_local28 = ((_local24 * _local24) + (_local25 * _local25));
bisection(_local19, _local20, _local21, _local22, _local23, _arg11, _arg12, _arg13, _arg14, _arg15, _arg1, _arg2, _arg3, _arg4, _arg5, _local28, _arg18, _local26);
bisection(_local19, _local20, _local21, _local22, _local23, _arg6, _arg7, _arg8, _arg9, _arg10, _arg11, _arg12, _arg13, _arg14, _arg15, _local27, _arg17, _local28);
return;
};
} else {
if (_arg18 > distortion){
_local19 = (0.5 * (_arg11 + _arg1));
_local20 = (0.5 * (_arg12 + _arg2));
_local21 = (0.5 * (_arg13 + _arg3));
_local22 = (0.5 * (_arg14 + _arg4));
_local23 = (0.5 * (_arg15 + _arg5));
_local24 = (((_arg1 + _local19) / (_arg3 + _local21)) - (0.5 * ((_arg1 / _arg3) + (_local19 / _local21))));
_local25 = (((_arg2 + _local20) / (_arg3 + _local21)) - (0.5 * ((_arg2 / _arg3) + (_local20 / _local21))));
_local26 = ((_local24 * _local24) + (_local25 * _local25));
_local24 = (((_arg6 + _local19) / (_arg8 + _local21)) - (0.5 * ((_arg6 / _arg8) + (_local19 / _local21))));
_local25 = (((_arg7 + _local20) / (_arg8 + _local21)) - (0.5 * ((_arg7 / _arg8) + (_local20 / _local21))));
_local27 = ((_local24 * _local24) + (_local25 * _local25));
_local24 = (((_arg11 + _local19) / (_arg13 + _local21)) - (0.5 * ((_arg11 / _arg13) + (_local19 / _local21))));
_local25 = (((_arg12 + _local20) / (_arg13 + _local21)) - (0.5 * ((_arg12 / _arg13) + (_local20 / _local21))));
_local28 = ((_local24 * _local24) + (_local25 * _local25));
bisection(_local19, _local20, _local21, _local22, _local23, _arg6, _arg7, _arg8, _arg9, _arg10, _arg11, _arg12, _arg13, _arg14, _arg15, _local27, _arg17, _local28);
bisection(_local19, _local20, _local21, _local22, _local23, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8, _arg9, _arg10, _local26, _arg16, _local27);
return;
};
};
} else {
if (_arg17 > _arg18){
if (_arg17 > distortion){
_local19 = (0.5 * (_arg6 + _arg11));
_local20 = (0.5 * (_arg7 + _arg12));
_local21 = (0.5 * (_arg8 + _arg13));
_local22 = (0.5 * (_arg9 + _arg14));
_local23 = (0.5 * (_arg10 + _arg15));
_local24 = (((_arg1 + _local19) / (_arg3 + _local21)) - (0.5 * ((_arg1 / _arg3) + (_local19 / _local21))));
_local25 = (((_arg2 + _local20) / (_arg3 + _local21)) - (0.5 * ((_arg2 / _arg3) + (_local20 / _local21))));
_local26 = ((_local24 * _local24) + (_local25 * _local25));
_local24 = (((_arg6 + _local19) / (_arg8 + _local21)) - (0.5 * ((_arg6 / _arg8) + (_local19 / _local21))));
_local25 = (((_arg7 + _local20) / (_arg8 + _local21)) - (0.5 * ((_arg7 / _arg8) + (_local20 / _local21))));
_local27 = ((_local24 * _local24) + (_local25 * _local25));
_local24 = (((_arg11 + _local19) / (_arg13 + _local21)) - (0.5 * ((_arg11 / _arg13) + (_local19 / _local21))));
_local25 = (((_arg12 + _local20) / (_arg13 + _local21)) - (0.5 * ((_arg12 / _arg13) + (_local20 / _local21))));
_local28 = ((_local24 * _local24) + (_local25 * _local25));
bisection(_local19, _local20, _local21, _local22, _local23, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8, _arg9, _arg10, _local26, _arg16, _local27);
bisection(_local19, _local20, _local21, _local22, _local23, _arg11, _arg12, _arg13, _arg14, _arg15, _arg1, _arg2, _arg3, _arg4, _arg5, _local28, _arg18, _local26);
return;
};
} else {
if (_arg18 > distortion){
_local19 = (0.5 * (_arg11 + _arg1));
_local20 = (0.5 * (_arg12 + _arg2));
_local21 = (0.5 * (_arg13 + _arg3));
_local22 = (0.5 * (_arg14 + _arg4));
_local23 = (0.5 * (_arg15 + _arg5));
_local24 = (((_arg1 + _local19) / (_arg3 + _local21)) - (0.5 * ((_arg1 / _arg3) + (_local19 / _local21))));
_local25 = (((_arg2 + _local20) / (_arg3 + _local21)) - (0.5 * ((_arg2 / _arg3) + (_local20 / _local21))));
_local26 = ((_local24 * _local24) + (_local25 * _local25));
_local24 = (((_arg6 + _local19) / (_arg8 + _local21)) - (0.5 * ((_arg6 / _arg8) + (_local19 / _local21))));
_local25 = (((_arg7 + _local20) / (_arg8 + _local21)) - (0.5 * ((_arg7 / _arg8) + (_local20 / _local21))));
_local27 = ((_local24 * _local24) + (_local25 * _local25));
_local24 = (((_arg11 + _local19) / (_arg13 + _local21)) - (0.5 * ((_arg11 / _arg13) + (_local19 / _local21))));
_local25 = (((_arg12 + _local20) / (_arg13 + _local21)) - (0.5 * ((_arg12 / _arg13) + (_local20 / _local21))));
_local28 = ((_local24 * _local24) + (_local25 * _local25));
bisection(_local19, _local20, _local21, _local22, _local23, _arg6, _arg7, _arg8, _arg9, _arg10, _arg11, _arg12, _arg13, _arg14, _arg15, _local27, _arg17, _local28);
bisection(_local19, _local20, _local21, _local22, _local23, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8, _arg9, _arg10, _local26, _arg16, _local27);
return;
};
};
};
var _local29:Number = (focalLength / _arg3);
var _local30:Number = (focalLength / _arg8);
var _local31:Number = (focalLength / _arg13);
drawTriangle((_arg1 * _local29), (_arg2 * _local29), _arg4, _arg5, (_arg6 * _local30), (_arg7 * _local30), _arg9, _arg10, (_arg11 * _local31), (_arg12 * _local31), _arg14, _arg15);
}
public function set precision(_arg1:Number):void{
if (_precision != _arg1){
_precision = _arg1;
markToChange();
};
}
public function get precision():Number{
return (_precision);
}
public function get texture():Texture{
return (_texture);
}
public function set wireThickness(_arg1:Number):void{
if (_wireThickness != _arg1){
_wireThickness = _arg1;
markToChange();
};
}
public function get repeat():Boolean{
return (_repeat);
}
public function set smooth(_arg1:Boolean):void{
if (_smooth != _arg1){
_smooth = _arg1;
if (_surface != null){
_surface.addMaterialChangedOperationToScene();
};
};
}
override public function clone():Material{
var _local1:TextureMaterial = new TextureMaterial(_texture, _alpha, _repeat, _smooth, _blendMode, _wireThickness, _wireColor, _precision);
return (_local1);
}
public function get wireColor():uint{
return (_wireColor);
}
private function drawTriangle(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Number, _arg6:Number, _arg7:Number, _arg8:Number, _arg9:Number, _arg10:Number, _arg11:Number, _arg12:Number):void{
var _local13:Number = (_arg5 - _arg1);
var _local14:Number = (_arg6 - _arg2);
var _local15:Number = (_arg9 - _arg1);
var _local16:Number = (_arg10 - _arg2);
var _local17:Number = (_arg7 - _arg3);
var _local18:Number = (_arg8 - _arg4);
var _local19:Number = (_arg11 - _arg3);
var _local20:Number = (_arg12 - _arg4);
var _local21:Number = ((_local17 * _local20) - (_local18 * _local19));
var _local22:Number = _texture._width;
var _local23:Number = _texture._height;
textureMatrix.a = (((_local20 * _local13) - (_local18 * _local15)) / _local21);
textureMatrix.b = (((_local20 * _local14) - (_local18 * _local16)) / _local21);
textureMatrix.c = (((_local19 * _local13) - (_local17 * _local15)) / _local21);
textureMatrix.d = (((_local19 * _local14) - (_local17 * _local16)) / _local21);
textureMatrix.tx = ((((_arg4 - 1) * textureMatrix.c) - (_arg3 * textureMatrix.a)) + _arg1);
textureMatrix.ty = ((((_arg4 - 1) * textureMatrix.d) - (_arg3 * textureMatrix.b)) + _arg2);
textureMatrix.a = (textureMatrix.a / _local22);
textureMatrix.b = (textureMatrix.b / _local22);
textureMatrix.c = (textureMatrix.c / _local23);
textureMatrix.d = (textureMatrix.d / _local23);
gfx.beginBitmapFill(_texture._bitmapData, textureMatrix, _repeat, _smooth);
if (_wireThickness >= 0){
gfx.lineStyle(_wireThickness, _wireColor);
};
gfx.moveTo(_arg1, _arg2);
gfx.lineTo(_arg5, _arg6);
gfx.lineTo(_arg9, _arg10);
if (_wireThickness >= 0){
gfx.lineTo(_arg1, _arg2);
};
}
public function get smooth():Boolean{
return (_smooth);
}
public function get wireThickness():Number{
return (_wireThickness);
}
public function set texture(_arg1:Texture):void{
if (_texture != _arg1){
_texture = _arg1;
markToChange();
};
}
override alternativa3d function canDraw(_arg1:PolyPrimitive):Boolean{
return (!((_texture == null)));
}
public function set repeat(_arg1:Boolean):void{
if (_repeat != _arg1){
_repeat = _arg1;
markToChange();
};
}
}
}//package alternativa.engine3d.materials
Section 38
//TextureMaterialPrecision (alternativa.engine3d.materials.TextureMaterialPrecision)
package alternativa.engine3d.materials {
public class TextureMaterialPrecision {
public static const HIGH:Number = 6;
public static const VERY_LOW:Number = 50;
public static const VERY_HIGH:Number = 3;
public static const BEST:Number = 1;
public static const LOW:Number = 25;
public static const MEDIUM:Number = 10;
public static const NONE:Number = -1;
}
}//package alternativa.engine3d.materials
Section 39
//WireMaterial (alternativa.engine3d.materials.WireMaterial)
package alternativa.engine3d.materials {
import alternativa.engine3d.core.*;
import alternativa.engine3d.display.*;
import flash.display.*;
import alternativa.engine3d.*;
public class WireMaterial extends SurfaceMaterial {
alternativa3d var _color:uint;
alternativa3d var _thickness:Number;
public function WireMaterial(_arg1:Number=0, _arg2:uint=0, _arg3:Number=1, _arg4:String="normal"){
super(_arg3, _arg4);
_color = _arg2;
_thickness = _arg1;
}
public function get thickness():Number{
return (_thickness);
}
public function get color():uint{
return (_color);
}
public function set color(_arg1:uint):void{
if (_color != _arg1){
_color = _arg1;
markToChange();
};
}
override alternativa3d function canDraw(_arg1:PolyPrimitive):Boolean{
return ((_thickness >= 0));
}
override alternativa3d function draw(_arg1:Camera3D, _arg2:Skin, _arg3:uint, _arg4:Array):void{
var _local5:uint;
var _local6:DrawPoint;
var _local8:Number;
_arg2.alpha = _alpha;
_arg2.blendMode = _blendMode;
var _local7:Graphics = _arg2.gfx;
if (_arg1._orthographic){
_local7.lineStyle(_thickness, _color);
_local6 = _arg4[(_arg3 - 1)];
_local7.moveTo(_local6.x, _local6.y);
_local5 = 0;
while (_local5 < _arg3) {
_local6 = _arg4[_local5];
_local7.lineTo(_local6.x, _local6.y);
_local5++;
};
} else {
_local7.lineStyle(_thickness, _color);
_local6 = _arg4[(_arg3 - 1)];
_local8 = (_arg1.focalLength / _local6.z);
_local7.moveTo((_local6.x * _local8), (_local6.y * _local8));
_local5 = 0;
while (_local5 < _arg3) {
_local6 = _arg4[_local5];
_local8 = (_arg1.focalLength / _local6.z);
_local7.lineTo((_local6.x * _local8), (_local6.y * _local8));
_local5++;
};
};
}
override public function clone():Material{
return (new WireMaterial(_thickness, _color, _alpha, _blendMode));
}
public function set thickness(_arg1:Number):void{
if (_thickness != _arg1){
_thickness = _arg1;
markToChange();
};
}
}
}//package alternativa.engine3d.materials
Section 40
//Collision (alternativa.engine3d.physics.Collision)
package alternativa.engine3d.physics {
import alternativa.engine3d.core.*;
import alternativa.types.*;
public class Collision {
public var point:Point3D;
public var offset:Number;
public var normal:Point3D;
public var face:Face;
}
}//package alternativa.engine3d.physics
Section 41
//CollisionPlane (alternativa.engine3d.physics.CollisionPlane)
package alternativa.engine3d.physics {
import alternativa.engine3d.core.*;
import alternativa.engine3d.*;
public class CollisionPlane {
public var destinationOffset:Number;
public var node:BSPNode;
public var infront:Boolean;
public var sourceOffset:Number;
private static var collector:Array = new Array();
alternativa3d static function destroyCollisionPlane(_arg1:CollisionPlane):void{
_arg1.node = null;
collector.push(_arg1);
}
alternativa3d static function createCollisionPlane(_arg1:BSPNode, _arg2:Boolean, _arg3:Number, _arg4:Number):CollisionPlane{
var _local5:CollisionPlane = collector.pop();
if (_local5 == null){
_local5 = new (CollisionPlane);
};
_local5.node = _arg1;
_local5.infront = _arg2;
_local5.sourceOffset = _arg3;
_local5.destinationOffset = _arg4;
return (_local5);
}
}
}//package alternativa.engine3d.physics
Section 42
//CollisionSetMode (alternativa.engine3d.physics.CollisionSetMode)
package alternativa.engine3d.physics {
public class CollisionSetMode {
public static const INCLUDE:int = 2;
public static const EXCLUDE:int = 1;
}
}//package alternativa.engine3d.physics
Section 43
//EllipsoidCollider (alternativa.engine3d.physics.EllipsoidCollider)
package alternativa.engine3d.physics {
import alternativa.engine3d.core.*;
import alternativa.types.*;
import alternativa.utils.*;
import alternativa.engine3d.*;
public class EllipsoidCollider {
private var collisionDestination:Point3D;
private var _scaleY2:Number;// = 1
private var _radiusZ2:Number;
public var scene:Scene3D;
private var radiusVector:Point3D;
private var localCollisionPlanePoint:Point3D;
public var offsetThreshold:Number;// = 0.0001
private var _radius2:Number;
private var _scaleZ2:Number;// = 1
private var currentDisplacement:Point3D;
private var _radius:Number;// = 100
private var collision:Collision;
private var collisionNormal:Point3D;
private var collisionPrimitivePoint:Point3D;
private var p1:Point3D;
private var collisionPrimitiveNearestLengthSqr:Number;
private var _radiusX:Number;
private var _radiusY:Number;
private var _radiusZ:Number;
private var _radiusX2:Number;
private var collisionPrimitiveNearest:PolyPrimitive;
private var collisionPrimitive:PolyPrimitive;
private var useSimpleAlgorithm:Boolean;// = true
public var collisionSet:Set;
private var _scaleX2:Number;// = 1
private var collisionPlanePoint:Point3D;
private var collisionPlanes:Array;
private var _radiusY2:Number;
private var collisionRadius:Number;
private var collisionOffset:Number;
private var _scaleX:Number;// = 1
private var _scaleY:Number;// = 1
private var _scaleZ:Number;// = 1
private var collisionSource:Point3D;
private var currentCoords:Point3D;
private var _collisionSetMode:int;// = 1
private var p2:Point3D;
private var collisionPoint:Point3D;
private static const MAX_COLLISIONS:uint = 50;
public function EllipsoidCollider(_arg1:Scene3D=null, _arg2:Number=100, _arg3:Number=100, _arg4:Number=100){
_radius2 = (_radius * _radius);
_radiusX = _radius;
_radiusY = _radius;
_radiusZ = _radius;
_radiusX2 = (_radiusX * _radiusX);
_radiusY2 = (_radiusY * _radiusY);
_radiusZ2 = (_radiusZ * _radiusZ);
currentDisplacement = new Point3D();
collisionDestination = new Point3D();
collisionPlanes = new Array();
collisionPlanePoint = new Point3D();
collisionPrimitivePoint = new Point3D();
collisionNormal = new Point3D();
collisionPoint = new Point3D();
currentCoords = new Point3D();
collision = new Collision();
radiusVector = new Point3D();
p1 = new Point3D();
p2 = new Point3D();
localCollisionPlanePoint = new Point3D();
super();
this.scene = _arg1;
this.radiusX = _arg2;
this.radiusY = _arg3;
this.radiusZ = _arg4;
}
public function calculateDestination(_arg1:Point3D, _arg2:Point3D, _arg3:Point3D):void{
if ((((((((((((_arg2.x < offsetThreshold)) && ((_arg2.x > -(offsetThreshold))))) && ((_arg2.y < offsetThreshold)))) && ((_arg2.y > -(offsetThreshold))))) && ((_arg2.z < offsetThreshold)))) && ((_arg2.z > -(offsetThreshold))))){
_arg3.x = _arg1.x;
_arg3.y = _arg1.y;
_arg3.z = _arg1.z;
return;
};
currentCoords.x = _arg1.x;
currentCoords.y = _arg1.y;
currentCoords.z = _arg1.z;
currentDisplacement.x = _arg2.x;
currentDisplacement.y = _arg2.y;
currentDisplacement.z = _arg2.z;
_arg3.x = (_arg1.x + currentDisplacement.x);
_arg3.y = (_arg1.y + currentDisplacement.y);
_arg3.z = (_arg1.z + currentDisplacement.z);
if (useSimpleAlgorithm){
calculateDestinationS(_arg1, _arg3);
} else {
calculateDestinationE(_arg1, _arg3);
};
}
public function get radiusX():Number{
return (_radiusX);
}
public function get radiusY():Number{
return (_radiusY);
}
public function get radiusZ():Number{
return (_radiusZ);
}
private function calculateScales():void{
_radius = _radiusX;
if (_radiusY > _radius){
_radius = _radiusY;
};
if (_radiusZ > _radius){
_radius = _radiusZ;
};
_radius2 = (_radius * _radius);
_scaleX = (_radiusX / _radius);
_scaleY = (_radiusY / _radius);
_scaleZ = (_radiusZ / _radius);
_scaleX2 = (_scaleX * _scaleX);
_scaleY2 = (_scaleY * _scaleY);
_scaleZ2 = (_scaleZ * _scaleZ);
useSimpleAlgorithm = (((_radiusX == _radiusY)) && ((_radiusX == _radiusZ)));
}
public function getCollision(_arg1:Point3D, _arg2:Point3D, _arg3:Collision):Boolean{
var _local4:CollisionPlane;
if (scene == null){
return (false);
};
collisionSource = _arg1;
currentDisplacement.x = _arg2.x;
currentDisplacement.y = _arg2.y;
currentDisplacement.z = _arg2.z;
collisionDestination.x = (collisionSource.x + currentDisplacement.x);
collisionDestination.y = (collisionSource.y + currentDisplacement.y);
collisionDestination.z = (collisionSource.z + currentDisplacement.z);
collectPotentialCollisionPlanes(scene.bsp);
collisionPlanes.sortOn("sourceOffset", (Array.NUMERIC | Array.DESCENDING));
if (useSimpleAlgorithm){
while ((_local4 = collisionPlanes.pop()) != null) {
if (collisionPrimitive == null){
calculateCollisionWithPlaneS(_local4);
};
CollisionPlane.destroyCollisionPlane(_local4);
};
} else {
while ((_local4 = collisionPlanes.pop()) != null) {
if (collisionPrimitive == null){
calculateCollisionWithPlaneE(_local4);
};
CollisionPlane.destroyCollisionPlane(_local4);
};
};
var _local5 = !((collisionPrimitive == null));
if (_local5){
_arg3.face = collisionPrimitive.face;
_arg3.normal = collisionNormal;
_arg3.offset = collisionOffset;
_arg3.point = collisionPoint;
};
collisionPrimitive = null;
collisionSource = null;
return (_local5);
}
public function set radiusY(_arg1:Number):void{
_radiusY = ((_arg1 >= 0)) ? _arg1 : -(_arg1);
_radiusY2 = (_radiusY * _radiusY);
calculateScales();
}
public function set radiusZ(_arg1:Number):void{
_radiusZ = ((_arg1 >= 0)) ? _arg1 : -(_arg1);
_radiusZ2 = (_radiusZ * _radiusZ);
calculateScales();
}
public function get collisionSetMode():int{
return (_collisionSetMode);
}
public function set radiusX(_arg1:Number):void{
_radiusX = ((_arg1 >= 0)) ? _arg1 : -(_arg1);
_radiusX2 = (_radiusX * _radiusX);
calculateScales();
}
public function set collisionSetMode(_arg1:int):void{
if (((!((_arg1 == CollisionSetMode.EXCLUDE))) && (!((_arg1 == CollisionSetMode.INCLUDE))))){
throw (ArgumentError((ObjectUtils.getClassName(this) + ".collisionSetMode invalid value")));
};
_collisionSetMode = _arg1;
}
private function calculateDestinationS(_arg1:Point3D, _arg2:Point3D):void{
var _local4:Boolean;
var _local5:*;
var _local3:uint;
do {
_local4 = getCollision(currentCoords, currentDisplacement, collision);
} while (!(_local4));
if (_local3 == MAX_COLLISIONS){
_arg2.x = _arg1.x;
_arg2.y = _arg1.y;
_arg2.z = _arg1.z;
};
}
private function collectPotentialCollisionPlanes(_arg1:BSPNode):void{
var _local4:CollisionPlane;
if (_arg1 == null){
return;
};
var _local2:Number = ((((collisionSource.x * _arg1.normal.x) + (collisionSource.y * _arg1.normal.y)) + (collisionSource.z * _arg1.normal.z)) - _arg1.offset);
var _local3:Number = ((((collisionDestination.x * _arg1.normal.x) + (collisionDestination.y * _arg1.normal.y)) + (collisionDestination.z * _arg1.normal.z)) - _arg1.offset);
if (_local2 >= 0){
collectPotentialCollisionPlanes(_arg1.front);
if ((((_local3 < _radius)) && (!(_arg1.sprited)))){
_local4 = CollisionPlane.createCollisionPlane(_arg1, true, _local2, _local3);
collisionPlanes.push(_local4);
collectPotentialCollisionPlanes(_arg1.back);
};
} else {
collectPotentialCollisionPlanes(_arg1.back);
if (_local3 > -(_radius)){
if (_arg1.backPrimitives != null){
_local4 = CollisionPlane.createCollisionPlane(_arg1, false, -(_local2), -(_local3));
collisionPlanes.push(_local4);
};
collectPotentialCollisionPlanes(_arg1.front);
};
};
}
private function calculateDestinationE(_arg1:Point3D, _arg2:Point3D):void{
var _local4:Boolean;
var _local5:*;
var _local3:uint;
do {
_local4 = getCollision(currentCoords, currentDisplacement, collision);
} while (!(_local4));
if (_local3 == MAX_COLLISIONS){
_arg2.x = _arg1.x;
_arg2.y = _arg1.y;
_arg2.z = _arg1.z;
};
}
private function calculateCollisionWithPrimitiveS(_arg1:PolyPrimitive):void{
var _local7:Point3D;
var _local8:Point3D;
var _local9:Number;
var _local10:Number;
var _local11:Number;
var _local12:Number;
var _local13:Number;
var _local14:Number;
var _local15:Number;
var _local16:Number;
var _local17:Number;
var _local18:Number;
var _local19:Number;
var _local20:Number;
var _local21:Number;
var _local22:Number;
var _local23:Number;
var _local24:Number;
var _local25:Number;
var _local2:uint = _arg1.num;
var _local3:Array = _arg1.points;
var _local4:Point3D = _arg1.face.globalNormal;
var _local5:Boolean;
var _local6:uint;
while (_local6 < _local2) {
_local7 = _local3[_local6];
_local8 = _local3[((_local6)<(_local2 - 1)) ? (_local6 + 1) : 0];
_local9 = (_local8.x - _local7.x);
_local10 = (_local8.y - _local7.y);
_local11 = (_local8.z - _local7.z);
_local12 = (collisionPlanePoint.x - _local7.x);
_local13 = (collisionPlanePoint.y - _local7.y);
_local14 = (collisionPlanePoint.z - _local7.z);
_local15 = ((_local13 * _local11) - (_local14 * _local10));
_local16 = ((_local14 * _local9) - (_local12 * _local11));
_local17 = ((_local12 * _local10) - (_local13 * _local9));
if ((((_local15 * _local4.x) + (_local16 * _local4.y)) + (_local17 * _local4.z)) > 0){
_local5 = false;
_local18 = (((_local9 * _local9) + (_local10 * _local10)) + (_local11 * _local11));
_local19 = ((((_local15 * _local15) + (_local16 * _local16)) + (_local17 * _local17)) / _local18);
if (_local19 < collisionPrimitiveNearestLengthSqr){
_local20 = Math.sqrt(_local18);
_local21 = (_local9 / _local20);
_local22 = (_local10 / _local20);
_local23 = (_local11 / _local20);
_local24 = (((_local21 * _local12) + (_local22 * _local13)) + (_local23 * _local14));
if (_local24 < 0){
_local25 = (((_local12 * _local12) + (_local13 * _local13)) + (_local14 * _local14));
if (_local25 < collisionPrimitiveNearestLengthSqr){
collisionPrimitiveNearestLengthSqr = _local25;
collisionPrimitivePoint.x = _local7.x;
collisionPrimitivePoint.y = _local7.y;
collisionPrimitivePoint.z = _local7.z;
collisionPrimitiveNearest = _arg1;
};
} else {
if (_local24 > _local20){
_local12 = (collisionPlanePoint.x - _local8.x);
_local13 = (collisionPlanePoint.y - _local8.y);
_local14 = (collisionPlanePoint.z - _local8.z);
_local25 = (((_local12 * _local12) + (_local13 * _local13)) + (_local14 * _local14));
if (_local25 < collisionPrimitiveNearestLengthSqr){
collisionPrimitiveNearestLengthSqr = _local25;
collisionPrimitivePoint.x = _local8.x;
collisionPrimitivePoint.y = _local8.y;
collisionPrimitivePoint.z = _local8.z;
collisionPrimitiveNearest = _arg1;
};
} else {
collisionPrimitiveNearestLengthSqr = _local19;
collisionPrimitivePoint.x = (_local7.x + (_local21 * _local24));
collisionPrimitivePoint.y = (_local7.y + (_local22 * _local24));
collisionPrimitivePoint.z = (_local7.z + (_local23 * _local24));
collisionPrimitiveNearest = _arg1;
};
};
};
};
_local6++;
};
if (_local5){
collisionPrimitive = _arg1;
};
}
private function calculateCollisionWithPrimitiveE(_arg1:PolyPrimitive):void{
var _local6:Point3D;
var _local9:Number;
var _local10:Number;
var _local11:Number;
var _local12:Number;
var _local13:Number;
var _local14:Number;
var _local15:Number;
var _local16:Number;
var _local17:Number;
var _local18:Number;
var _local19:Number;
var _local20:Number;
var _local21:Number;
var _local22:Number;
var _local23:Number;
var _local24:Number;
var _local25:Number;
var _local2:uint = _arg1.num;
var _local3:Array = _arg1.points;
var _local4:Point3D = _arg1.face.globalNormal;
var _local5:Boolean;
var _local7:Point3D = _local3[(_local2 - 1)];
p2.x = ((_local7.x - currentCoords.x) / _scaleX);
p2.y = ((_local7.y - currentCoords.y) / _scaleY);
p2.z = ((_local7.z - currentCoords.z) / _scaleZ);
localCollisionPlanePoint.x = ((collisionPlanePoint.x - currentCoords.x) / _scaleX);
localCollisionPlanePoint.y = ((collisionPlanePoint.y - currentCoords.y) / _scaleY);
localCollisionPlanePoint.z = ((collisionPlanePoint.z - currentCoords.z) / _scaleZ);
var _local8:uint;
while (_local8 < _local2) {
_local6 = _local7;
_local7 = _local3[_local8];
p1.x = p2.x;
p1.y = p2.y;
p1.z = p2.z;
p2.x = ((_local7.x - currentCoords.x) / _scaleX);
p2.y = ((_local7.y - currentCoords.y) / _scaleY);
p2.z = ((_local7.z - currentCoords.z) / _scaleZ);
_local9 = (p2.x - p1.x);
_local10 = (p2.y - p1.y);
_local11 = (p2.z - p1.z);
_local12 = (localCollisionPlanePoint.x - p1.x);
_local13 = (localCollisionPlanePoint.y - p1.y);
_local14 = (localCollisionPlanePoint.z - p1.z);
_local15 = ((_local13 * _local11) - (_local14 * _local10));
_local16 = ((_local14 * _local9) - (_local12 * _local11));
_local17 = ((_local12 * _local10) - (_local13 * _local9));
if ((((_local15 * _local4.x) + (_local16 * _local4.y)) + (_local17 * _local4.z)) > 0){
_local5 = false;
_local18 = (((_local9 * _local9) + (_local10 * _local10)) + (_local11 * _local11));
_local19 = ((((_local15 * _local15) + (_local16 * _local16)) + (_local17 * _local17)) / _local18);
if (_local19 < collisionPrimitiveNearestLengthSqr){
_local20 = Math.sqrt(_local18);
_local21 = (_local9 / _local20);
_local22 = (_local10 / _local20);
_local23 = (_local11 / _local20);
_local24 = (((_local21 * _local12) + (_local22 * _local13)) + (_local23 * _local14));
if (_local24 < 0){
_local25 = (((_local12 * _local12) + (_local13 * _local13)) + (_local14 * _local14));
if (_local25 < collisionPrimitiveNearestLengthSqr){
collisionPrimitiveNearestLengthSqr = _local25;
collisionPrimitivePoint.x = p1.x;
collisionPrimitivePoint.y = p1.y;
collisionPrimitivePoint.z = p1.z;
collisionPrimitiveNearest = _arg1;
};
} else {
if (_local24 > _local20){
_local12 = (localCollisionPlanePoint.x - p2.x);
_local13 = (localCollisionPlanePoint.y - p2.y);
_local14 = (localCollisionPlanePoint.z - p2.z);
_local25 = (((_local12 * _local12) + (_local13 * _local13)) + (_local14 * _local14));
if (_local25 < collisionPrimitiveNearestLengthSqr){
collisionPrimitiveNearestLengthSqr = _local25;
collisionPrimitivePoint.x = p2.x;
collisionPrimitivePoint.y = p2.y;
collisionPrimitivePoint.z = p2.z;
collisionPrimitiveNearest = _arg1;
};
} else {
collisionPrimitiveNearestLengthSqr = _local19;
collisionPrimitivePoint.x = (p1.x + (_local21 * _local24));
collisionPrimitivePoint.y = (p1.y + (_local22 * _local24));
collisionPrimitivePoint.z = (p1.z + (_local23 * _local24));
collisionPrimitiveNearest = _arg1;
};
};
};
};
_local8++;
};
if (_local5){
collisionPrimitive = _arg1;
};
}
private function calculateCollisionWithPlaneE(_arg1:CollisionPlane):void{
var _local14:*;
var _local15:Number;
var _local16:Boolean;
var _local17:Number;
var _local18:Number;
var _local19:Number;
var _local20:Number;
var _local21:Number;
var _local22:Number;
var _local23:Number;
var _local24:Number;
var _local2:Number = _arg1.node.normal.x;
var _local3:Number = _arg1.node.normal.y;
var _local4:Number = _arg1.node.normal.z;
var _local5:Number = (((currentDisplacement.x * _local2) + (currentDisplacement.y * _local3)) + (currentDisplacement.z * _local4));
if (_arg1.infront){
_local5 = -(_local5);
};
if (_local5 < 0){
return;
};
var _local6:Number = (_radius / Math.sqrt(((((_local2 * _local2) * _scaleX2) + ((_local3 * _local3) * _scaleY2)) + ((_local4 * _local4) * _scaleZ2))));
var _local7:Number = ((_local6 * _local2) * _scaleX2);
var _local8:Number = ((_local6 * _local3) * _scaleY2);
var _local9:Number = ((_local6 * _local4) * _scaleZ2);
var _local10:Number = (collisionSource.x + _local7);
var _local11:Number = (collisionSource.y + _local8);
var _local12:Number = (collisionSource.z + _local9);
var _local13:Number = ((((_local10 * _local2) + (_local11 * _local3)) + (_local12 * _local4)) - _arg1.node.offset);
if (!_arg1.infront){
_local13 = -(_local13);
};
if (_local13 > _arg1.sourceOffset){
_local10 = (collisionSource.x - _local7);
_local11 = (collisionSource.y - _local8);
_local12 = (collisionSource.z - _local9);
_local13 = ((((_local10 * _local2) + (_local11 * _local3)) + (_local12 * _local4)) - _arg1.node.offset);
if (!_arg1.infront){
_local13 = -(_local13);
};
};
if (_local13 > _local5){
return;
};
if (_local13 <= 0){
if (_arg1.infront){
collisionPlanePoint.x = (_local10 - (_local2 * _local13));
collisionPlanePoint.y = (_local11 - (_local3 * _local13));
collisionPlanePoint.z = (_local12 - (_local4 * _local13));
} else {
collisionPlanePoint.x = (_local10 + (_local2 * _local13));
collisionPlanePoint.y = (_local11 + (_local3 * _local13));
collisionPlanePoint.z = (_local12 + (_local4 * _local13));
};
} else {
_local15 = (_local13 / _local5);
collisionPlanePoint.x = (_local10 + (currentDisplacement.x * _local15));
collisionPlanePoint.y = (_local11 + (currentDisplacement.y * _local15));
collisionPlanePoint.z = (_local12 + (currentDisplacement.z * _local15));
};
collisionPrimitiveNearestLengthSqr = Number.MAX_VALUE;
collisionPrimitiveNearest = null;
if (_arg1.infront){
_local14 = _arg1.node.primitive;
if (_local14 != null){
if ((((((_collisionSetMode == CollisionSetMode.EXCLUDE)) && ((((collisionSet == null)) || (!(((collisionSet[_local14.face._mesh]) || (collisionSet[_local14.face._surface])))))))) || ((((((_collisionSetMode == CollisionSetMode.INCLUDE)) && (!((collisionSet == null))))) && (((collisionSet[_local14.face._mesh]) || (collisionSet[_local14.face._surface]))))))){
calculateCollisionWithPrimitiveE(_local14);
};
} else {
for (_local14 in _arg1.node.frontPrimitives) {
if ((((((_collisionSetMode == CollisionSetMode.EXCLUDE)) && ((((collisionSet == null)) || (!(((collisionSet[_local14.face._mesh]) || (collisionSet[_local14.face._surface])))))))) || ((((((_collisionSetMode == CollisionSetMode.INCLUDE)) && (!((collisionSet == null))))) && (((collisionSet[_local14.face._mesh]) || (collisionSet[_local14.face._surface]))))))){
calculateCollisionWithPrimitiveE(_local14);
if (collisionPrimitive != null){
break;
};
};
};
};
} else {
for (_local14 in _arg1.node.backPrimitives) {
if ((((((_collisionSetMode == CollisionSetMode.EXCLUDE)) && ((((collisionSet == null)) || (!(((collisionSet[_local14.face._mesh]) || (collisionSet[_local14.face._surface])))))))) || ((((((_collisionSetMode == CollisionSetMode.INCLUDE)) && (!((collisionSet == null))))) && (((collisionSet[_local14.face._mesh]) || (collisionSet[_local14.face._surface]))))))){
calculateCollisionWithPrimitiveE(_local14);
if (collisionPrimitive != null){
break;
};
};
};
};
if (collisionPrimitive != null){
if (_arg1.infront){
collisionNormal.x = _local2;
collisionNormal.y = _local3;
collisionNormal.z = _local4;
collisionOffset = _arg1.node.offset;
} else {
collisionNormal.x = -(_local2);
collisionNormal.y = -(_local3);
collisionNormal.z = -(_local4);
collisionOffset = -(_arg1.node.offset);
};
collisionRadius = (((_local7 * collisionNormal.x) + (_local8 * collisionNormal.y)) + (_local9 * collisionNormal.z));
if (collisionRadius < 0){
collisionRadius = -(collisionRadius);
};
radiusVector.x = (_local10 - collisionSource.x);
radiusVector.y = (_local11 - collisionSource.y);
radiusVector.z = (_local12 - collisionSource.z);
collisionPoint.x = collisionPlanePoint.x;
collisionPoint.y = collisionPlanePoint.y;
collisionPoint.z = collisionPlanePoint.z;
} else {
_local10 = collisionPrimitivePoint.x;
_local11 = collisionPrimitivePoint.y;
_local12 = collisionPrimitivePoint.z;
_local17 = (((_local10 * _local10) + (_local11 * _local11)) + (_local12 * _local12));
if (_local17 < _radius2){
_local6 = (_radius / Math.sqrt(_local17));
_local10 = (_local10 * (_local6 * _scaleX));
_local11 = (_local11 * (_local6 * _scaleY));
_local12 = (_local12 * (_local6 * _scaleZ));
_local16 = true;
} else {
_local18 = (-(currentDisplacement.x) / _scaleX);
_local19 = (-(currentDisplacement.y) / _scaleY);
_local20 = (-(currentDisplacement.z) / _scaleZ);
_local21 = (((_local18 * _local18) + (_local19 * _local19)) + (_local20 * _local20));
_local22 = (2 * (((_local10 * _local18) + (_local11 * _local19)) + (_local12 * _local20)));
_local23 = (_local17 - _radius2);
_local24 = ((_local22 * _local22) - ((4 * _local21) * _local23));
if (_local24 >= 0){
_local15 = ((-0.5 * (_local22 + Math.sqrt(_local24))) / _local21);
if ((((_local15 >= 0)) && ((_local15 <= 1)))){
_local10 = ((_local10 + (_local15 * _local18)) * _scaleX);
_local11 = ((_local11 + (_local15 * _local19)) * _scaleY);
_local12 = ((_local12 + (_local15 * _local20)) * _scaleZ);
_local16 = true;
};
};
};
if (_local16){
collisionNormal.x = (-(_local10) / _scaleX2);
collisionNormal.y = (-(_local11) / _scaleY2);
collisionNormal.z = (-(_local12) / _scaleZ2);
collisionNormal.normalize();
collisionRadius = (((_local10 * collisionNormal.x) + (_local11 * collisionNormal.y)) + (_local12 * collisionNormal.z));
if (collisionRadius < 0){
collisionRadius = -(collisionRadius);
};
radiusVector.x = _local10;
radiusVector.y = _local11;
radiusVector.z = _local12;
collisionPoint.x = ((collisionPrimitivePoint.x * _scaleX) + currentCoords.x);
collisionPoint.y = ((collisionPrimitivePoint.y * _scaleY) + currentCoords.y);
collisionPoint.z = ((collisionPrimitivePoint.z * _scaleZ) + currentCoords.z);
collisionOffset = (((collisionPoint.x * collisionNormal.x) + (collisionPoint.y * collisionNormal.y)) + (collisionPoint.z * collisionNormal.z));
collisionPrimitive = collisionPrimitiveNearest;
};
};
}
private function calculateCollisionWithPlaneS(_arg1:CollisionPlane):void{
var _local3:*;
var _local4:Number;
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:Number;
var _local9:Number;
var _local10:Number;
var _local11:Number;
var _local12:Number;
var _local13:Number;
var _local14:Number;
var _local15:Number;
var _local16:Number;
collisionPlanePoint.copy(collisionSource);
var _local2:Point3D = _arg1.node.normal;
if (_arg1.sourceOffset <= _radius){
if (_arg1.infront){
collisionPlanePoint.x = (collisionPlanePoint.x - (_local2.x * _arg1.sourceOffset));
collisionPlanePoint.y = (collisionPlanePoint.y - (_local2.y * _arg1.sourceOffset));
collisionPlanePoint.z = (collisionPlanePoint.z - (_local2.z * _arg1.sourceOffset));
} else {
collisionPlanePoint.x = (collisionPlanePoint.x + (_local2.x * _arg1.sourceOffset));
collisionPlanePoint.y = (collisionPlanePoint.y + (_local2.y * _arg1.sourceOffset));
collisionPlanePoint.z = (collisionPlanePoint.z + (_local2.z * _arg1.sourceOffset));
};
} else {
_local4 = ((_arg1.sourceOffset - _radius) / (_arg1.sourceOffset - _arg1.destinationOffset));
collisionPlanePoint.x = (collisionSource.x + (currentDisplacement.x * _local4));
collisionPlanePoint.y = (collisionSource.y + (currentDisplacement.y * _local4));
collisionPlanePoint.z = (collisionSource.z + (currentDisplacement.z * _local4));
if (_arg1.infront){
collisionPlanePoint.x = (collisionPlanePoint.x - (_local2.x * _radius));
collisionPlanePoint.y = (collisionPlanePoint.y - (_local2.y * _radius));
collisionPlanePoint.z = (collisionPlanePoint.z - (_local2.z * _radius));
} else {
collisionPlanePoint.x = (collisionPlanePoint.x + (_local2.x * _radius));
collisionPlanePoint.y = (collisionPlanePoint.y + (_local2.y * _radius));
collisionPlanePoint.z = (collisionPlanePoint.z + (_local2.z * _radius));
};
};
collisionPrimitiveNearestLengthSqr = Number.MAX_VALUE;
collisionPrimitiveNearest = null;
if (_arg1.infront){
_local3 = _arg1.node.primitive;
if (_local3 != null){
if ((((((_collisionSetMode == CollisionSetMode.EXCLUDE)) && ((((collisionSet == null)) || (!(((collisionSet[_local3.face._mesh]) || (collisionSet[_local3.face._surface])))))))) || ((((((_collisionSetMode == CollisionSetMode.INCLUDE)) && (!((collisionSet == null))))) && (((collisionSet[_local3.face._mesh]) || (collisionSet[_local3.face._surface]))))))){
calculateCollisionWithPrimitiveS(_arg1.node.primitive);
};
} else {
for (_local3 in _arg1.node.frontPrimitives) {
if ((((((_collisionSetMode == CollisionSetMode.EXCLUDE)) && ((((collisionSet == null)) || (!(((collisionSet[_local3.face._mesh]) || (collisionSet[_local3.face._surface])))))))) || ((((((_collisionSetMode == CollisionSetMode.INCLUDE)) && (!((collisionSet == null))))) && (((collisionSet[_local3.face._mesh]) || (collisionSet[_local3.face._surface]))))))){
calculateCollisionWithPrimitiveS(_local3);
if (collisionPrimitive != null){
break;
};
};
};
};
} else {
for (_local3 in _arg1.node.backPrimitives) {
if ((((((_collisionSetMode == CollisionSetMode.EXCLUDE)) && ((((collisionSet == null)) || (!(((collisionSet[_local3.face._mesh]) || (collisionSet[_local3.face._surface])))))))) || ((((((_collisionSetMode == CollisionSetMode.INCLUDE)) && (!((collisionSet == null))))) && (((collisionSet[_local3.face._mesh]) || (collisionSet[_local3.face._surface]))))))){
calculateCollisionWithPrimitiveS(_local3);
if (collisionPrimitive != null){
break;
};
};
};
};
if (collisionPrimitive != null){
if (_arg1.infront){
collisionNormal.x = _local2.x;
collisionNormal.y = _local2.y;
collisionNormal.z = _local2.z;
collisionOffset = _arg1.node.offset;
} else {
collisionNormal.x = -(_local2.x);
collisionNormal.y = -(_local2.y);
collisionNormal.z = -(_local2.z);
collisionOffset = -(_arg1.node.offset);
};
collisionPoint.x = collisionPlanePoint.x;
collisionPoint.y = collisionPlanePoint.y;
collisionPoint.z = collisionPlanePoint.z;
} else {
_local5 = (collisionSource.x - collisionPrimitivePoint.x);
_local6 = (collisionSource.y - collisionPrimitivePoint.y);
_local7 = (collisionSource.z - collisionPrimitivePoint.z);
if ((((_local5 * currentDisplacement.x) + (_local6 * currentDisplacement.y)) + (_local7 * currentDisplacement.z)) <= 0){
_local8 = Math.sqrt((((currentDisplacement.x * currentDisplacement.x) + (currentDisplacement.y * currentDisplacement.y)) + (currentDisplacement.z * currentDisplacement.z)));
_local9 = (-(currentDisplacement.x) / _local8);
_local10 = (-(currentDisplacement.y) / _local8);
_local11 = (-(currentDisplacement.z) / _local8);
_local12 = (((_local5 * _local5) + (_local6 * _local6)) + (_local7 * _local7));
_local13 = (((_local5 * _local9) + (_local6 * _local10)) + (_local7 * _local11));
_local14 = ((_radius2 - _local12) + (_local13 * _local13));
if (_local14 > 0){
_local15 = (_local13 - Math.sqrt(_local14));
if (_local15 < _local8){
collisionPoint.x = collisionPrimitivePoint.x;
collisionPoint.y = collisionPrimitivePoint.y;
collisionPoint.z = collisionPrimitivePoint.z;
_local16 = Math.sqrt(_local12);
collisionNormal.x = (_local5 / _local16);
collisionNormal.y = (_local6 / _local16);
collisionNormal.z = (_local7 / _local16);
collisionOffset = (((collisionPoint.x * collisionNormal.x) + (collisionPoint.y * collisionNormal.y)) + (collisionPoint.z * collisionNormal.z));
collisionPrimitive = collisionPrimitiveNearest;
};
};
};
};
}
}
}//package alternativa.engine3d.physics
Section 44
//Box (alternativa.engine3d.primitives.Box)
package alternativa.engine3d.primitives {
import alternativa.engine3d.core.*;
import flash.geom.*;
public class Box extends Mesh {
public function Box(_arg1:Number=100, _arg2:Number=100, _arg3:Number=100, _arg4:uint=1, _arg5:uint=1, _arg6:uint=1, _arg7:Boolean=false, _arg8:Boolean=false){
var _local15:int;
var _local16:int;
var _local17:int;
var _local27:String;
var _local28:Point;
var _local29:Point;
super();
if ((((((_arg4 == 0)) || ((_arg5 == 0)))) || ((_arg6 == 0)))){
return;
};
_arg1 = ((_arg1)<0) ? 0 : _arg1;
_arg2 = ((_arg2)<0) ? 0 : _arg2;
_arg3 = ((_arg3)<0) ? 0 : _arg3;
var _local9:Number = (_arg1 / 2);
var _local10:Number = (_arg2 / 2);
var _local11:Number = (_arg3 / 2);
var _local12:Number = (_arg1 / _arg4);
var _local13:Number = (_arg2 / _arg5);
var _local14:Number = (_arg3 / _arg6);
_local15 = 0;
while (_local15 <= _arg4) {
_local16 = 0;
while (_local16 <= _arg5) {
_local17 = 0;
while (_local17 <= _arg6) {
if ((((((((((((_local15 == 0)) || ((_local15 == _arg4)))) || ((_local16 == 0)))) || ((_local16 == _arg5)))) || ((_local17 == 0)))) || ((_local17 == _arg6)))){
createVertex(((_local15 * _local12) - _local9), ((_local16 * _local13) - _local10), ((_local17 * _local14) - _local11), ((((_local15 + "_") + _local16) + "_") + _local17));
};
_local17++;
};
_local16++;
};
_local15++;
};
var _local18:Surface = createSurface(null, "front");
var _local19:Surface = createSurface(null, "back");
var _local20:Surface = createSurface(null, "left");
var _local21:Surface = createSurface(null, "right");
var _local22:Surface = createSurface(null, "top");
var _local23:Surface = createSurface(null, "bottom");
var _local24:Number = (1 / _arg4);
var _local25:Number = (1 / _arg5);
var _local26:Number = (1 / _arg6);
_local16 = 0;
while (_local16 < _arg5) {
_local15 = 0;
while (_local15 < _arg4) {
_local27 = ((("top_" + _local15) + "_") + _local16);
if (_arg7){
if (_arg8){
_local28 = new Point((_local15 * _local24), ((_arg5 - _local16) * _local25));
_local29 = new Point(((_local15 + 1) * _local24), (((_arg5 - _local16) - 1) * _local25));
createFace([((((_local15 + "_") + _local16) + "_") + _arg6), ((((_local15 + "_") + (_local16 + 1)) + "_") + _arg6), (((((_local15 + 1) + "_") + (_local16 + 1)) + "_") + _arg6)], (_local27 + ":1"));
setUVsToFace(_local28, new Point((_local15 * _local24), (((_arg5 - _local16) - 1) * _local25)), _local29, (_local27 + ":1"));
createFace([(((((_local15 + 1) + "_") + (_local16 + 1)) + "_") + _arg6), (((((_local15 + 1) + "_") + _local16) + "_") + _arg6), ((((_local15 + "_") + _local16) + "_") + _arg6)], (_local27 + ":0"));
setUVsToFace(_local29, new Point(((_local15 + 1) * _local24), ((_arg5 - _local16) * _local25)), _local28, (_local27 + ":0"));
} else {
createFace([((((_local15 + "_") + _local16) + "_") + _arg6), ((((_local15 + "_") + (_local16 + 1)) + "_") + _arg6), (((((_local15 + 1) + "_") + (_local16 + 1)) + "_") + _arg6), (((((_local15 + 1) + "_") + _local16) + "_") + _arg6)], _local27);
setUVsToFace(new Point((_local15 * _local24), ((_arg5 - _local16) * _local25)), new Point((_local15 * _local24), (((_arg5 - _local16) - 1) * _local25)), new Point(((_local15 + 1) * _local24), (((_arg5 - _local16) - 1) * _local25)), _local27);
};
} else {
if (_arg8){
_local28 = new Point((_local15 * _local24), (_local16 * _local25));
_local29 = new Point(((_local15 + 1) * _local24), ((_local16 + 1) * _local25));
createFace([((((_local15 + "_") + _local16) + "_") + _arg6), (((((_local15 + 1) + "_") + _local16) + "_") + _arg6), (((((_local15 + 1) + "_") + (_local16 + 1)) + "_") + _arg6)], (_local27 + ":0"));
setUVsToFace(_local28, new Point(((_local15 + 1) * _local24), (_local16 * _local25)), _local29, (_local27 + ":0"));
createFace([(((((_local15 + 1) + "_") + (_local16 + 1)) + "_") + _arg6), ((((_local15 + "_") + (_local16 + 1)) + "_") + _arg6), ((((_local15 + "_") + _local16) + "_") + _arg6)], (_local27 + ":1"));
setUVsToFace(_local29, new Point((_local15 * _local24), ((_local16 + 1) * _local25)), _local28, (_local27 + ":1"));
} else {
createFace([((((_local15 + "_") + _local16) + "_") + _arg6), (((((_local15 + 1) + "_") + _local16) + "_") + _arg6), (((((_local15 + 1) + "_") + (_local16 + 1)) + "_") + _arg6), ((((_local15 + "_") + (_local16 + 1)) + "_") + _arg6)], _local27);
setUVsToFace(new Point((_local15 * _local24), (_local16 * _local25)), new Point(((_local15 + 1) * _local24), (_local16 * _local25)), new Point(((_local15 + 1) * _local24), ((_local16 + 1) * _local25)), _local27);
};
};
if (_arg8){
_local22.addFace((_local27 + ":0"));
_local22.addFace((_local27 + ":1"));
} else {
_local22.addFace(_local27);
};
_local15++;
};
_local16++;
};
_local16 = 0;
while (_local16 < _arg5) {
_local15 = 0;
while (_local15 < _arg4) {
_local27 = ((("bottom_" + _local15) + "_") + _local16);
if (_arg7){
if (_arg8){
_local28 = new Point(((_arg4 - _local15) * _local24), ((_arg5 - _local16) * _local25));
_local29 = new Point((((_arg4 - _local15) - 1) * _local24), (((_arg5 - _local16) - 1) * _local25));
createFace([((((_local15 + "_") + _local16) + "_") + 0), (((((_local15 + 1) + "_") + _local16) + "_") + 0), (((((_local15 + 1) + "_") + (_local16 + 1)) + "_") + 0)], (_local27 + ":0"));
setUVsToFace(_local28, new Point((((_arg4 - _local15) - 1) * _local24), ((_arg5 - _local16) * _local25)), _local29, (_local27 + ":0"));
createFace([(((((_local15 + 1) + "_") + (_local16 + 1)) + "_") + 0), ((((_local15 + "_") + (_local16 + 1)) + "_") + 0), ((((_local15 + "_") + _local16) + "_") + 0)], (_local27 + ":1"));
setUVsToFace(_local29, new Point(((_arg4 - _local15) * _local24), (((_arg5 - _local16) - 1) * _local25)), _local28, (_local27 + ":1"));
} else {
createFace([((((_local15 + "_") + _local16) + "_") + 0), (((((_local15 + 1) + "_") + _local16) + "_") + 0), (((((_local15 + 1) + "_") + (_local16 + 1)) + "_") + 0), ((((_local15 + "_") + (_local16 + 1)) + "_") + 0)], _local27);
setUVsToFace(new Point(((_arg4 - _local15) * _local24), ((_arg5 - _local16) * _local25)), new Point((((_arg4 - _local15) - 1) * _local24), ((_arg5 - _local16) * _local25)), new Point((((_arg4 - _local15) - 1) * _local24), (((_arg5 - _local16) - 1) * _local25)), _local27);
};
} else {
if (_arg8){
_local28 = new Point(((_arg4 - _local15) * _local24), (_local16 * _local25));
_local29 = new Point((((_arg4 - _local15) - 1) * _local24), ((_local16 + 1) * _local25));
createFace([((((_local15 + "_") + _local16) + "_") + 0), ((((_local15 + "_") + (_local16 + 1)) + "_") + 0), (((((_local15 + 1) + "_") + (_local16 + 1)) + "_") + 0)], (_local27 + ":1"));
setUVsToFace(_local28, new Point(((_arg4 - _local15) * _local24), ((_local16 + 1) * _local25)), _local29, (_local27 + ":1"));
createFace([(((((_local15 + 1) + "_") + (_local16 + 1)) + "_") + 0), (((((_local15 + 1) + "_") + _local16) + "_") + 0), ((((_local15 + "_") + _local16) + "_") + 0)], (_local27 + ":0"));
setUVsToFace(_local29, new Point((((_arg4 - _local15) - 1) * _local24), (_local16 * _local25)), _local28, (_local27 + ":0"));
} else {
createFace([((((_local15 + "_") + _local16) + "_") + 0), ((((_local15 + "_") + (_local16 + 1)) + "_") + 0), (((((_local15 + 1) + "_") + (_local16 + 1)) + "_") + 0), (((((_local15 + 1) + "_") + _local16) + "_") + 0)], _local27);
setUVsToFace(new Point(((_arg4 - _local15) * _local24), (_local16 * _local25)), new Point(((_arg4 - _local15) * _local24), ((_local16 + 1) * _local25)), new Point((((_arg4 - _local15) - 1) * _local24), ((_local16 + 1) * _local25)), _local27);
};
};
if (_arg8){
_local23.addFace((_local27 + ":0"));
_local23.addFace((_local27 + ":1"));
} else {
_local23.addFace(_local27);
};
_local15++;
};
_local16++;
};
_local17 = 0;
while (_local17 < _arg6) {
_local15 = 0;
while (_local15 < _arg4) {
_local27 = ((("front_" + _local15) + "_") + _local17);
if (_arg7){
if (_arg8){
_local28 = new Point(((_arg4 - _local15) * _local24), (_local17 * _local26));
_local29 = new Point((((_arg4 - _local15) - 1) * _local24), ((_local17 + 1) * _local26));
createFace([((((_local15 + "_") + 0) + "_") + _local17), ((((_local15 + "_") + 0) + "_") + (_local17 + 1)), (((((_local15 + 1) + "_") + 0) + "_") + (_local17 + 1))], (_local27 + ":1"));
setUVsToFace(_local28, new Point(((_arg4 - _local15) * _local24), ((_local17 + 1) * _local26)), _local29, (_local27 + ":1"));
createFace([(((((_local15 + 1) + "_") + 0) + "_") + (_local17 + 1)), (((((_local15 + 1) + "_") + 0) + "_") + _local17), ((((_local15 + "_") + 0) + "_") + _local17)], (_local27 + ":0"));
setUVsToFace(_local29, new Point((((_arg4 - _local15) - 1) * _local24), (_local17 * _local26)), _local28, (_local27 + ":0"));
} else {
createFace([((((_local15 + "_") + 0) + "_") + _local17), ((((_local15 + "_") + 0) + "_") + (_local17 + 1)), (((((_local15 + 1) + "_") + 0) + "_") + (_local17 + 1)), (((((_local15 + 1) + "_") + 0) + "_") + _local17)], _local27);
setUVsToFace(new Point(((_arg4 - _local15) * _local24), (_local17 * _local26)), new Point(((_arg4 - _local15) * _local24), ((_local17 + 1) * _local26)), new Point((((_arg4 - _local15) - 1) * _local24), ((_local17 + 1) * _local26)), _local27);
};
} else {
if (_arg8){
_local28 = new Point((_local15 * _local24), (_local17 * _local26));
_local29 = new Point(((_local15 + 1) * _local24), ((_local17 + 1) * _local26));
createFace([((((_local15 + "_") + 0) + "_") + _local17), (((((_local15 + 1) + "_") + 0) + "_") + _local17), (((((_local15 + 1) + "_") + 0) + "_") + (_local17 + 1))], (_local27 + ":0"));
setUVsToFace(_local28, new Point(((_local15 + 1) * _local24), (_local17 * _local26)), _local29, (_local27 + ":0"));
createFace([(((((_local15 + 1) + "_") + 0) + "_") + (_local17 + 1)), ((((_local15 + "_") + 0) + "_") + (_local17 + 1)), ((((_local15 + "_") + 0) + "_") + _local17)], (_local27 + ":1"));
setUVsToFace(_local29, new Point((_local15 * _local24), ((_local17 + 1) * _local26)), _local28, (_local27 + ":1"));
} else {
createFace([((((_local15 + "_") + 0) + "_") + _local17), (((((_local15 + 1) + "_") + 0) + "_") + _local17), (((((_local15 + 1) + "_") + 0) + "_") + (_local17 + 1)), ((((_local15 + "_") + 0) + "_") + (_local17 + 1))], _local27);
setUVsToFace(new Point((_local15 * _local24), (_local17 * _local26)), new Point(((_local15 + 1) * _local24), (_local17 * _local26)), new Point(((_local15 + 1) * _local24), ((_local17 + 1) * _local26)), _local27);
};
};
if (_arg8){
_local18.addFace((_local27 + ":0"));
_local18.addFace((_local27 + ":1"));
} else {
_local18.addFace(_local27);
};
_local15++;
};
_local17++;
};
_local17 = 0;
while (_local17 < _arg6) {
_local15 = 0;
while (_local15 < _arg4) {
_local27 = ((("back_" + _local15) + "_") + _local17);
if (_arg7){
if (_arg8){
_local28 = new Point((_local15 * _local24), ((_local17 + 1) * _local26));
_local29 = new Point(((_local15 + 1) * _local24), (_local17 * _local26));
createFace([((((_local15 + "_") + _arg5) + "_") + (_local17 + 1)), ((((_local15 + "_") + _arg5) + "_") + _local17), (((((_local15 + 1) + "_") + _arg5) + "_") + _local17)], (_local27 + ":0"));
setUVsToFace(_local28, new Point((_local15 * _local24), (_local17 * _local26)), _local29, (_local27 + ":0"));
createFace([(((((_local15 + 1) + "_") + _arg5) + "_") + _local17), (((((_local15 + 1) + "_") + _arg5) + "_") + (_local17 + 1)), ((((_local15 + "_") + _arg5) + "_") + (_local17 + 1))], (_local27 + ":1"));
setUVsToFace(_local29, new Point(((_local15 + 1) * _local24), ((_local17 + 1) * _local26)), _local28, (_local27 + ":1"));
} else {
createFace([((((_local15 + "_") + _arg5) + "_") + _local17), (((((_local15 + 1) + "_") + _arg5) + "_") + _local17), (((((_local15 + 1) + "_") + _arg5) + "_") + (_local17 + 1)), ((((_local15 + "_") + _arg5) + "_") + (_local17 + 1))], _local27);
setUVsToFace(new Point((_local15 * _local24), (_local17 * _local26)), new Point(((_local15 + 1) * _local24), (_local17 * _local26)), new Point(((_local15 + 1) * _local24), ((_local17 + 1) * _local26)), _local27);
};
} else {
if (_arg8){
_local28 = new Point(((_arg4 - _local15) * _local24), ((_local17 + 1) * _local26));
_local29 = new Point((((_arg4 - _local15) - 1) * _local24), (_local17 * _local26));
createFace([((((_local15 + "_") + _arg5) + "_") + _local17), ((((_local15 + "_") + _arg5) + "_") + (_local17 + 1)), (((((_local15 + 1) + "_") + _arg5) + "_") + _local17)], (_local27 + ":0"));
setUVsToFace(new Point(((_arg4 - _local15) * _local24), (_local17 * _local26)), _local28, _local29, (_local27 + ":0"));
createFace([((((_local15 + "_") + _arg5) + "_") + (_local17 + 1)), (((((_local15 + 1) + "_") + _arg5) + "_") + (_local17 + 1)), (((((_local15 + 1) + "_") + _arg5) + "_") + _local17)], (_local27 + ":1"));
setUVsToFace(_local28, new Point((((_arg4 - _local15) - 1) * _local24), ((_local17 + 1) * _local26)), _local29, (_local27 + ":1"));
} else {
createFace([((((_local15 + "_") + _arg5) + "_") + _local17), ((((_local15 + "_") + _arg5) + "_") + (_local17 + 1)), (((((_local15 + 1) + "_") + _arg5) + "_") + (_local17 + 1)), (((((_local15 + 1) + "_") + _arg5) + "_") + _local17)], _local27);
setUVsToFace(new Point(((_arg4 - _local15) * _local24), (_local17 * _local26)), new Point(((_arg4 - _local15) * _local24), ((_local17 + 1) * _local26)), new Point((((_arg4 - _local15) - 1) * _local24), ((_local17 + 1) * _local26)), _local27);
};
};
if (_arg8){
_local19.addFace((_local27 + ":0"));
_local19.addFace((_local27 + ":1"));
} else {
_local19.addFace(_local27);
};
_local15++;
};
_local17++;
};
_local16 = 0;
while (_local16 < _arg5) {
_local17 = 0;
while (_local17 < _arg6) {
_local27 = ((("left_" + _local16) + "_") + _local17);
if (_arg7){
if (_arg8){
_local28 = new Point((_local16 * _local25), ((_local17 + 1) * _local26));
_local29 = new Point(((_local16 + 1) * _local25), (_local17 * _local26));
createFace([((((0 + "_") + _local16) + "_") + (_local17 + 1)), ((((0 + "_") + _local16) + "_") + _local17), ((((0 + "_") + (_local16 + 1)) + "_") + _local17)], (_local27 + ":0"));
setUVsToFace(_local28, new Point((_local16 * _local25), (_local17 * _local26)), _local29, (_local27 + ":0"));
createFace([((((0 + "_") + (_local16 + 1)) + "_") + _local17), ((((0 + "_") + (_local16 + 1)) + "_") + (_local17 + 1)), ((((0 + "_") + _local16) + "_") + (_local17 + 1))], (_local27 + ":1"));
setUVsToFace(_local29, new Point(((_local16 + 1) * _local25), ((_local17 + 1) * _local26)), _local28, (_local27 + ":1"));
} else {
createFace([((((0 + "_") + _local16) + "_") + _local17), ((((0 + "_") + (_local16 + 1)) + "_") + _local17), ((((0 + "_") + (_local16 + 1)) + "_") + (_local17 + 1)), ((((0 + "_") + _local16) + "_") + (_local17 + 1))], _local27);
setUVsToFace(new Point((_local16 * _local25), (_local17 * _local26)), new Point(((_local16 + 1) * _local25), (_local17 * _local26)), new Point(((_local16 + 1) * _local25), ((_local17 + 1) * _local26)), _local27);
};
} else {
if (_arg8){
_local28 = new Point((((_arg5 - _local16) - 1) * _local25), (_local17 * _local26));
_local29 = new Point(((_arg5 - _local16) * _local25), ((_local17 + 1) * _local26));
createFace([((((0 + "_") + (_local16 + 1)) + "_") + _local17), ((((0 + "_") + _local16) + "_") + _local17), ((((0 + "_") + _local16) + "_") + (_local17 + 1))], (_local27 + ":0"));
setUVsToFace(_local28, new Point(((_arg5 - _local16) * _local25), (_local17 * _local26)), _local29, (_local27 + ":0"));
createFace([((((0 + "_") + _local16) + "_") + (_local17 + 1)), ((((0 + "_") + (_local16 + 1)) + "_") + (_local17 + 1)), ((((0 + "_") + (_local16 + 1)) + "_") + _local17)], (_local27 + ":1"));
setUVsToFace(_local29, new Point((((_arg5 - _local16) - 1) * _local25), ((_local17 + 1) * _local26)), _local28, (_local27 + ":1"));
} else {
createFace([((((0 + "_") + _local16) + "_") + _local17), ((((0 + "_") + _local16) + "_") + (_local17 + 1)), ((((0 + "_") + (_local16 + 1)) + "_") + (_local17 + 1)), ((((0 + "_") + (_local16 + 1)) + "_") + _local17)], _local27);
setUVsToFace(new Point(((_arg5 - _local16) * _local25), (_local17 * _local26)), new Point(((_arg5 - _local16) * _local25), ((_local17 + 1) * _local26)), new Point((((_arg5 - _local16) - 1) * _local25), ((_local17 + 1) * _local26)), _local27);
};
};
if (_arg8){
_local20.addFace((_local27 + ":0"));
_local20.addFace((_local27 + ":1"));
} else {
_local20.addFace(_local27);
};
_local17++;
};
_local16++;
};
_local16 = 0;
while (_local16 < _arg5) {
_local17 = 0;
while (_local17 < _arg6) {
_local27 = ((("right_" + _local16) + "_") + _local17);
if (_arg7){
if (_arg8){
_local28 = new Point(((_arg5 - _local16) * _local25), (_local17 * _local26));
_local29 = new Point((((_arg5 - _local16) - 1) * _local25), ((_local17 + 1) * _local26));
createFace([((((_arg4 + "_") + _local16) + "_") + _local17), ((((_arg4 + "_") + _local16) + "_") + (_local17 + 1)), ((((_arg4 + "_") + (_local16 + 1)) + "_") + (_local17 + 1))], (_local27 + ":1"));
setUVsToFace(_local28, new Point(((_arg5 - _local16) * _local25), ((_local17 + 1) * _local26)), _local29, (_local27 + ":1"));
createFace([((((_arg4 + "_") + (_local16 + 1)) + "_") + (_local17 + 1)), ((((_arg4 + "_") + (_local16 + 1)) + "_") + _local17), ((((_arg4 + "_") + _local16) + "_") + _local17)], (_local27 + ":0"));
setUVsToFace(_local29, new Point((((_arg5 - _local16) - 1) * _local25), (_local17 * _local26)), _local28, (_local27 + ":0"));
} else {
createFace([((((_arg4 + "_") + _local16) + "_") + _local17), ((((_arg4 + "_") + _local16) + "_") + (_local17 + 1)), ((((_arg4 + "_") + (_local16 + 1)) + "_") + (_local17 + 1)), ((((_arg4 + "_") + (_local16 + 1)) + "_") + _local17)], _local27);
setUVsToFace(new Point(((_arg5 - _local16) * _local25), (_local17 * _local26)), new Point(((_arg5 - _local16) * _local25), ((_local17 + 1) * _local26)), new Point((((_arg5 - _local16) - 1) * _local25), ((_local17 + 1) * _local26)), _local27);
};
} else {
if (_arg8){
_local28 = new Point((_local16 * _local25), (_local17 * _local26));
_local29 = new Point(((_local16 + 1) * _local25), ((_local17 + 1) * _local26));
createFace([((((_arg4 + "_") + _local16) + "_") + _local17), ((((_arg4 + "_") + (_local16 + 1)) + "_") + _local17), ((((_arg4 + "_") + (_local16 + 1)) + "_") + (_local17 + 1))], (_local27 + ":0"));
setUVsToFace(_local28, new Point(((_local16 + 1) * _local25), (_local17 * _local26)), _local29, (_local27 + ":0"));
createFace([((((_arg4 + "_") + (_local16 + 1)) + "_") + (_local17 + 1)), ((((_arg4 + "_") + _local16) + "_") + (_local17 + 1)), ((((_arg4 + "_") + _local16) + "_") + _local17)], (_local27 + ":1"));
setUVsToFace(_local29, new Point((_local16 * _local25), ((_local17 + 1) * _local26)), _local28, (_local27 + ":1"));
} else {
createFace([((((_arg4 + "_") + _local16) + "_") + _local17), ((((_arg4 + "_") + (_local16 + 1)) + "_") + _local17), ((((_arg4 + "_") + (_local16 + 1)) + "_") + (_local17 + 1)), ((((_arg4 + "_") + _local16) + "_") + (_local17 + 1))], _local27);
setUVsToFace(new Point((_local16 * _local25), (_local17 * _local26)), new Point(((_local16 + 1) * _local25), (_local17 * _local26)), new Point(((_local16 + 1) * _local25), ((_local17 + 1) * _local26)), _local27);
};
};
if (_arg8){
_local21.addFace((_local27 + ":0"));
_local21.addFace((_local27 + ":1"));
} else {
_local21.addFace(_local27);
};
_local17++;
};
_local16++;
};
}
override protected function createEmptyObject():Object3D{
return (new Box(0, 0, 0, 0));
}
}
}//package alternativa.engine3d.primitives
Section 45
//GeoSphere (alternativa.engine3d.primitives.GeoSphere)
package alternativa.engine3d.primitives {
import alternativa.engine3d.core.*;
import alternativa.types.*;
import flash.geom.*;
import alternativa.utils.*;
import alternativa.engine3d.*;
public class GeoSphere extends Mesh {
public function GeoSphere(_arg1:Number=100, _arg2:uint=2, _arg3:Boolean=false){
var _local6:uint;
var _local7:uint;
var _local8:Number;
var _local9:Number;
var _local10:Number;
var _local13:Face;
var _local15:uint;
var _local16:uint;
var _local17:uint;
var _local18:uint;
var _local19:uint;
var _local20:Vertex;
var _local21:Vertex;
var _local22:Vertex;
var _local23:Point;
var _local24:Point;
var _local25:Point;
var _local26:Point3D;
var _local27:Point3D;
var _local28:Point3D;
var _local29:Vertex;
super();
if (_arg2 == 0){
return;
};
_arg1 = ((_arg1)<0) ? 0 : _arg1;
var _local4:uint = 20;
var _local5:Array = new Array();
var _local11:Number = (0.4472136 * _arg1);
var _local12:Number = (2 * _local11);
_local5.push(createVertex(0, 0, _arg1, "poleUp"));
_local6 = 0;
while (_local6 < 5) {
_local8 = ((MathUtils.DEG360 * _local6) / 5);
_local9 = Math.sin(_local8);
_local10 = Math.cos(_local8);
_local5.push(createVertex((_local12 * _local10), (_local12 * _local9), _local11));
_local6++;
};
_local6 = 0;
while (_local6 < 5) {
_local8 = ((MathUtils.DEG180 * ((_local6 << 1) + 1)) / 5);
_local9 = Math.sin(_local8);
_local10 = Math.cos(_local8);
_local5.push(createVertex((_local12 * _local10), (_local12 * _local9), -(_local11)));
_local6++;
};
_local5.push(createVertex(0, 0, -(_arg1), "poleDown"));
_local6 = 1;
while (_local6 < 6) {
interpolate(0, _local6, _arg2, _local5);
_local6++;
};
_local6 = 1;
while (_local6 < 6) {
interpolate(_local6, ((_local6 % 5) + 1), _arg2, _local5);
_local6++;
};
_local6 = 1;
while (_local6 < 6) {
interpolate(_local6, (_local6 + 5), _arg2, _local5);
_local6++;
};
_local6 = 1;
while (_local6 < 6) {
interpolate(_local6, (((_local6 + 3) % 5) + 6), _arg2, _local5);
_local6++;
};
_local6 = 1;
while (_local6 < 6) {
interpolate((_local6 + 5), ((_local6 % 5) + 6), _arg2, _local5);
_local6++;
};
_local6 = 6;
while (_local6 < 11) {
interpolate(11, _local6, _arg2, _local5);
_local6++;
};
_local7 = 0;
while (_local7 < 5) {
_local6 = 1;
while (_local6 <= (_arg2 - 2)) {
interpolate(((12 + (_local7 * (_arg2 - 1))) + _local6), ((12 + (((_local7 + 1) % 5) * (_arg2 - 1))) + _local6), (_local6 + 1), _local5);
_local6++;
};
_local7++;
};
_local7 = 0;
while (_local7 < 5) {
_local6 = 1;
while (_local6 <= (_arg2 - 2)) {
interpolate(((12 + ((_local7 + 15) * (_arg2 - 1))) + _local6), ((12 + ((_local7 + 10) * (_arg2 - 1))) + _local6), (_local6 + 1), _local5);
_local6++;
};
_local7++;
};
_local7 = 0;
while (_local7 < 5) {
_local6 = 1;
while (_local6 <= (_arg2 - 2)) {
interpolate(((((12 + ((((_local7 + 1) % 5) + 15) * (_arg2 - 1))) + _arg2) - 2) - _local6), ((((12 + ((_local7 + 10) * (_arg2 - 1))) + _arg2) - 2) - _local6), (_local6 + 1), _local5);
_local6++;
};
_local7++;
};
_local7 = 0;
while (_local7 < 5) {
_local6 = 1;
while (_local6 <= (_arg2 - 2)) {
interpolate(((12 + ((((_local7 + 1) % 5) + 25) * (_arg2 - 1))) + _local6), ((12 + ((_local7 + 25) * (_arg2 - 1))) + _local6), (_local6 + 1), _local5);
_local6++;
};
_local7++;
};
var _local14:Surface = createSurface();
_local7 = 0;
while (_local7 < _local4) {
_local15 = 0;
while (_local15 < _arg2) {
_local16 = 0;
while (_local16 <= _local15) {
_local17 = findVertices(_arg2, _local7, _local15, _local16);
_local18 = findVertices(_arg2, _local7, (_local15 + 1), _local16);
_local19 = findVertices(_arg2, _local7, (_local15 + 1), (_local16 + 1));
_local20 = _local5[_local17];
_local21 = _local5[_local18];
_local22 = _local5[_local19];
_local26 = _local20._coords;
_local27 = _local21._coords;
_local28 = _local22._coords;
if ((((((_local26.y >= 0)) && ((_local26.x < 0)))) && ((((_local27.y < 0)) || ((_local28.y < 0)))))){
_local23 = new Point(((Math.atan2(_local26.y, _local26.x) / MathUtils.DEG360) - 0.5), ((Math.asin((_local26.z / _arg1)) / MathUtils.DEG180) + 0.5));
} else {
_local23 = new Point(((Math.atan2(_local26.y, _local26.x) / MathUtils.DEG360) + 0.5), ((Math.asin((_local26.z / _arg1)) / MathUtils.DEG180) + 0.5));
};
if ((((((_local27.y >= 0)) && ((_local27.x < 0)))) && ((((_local26.y < 0)) || ((_local28.y < 0)))))){
_local24 = new Point(((Math.atan2(_local27.y, _local27.x) / MathUtils.DEG360) - 0.5), ((Math.asin((_local27.z / _arg1)) / MathUtils.DEG180) + 0.5));
} else {
_local24 = new Point(((Math.atan2(_local27.y, _local27.x) / MathUtils.DEG360) + 0.5), ((Math.asin((_local27.z / _arg1)) / MathUtils.DEG180) + 0.5));
};
if ((((((_local28.y >= 0)) && ((_local28.x < 0)))) && ((((_local26.y < 0)) || ((_local27.y < 0)))))){
_local25 = new Point(((Math.atan2(_local28.y, _local28.x) / MathUtils.DEG360) - 0.5), ((Math.asin((_local28.z / _arg1)) / MathUtils.DEG180) + 0.5));
} else {
_local25 = new Point(((Math.atan2(_local28.y, _local28.x) / MathUtils.DEG360) + 0.5), ((Math.asin((_local28.z / _arg1)) / MathUtils.DEG180) + 0.5));
};
if ((((_local17 == 0)) || ((_local17 == 11)))){
_local23.x = (_local24.x + ((_local25.x - _local24.x) * 0.5));
};
if ((((_local18 == 0)) || ((_local18 == 11)))){
_local24.x = (_local23.x + ((_local25.x - _local23.x) * 0.5));
};
if ((((_local19 == 0)) || ((_local19 == 11)))){
_local25.x = (_local23.x + ((_local24.x - _local23.x) * 0.5));
};
if (_arg3){
_local13 = createFace([_local20, _local22, _local21], (((((_local16 << 1) + "_") + _local15) + "_") + _local7));
_local23.x = (1 - _local23.x);
_local24.x = (1 - _local24.x);
_local25.x = (1 - _local25.x);
setUVsToFace(_local23, _local25, _local24, _local13);
} else {
_local13 = createFace([_local20, _local21, _local22], (((((_local16 << 1) + "_") + _local15) + "_") + _local7));
setUVsToFace(_local23, _local24, _local25, _local13);
};
_local14.addFace(_local13);
if (_local16 < _local15){
_local18 = findVertices(_arg2, _local7, _local15, (_local16 + 1));
_local29 = _local5[_local18];
_local27 = _local29._coords;
if ((((((_local26.y >= 0)) && ((_local26.x < 0)))) && ((((_local27.y < 0)) || ((_local28.y < 0)))))){
_local23 = new Point(((Math.atan2(_local26.y, _local26.x) / MathUtils.DEG360) - 0.5), ((Math.asin((_local26.z / _arg1)) / MathUtils.DEG180) + 0.5));
} else {
_local23 = new Point(((Math.atan2(_local26.y, _local26.x) / MathUtils.DEG360) + 0.5), ((Math.asin((_local26.z / _arg1)) / MathUtils.DEG180) + 0.5));
};
if ((((((_local27.y >= 0)) && ((_local27.x < 0)))) && ((((_local26.y < 0)) || ((_local28.y < 0)))))){
_local24 = new Point(((Math.atan2(_local27.y, _local27.x) / MathUtils.DEG360) - 0.5), ((Math.asin((_local27.z / _arg1)) / MathUtils.DEG180) + 0.5));
} else {
_local24 = new Point(((Math.atan2(_local27.y, _local27.x) / MathUtils.DEG360) + 0.5), ((Math.asin((_local27.z / _arg1)) / MathUtils.DEG180) + 0.5));
};
if ((((((_local28.y >= 0)) && ((_local28.x < 0)))) && ((((_local26.y < 0)) || ((_local27.y < 0)))))){
_local25 = new Point(((Math.atan2(_local28.y, _local28.x) / MathUtils.DEG360) - 0.5), ((Math.asin((_local28.z / _arg1)) / MathUtils.DEG180) + 0.5));
} else {
_local25 = new Point(((Math.atan2(_local28.y, _local28.x) / MathUtils.DEG360) + 0.5), ((Math.asin((_local28.z / _arg1)) / MathUtils.DEG180) + 0.5));
};
if ((((_local17 == 0)) || ((_local17 == 11)))){
_local23.x = (_local24.x + ((_local25.x - _local24.x) * 0.5));
};
if ((((_local18 == 0)) || ((_local18 == 11)))){
_local24.x = (_local23.x + ((_local25.x - _local23.x) * 0.5));
};
if ((((_local19 == 0)) || ((_local19 == 11)))){
_local25.x = (_local23.x + ((_local24.x - _local23.x) * 0.5));
};
if (_arg3){
_local13 = createFace([_local20, _local29, _local22], ((((((_local16 << 1) + 1) + "_") + _local15) + "_") + _local7));
_local23.x = (1 - _local23.x);
_local24.x = (1 - _local24.x);
_local25.x = (1 - _local25.x);
setUVsToFace(_local23, _local24, _local25, _local13);
} else {
_local13 = createFace([_local20, _local22, _local29], ((((((_local16 << 1) + 1) + "_") + _local15) + "_") + _local7));
setUVsToFace(_local23, _local25, _local24, _local13);
};
_local14.addFace(_local13);
};
_local16++;
};
_local15++;
};
_local7++;
};
}
override protected function createEmptyObject():Object3D{
return (new GeoSphere(0, 0));
}
private function interpolate(_arg1:uint, _arg2:uint, _arg3:uint, _arg4:Array):void{
var _local11:Number;
var _local12:Number;
var _local13:Number;
var _local14:Number;
if (_arg3 < 2){
return;
};
var _local5:Vertex = Vertex(_arg4[_arg1]);
var _local6:Vertex = Vertex(_arg4[_arg2]);
var _local7:Number = ((((_local5.x * _local6.x) + (_local5.y * _local6.y)) + (_local5.z * _local6.z)) / (((_local5.x * _local5.x) + (_local5.y * _local5.y)) + (_local5.z * _local5.z)));
_local7 = ((_local7)<-1) ? -1 : ((_local7)>1) ? 1 : _local7;
var _local8:Number = Math.acos(_local7);
var _local9:Number = Math.sin(_local8);
var _local10:uint = 1;
while (_local10 < _arg3) {
_local11 = ((_local8 * _local10) / _arg3);
_local12 = ((_local8 * (_arg3 - _local10)) / _arg3);
_local13 = Math.sin(_local11);
_local14 = Math.sin(_local12);
_arg4.push(createVertex((((_local5.x * _local14) + (_local6.x * _local13)) / _local9), (((_local5.y * _local14) + (_local6.y * _local13)) / _local9), (((_local5.z * _local14) + (_local6.z * _local13)) / _local9)));
_local10++;
};
}
private function findVertices(_arg1:uint, _arg2:uint, _arg3:uint, _arg4:uint):uint{
if (_arg3 == 0){
if (_arg2 < 5){
return (0);
};
if (_arg2 > 14){
return (11);
};
return ((_arg2 - 4));
};
if ((((_arg3 == _arg1)) && ((_arg4 == 0)))){
if (_arg2 < 5){
return ((_arg2 + 1));
};
if (_arg2 < 10){
return ((((_arg2 + 4) % 5) + 6));
};
if (_arg2 < 15){
return ((((_arg2 + 1) % 5) + 1));
};
return ((((_arg2 + 1) % 5) + 6));
};
if ((((_arg3 == _arg1)) && ((_arg4 == _arg1)))){
if (_arg2 < 5){
return ((((_arg2 + 1) % 5) + 1));
};
if (_arg2 < 10){
return ((_arg2 + 1));
};
if (_arg2 < 15){
return ((_arg2 - 9));
};
return ((_arg2 - 9));
};
if (_arg3 == _arg1){
if (_arg2 < 5){
return ((((12 + ((5 + _arg2) * (_arg1 - 1))) + _arg4) - 1));
};
if (_arg2 < 10){
return ((((12 + ((20 + ((_arg2 + 4) % 5)) * (_arg1 - 1))) + _arg4) - 1));
};
if (_arg2 < 15){
return (((((12 + ((_arg2 - 5) * (_arg1 - 1))) + _arg1) - 1) - _arg4));
};
return (((((12 + ((5 + _arg2) * (_arg1 - 1))) + _arg1) - 1) - _arg4));
};
if (_arg4 == 0){
if (_arg2 < 5){
return ((((12 + (_arg2 * (_arg1 - 1))) + _arg3) - 1));
};
if (_arg2 < 10){
return ((((12 + (((_arg2 % 5) + 15) * (_arg1 - 1))) + _arg3) - 1));
};
if (_arg2 < 15){
return (((((12 + ((((_arg2 + 1) % 5) + 15) * (_arg1 - 1))) + _arg1) - 1) - _arg3));
};
return ((((12 + ((((_arg2 + 1) % 5) + 25) * (_arg1 - 1))) + _arg3) - 1));
};
if (_arg4 == _arg3){
if (_arg2 < 5){
return ((((12 + (((_arg2 + 1) % 5) * (_arg1 - 1))) + _arg3) - 1));
};
if (_arg2 < 10){
return ((((12 + (((_arg2 % 5) + 10) * (_arg1 - 1))) + _arg3) - 1));
};
if (_arg2 < 15){
return (((((12 + (((_arg2 % 5) + 10) * (_arg1 - 1))) + _arg1) - _arg3) - 1));
};
return ((((12 + (((_arg2 % 5) + 25) * (_arg1 - 1))) + _arg3) - 1));
};
return ((((((12 + (30 * (_arg1 - 1))) + (((_arg2 * (_arg1 - 1)) * (_arg1 - 2)) / 2)) + (((_arg3 - 1) * (_arg3 - 2)) / 2)) + _arg4) - 1));
}
}
}//package alternativa.engine3d.primitives
Section 46
//Plane (alternativa.engine3d.primitives.Plane)
package alternativa.engine3d.primitives {
import alternativa.engine3d.core.*;
import flash.geom.*;
import alternativa.engine3d.*;
public class Plane extends Mesh {
public function Plane(_arg1:Number=100, _arg2:Number=100, _arg3:uint=1, _arg4:uint=1, _arg5:Boolean=true, _arg6:Boolean=false, _arg7:Boolean=false){
var _local14:int;
var _local15:int;
var _local17:Surface;
var _local18:Surface;
super();
if ((((_arg3 == 0)) || ((_arg4 == 0)))){
return;
};
_arg1 = ((_arg1)<0) ? 0 : _arg1;
_arg2 = ((_arg2)<0) ? 0 : _arg2;
var _local8:Number = (_arg1 / 2);
var _local9:Number = (_arg2 / 2);
var _local10:Number = (_arg1 / _arg3);
var _local11:Number = (_arg2 / _arg4);
var _local12:Number = (1 / _arg3);
var _local13:Number = (1 / _arg4);
var _local16:Array = new Array();
_local15 = 0;
while (_local15 <= _arg4) {
_local16[_local15] = new Array();
_local14 = 0;
while (_local14 <= _arg3) {
_local16[_local15][_local14] = new Point((_local14 * _local12), (_local15 * _local13));
createVertex(((_local14 * _local10) - _local8), ((_local15 * _local11) - _local9), 0, ((_local14 + "_") + _local15));
_local14++;
};
_local15++;
};
if (((_arg5) || (!(_arg6)))){
_local17 = createSurface(null, "front");
};
if (((_arg5) || (_arg6))){
_local18 = createSurface(null, "back");
};
_local15 = 0;
while (_local15 < _arg4) {
_local14 = 0;
while (_local14 < _arg3) {
if (((_arg5) || (!(_arg6)))){
if (_arg7){
createFace([((_local14 + "_") + _local15), (((_local14 + 1) + "_") + _local15), (((_local14 + 1) + "_") + (_local15 + 1))], (((("front" + _local14) + "_") + _local15) + ":0"));
setUVsToFace(_local16[_local15][_local14], _local16[_local15][(_local14 + 1)], _local16[(_local15 + 1)][(_local14 + 1)], (((("front" + _local14) + "_") + _local15) + ":0"));
createFace([(((_local14 + 1) + "_") + (_local15 + 1)), ((_local14 + "_") + (_local15 + 1)), ((_local14 + "_") + _local15)], (((("front" + _local14) + "_") + _local15) + ":1"));
setUVsToFace(_local16[(_local15 + 1)][(_local14 + 1)], _local16[(_local15 + 1)][_local14], _local16[_local15][_local14], (((("front" + _local14) + "_") + _local15) + ":1"));
_local17.addFace((((("front" + _local14) + "_") + _local15) + ":0"));
_local17.addFace((((("front" + _local14) + "_") + _local15) + ":1"));
} else {
createFace([((_local14 + "_") + _local15), (((_local14 + 1) + "_") + _local15), (((_local14 + 1) + "_") + (_local15 + 1)), ((_local14 + "_") + (_local15 + 1))], ((("front" + _local14) + "_") + _local15));
setUVsToFace(_local16[_local15][_local14], _local16[_local15][(_local14 + 1)], _local16[(_local15 + 1)][(_local14 + 1)], ((("front" + _local14) + "_") + _local15));
_local17.addFace(((("front" + _local14) + "_") + _local15));
};
};
if (((_arg5) || (_arg6))){
if (_arg7){
createFace([((_local14 + "_") + _local15), ((_local14 + "_") + (_local15 + 1)), (((_local14 + 1) + "_") + (_local15 + 1))], (((("back" + _local14) + "_") + _local15) + ":0"));
setUVsToFace(_local16[(_arg4 - _local15)][_local14], _local16[((_arg4 - _local15) - 1)][_local14], _local16[((_arg4 - _local15) - 1)][(_local14 + 1)], (((("back" + _local14) + "_") + _local15) + ":0"));
createFace([(((_local14 + 1) + "_") + (_local15 + 1)), (((_local14 + 1) + "_") + _local15), ((_local14 + "_") + _local15)], (((("back" + _local14) + "_") + _local15) + ":1"));
setUVsToFace(_local16[((_arg4 - _local15) - 1)][(_local14 + 1)], _local16[(_arg4 - _local15)][(_local14 + 1)], _local16[(_arg4 - _local15)][_local14], (((("back" + _local14) + "_") + _local15) + ":1"));
_local18.addFace((((("back" + _local14) + "_") + _local15) + ":0"));
_local18.addFace((((("back" + _local14) + "_") + _local15) + ":1"));
} else {
createFace([((_local14 + "_") + _local15), ((_local14 + "_") + (_local15 + 1)), (((_local14 + 1) + "_") + (_local15 + 1)), (((_local14 + 1) + "_") + _local15)], ((("back" + _local14) + "_") + _local15));
setUVsToFace(_local16[(_arg4 - _local15)][_local14], _local16[((_arg4 - _local15) - 1)][_local14], _local16[((_arg4 - _local15) - 1)][(_local14 + 1)], ((("back" + _local14) + "_") + _local15));
_local18.addFace(((("back" + _local14) + "_") + _local15));
};
};
_local14++;
};
_local15++;
};
}
override protected function createEmptyObject():Object3D{
return (new Plane(0, 0, 0));
}
}
}//package alternativa.engine3d.primitives
Section 47
//alternativa3d (alternativa.engine3d.alternativa3d)
package alternativa.engine3d {
public namespace alternativa3d = "http://alternativaplatform.com/en/alternativa3d";
}//package alternativa.engine3d
Section 48
//alternativatypes (alternativa.types.alternativatypes)
package alternativa.types {
public namespace alternativatypes = "http://alternativaplatform.com/en/alternativatypes";
}//package alternativa.types
Section 49
//Map (alternativa.types.Map)
package alternativa.types {
import flash.utils.*;
public dynamic class Map extends Dictionary {
private var weakKeys:Boolean;
public function Map(_arg1:Boolean=false){
this.weakKeys = _arg1;
super(_arg1);
}
public function add(_arg1, _arg2):void{
this[_arg1] = _arg2;
}
public function isEmpty():Boolean{
var _local1:*;
for (_local1 in this) {
return (false);
};
return (true);
}
public function remove(_arg1):void{
delete this[_arg1];
}
public function hasKey(_arg1):Boolean{
return (!((this[_arg1] === undefined)));
}
public function get length():uint{
var _local2:*;
var _local1:uint;
for (_local2 in this) {
_local1++;
};
return (_local1);
}
public function take(){
var _local1:*;
var _local2:*;
for (_local1 in this) {
_local2 = this[_local1];
delete this[_local1];
return (_local2);
};
return (null);
}
public function clear():void{
var _local1:*;
for (_local1 in this) {
delete this[_local1];
};
}
public function any(){
var _local3:*;
var _local1:uint;
var _local2:uint = (Math.random() * length);
for (_local3 in this) {
if (_local1 == _local2){
return (this[_local3]);
};
_local1++;
};
return (null);
}
public function isSingle():Boolean{
var _local2:*;
var _local1:Boolean;
for (_local2 in this) {
if (_local1){
return (false);
};
_local1 = true;
};
return (_local1);
}
public function concat(_arg1:Map):void{
var _local2:*;
for (_local2 in _arg1) {
this[_local2] = _arg1[_local2];
};
}
public function toSet(_arg1:Boolean=false):Set{
var _local3:*;
var _local2:Set = new Set(_arg1);
for each (_local3 in this) {
_local2[_local3] = true;
};
return (_local2);
}
public function hasValue(_arg1):Boolean{
var _local2:*;
for (_local2 in this) {
if (this[_local2] === _arg1){
return (true);
};
};
return (false);
}
public function toString():String{
var _local3:*;
var _local1:int;
var _local2 = "";
for (_local3 in this) {
_local2 = (_local2 + ((("," + _local3) + ":") + this[_local3]));
_local1++;
};
return (((("[Map length:" + _local1) + ((_local1 > 0)) ? (" " + _local2.substring(1)) : "") + "]"));
}
public function peek(){
var _local1:*;
for (_local1 in this) {
return (this[_local1]);
};
return (null);
}
public function clone():Map{
var _local2:*;
var _local1:Map = new Map(weakKeys);
for (_local2 in this) {
_local1[_local2] = this[_local2];
};
return (_local1);
}
public function toArray(_arg1:Boolean=false):Array{
var _local3:*;
var _local2:Array = new Array();
if (_arg1){
for (_local3 in this) {
_local2.push(this[_local3]);
};
} else {
for (_local3 in this) {
_local2[_local3] = this[_local3];
};
};
return (_local2);
}
}
}//package alternativa.types
Section 50
//Matrix3D (alternativa.types.Matrix3D)
package alternativa.types {
public final class Matrix3D {
public var a:Number;
public var b:Number;
public var c:Number;
public var d:Number;
public var e:Number;
public var f:Number;
public var g:Number;
public var h:Number;
public var i:Number;
public var j:Number;
public var k:Number;
public var l:Number;
public function Matrix3D(_arg1:Number=1, _arg2:Number=0, _arg3:Number=0, _arg4:Number=0, _arg5:Number=0, _arg6:Number=1, _arg7:Number=0, _arg8:Number=0, _arg9:Number=0, _arg10:Number=0, _arg11:Number=1, _arg12:Number=0){
this.a = _arg1;
this.b = _arg2;
this.c = _arg3;
this.d = _arg4;
this.e = _arg5;
this.f = _arg6;
this.g = _arg7;
this.h = _arg8;
this.i = _arg9;
this.j = _arg10;
this.k = _arg11;
this.l = _arg12;
}
public function clone():Matrix3D{
return (new Matrix3D(a, b, c, d, e, f, g, h, i, j, k, l));
}
public function toString():String{
return (((((((((((((((((((((((((("[Matrix3D " + "[") + a.toFixed(3)) + " ") + b.toFixed(3)) + " ") + c.toFixed(3)) + " ") + d.toFixed(3)) + "] [") + e.toFixed(3)) + " ") + f.toFixed(3)) + " ") + g.toFixed(3)) + " ") + h.toFixed(3)) + "] [") + i.toFixed(3)) + " ") + j.toFixed(3)) + " ") + k.toFixed(3)) + " ") + l.toFixed(3)) + "]]"));
}
public function scale(_arg1:Number=1, _arg2:Number=1, _arg3:Number=1):void{
a = (a * _arg1);
b = (b * _arg1);
c = (c * _arg1);
d = (d * _arg1);
e = (e * _arg2);
f = (f * _arg2);
g = (g * _arg2);
h = (h * _arg2);
i = (i * _arg3);
j = (j * _arg3);
k = (k * _arg3);
l = (l * _arg3);
}
public function offset(_arg1:Number=0, _arg2:Number=0, _arg3:Number=0):void{
d = _arg1;
h = _arg2;
l = _arg3;
}
public function translate(_arg1:Number=0, _arg2:Number=0, _arg3:Number=0):void{
d = (d + _arg1);
h = (h + _arg2);
l = (l + _arg3);
}
public function equals(_arg1:Matrix3D, _arg2:Number=0):Boolean{
var _local3:Number = (a - _arg1.a);
var _local4:Number = (b - _arg1.b);
var _local5:Number = (c - _arg1.c);
var _local6:Number = (d - _arg1.d);
var _local7:Number = (e - _arg1.e);
var _local8:Number = (f - _arg1.f);
var _local9:Number = (g - _arg1.g);
var _local10:Number = (h - _arg1.h);
var _local11:Number = (i - _arg1.i);
var _local12:Number = (j - _arg1.j);
var _local13:Number = (k - _arg1.k);
var _local14:Number = (l - _arg1.l);
_local3 = ((_local3)<0) ? -(_local3) : _local3;
_local4 = ((_local4)<0) ? -(_local4) : _local4;
_local5 = ((_local5)<0) ? -(_local5) : _local5;
_local6 = ((_local6)<0) ? -(_local6) : _local6;
_local7 = ((_local7)<0) ? -(_local7) : _local7;
_local8 = ((_local8)<0) ? -(_local8) : _local8;
_local9 = ((_local9)<0) ? -(_local9) : _local9;
_local10 = ((_local10)<0) ? -(_local10) : _local10;
_local11 = ((_local11)<0) ? -(_local11) : _local11;
_local12 = ((_local12)<0) ? -(_local12) : _local12;
_local13 = ((_local13)<0) ? -(_local13) : _local13;
_local14 = ((_local14)<0) ? -(_local14) : _local14;
return ((((((((((((((((((((((((_local3 <= _arg2)) && ((_local4 <= _arg2)))) && ((_local5 <= _arg2)))) && ((_local6 <= _arg2)))) && ((_local7 <= _arg2)))) && ((_local8 <= _arg2)))) && ((_local9 <= _arg2)))) && ((_local10 <= _arg2)))) && ((_local11 <= _arg2)))) && ((_local12 <= _arg2)))) && ((_local13 <= _arg2)))) && ((_local14 <= _arg2))));
}
public function toIdentity():void{
a = (f = (k = 1));
b = (c = (d = (e = (g = (h = (i = (j = (l = 0))))))));
}
public function rotate(_arg1:Number=0, _arg2:Number=0, _arg3:Number=0):void{
var _local4:Number = Math.cos(_arg1);
var _local5:Number = Math.sin(_arg1);
var _local6:Number = Math.cos(_arg2);
var _local7:Number = Math.sin(_arg2);
var _local8:Number = Math.cos(_arg3);
var _local9:Number = Math.sin(_arg3);
var _local10:Number = (_local8 * _local7);
var _local11:Number = (_local9 * _local7);
var _local12:Number = (_local8 * _local6);
var _local13:Number = ((_local10 * _local5) - (_local9 * _local4));
var _local14:Number = ((_local10 * _local4) + (_local9 * _local5));
var _local15:Number = (_local9 * _local6);
var _local16:Number = ((_local11 * _local5) + (_local8 * _local4));
var _local17:Number = ((_local11 * _local4) - (_local8 * _local5));
var _local18:Number = -(_local7);
var _local19:Number = (_local6 * _local5);
var _local20:Number = (_local6 * _local4);
var _local21:Number = a;
var _local22:Number = b;
var _local23:Number = c;
var _local24:Number = d;
var _local25:Number = e;
var _local26:Number = f;
var _local27:Number = g;
var _local28:Number = h;
var _local29:Number = i;
var _local30:Number = j;
var _local31:Number = k;
var _local32:Number = l;
a = (((_local12 * _local21) + (_local13 * _local25)) + (_local14 * _local29));
b = (((_local12 * _local22) + (_local13 * _local26)) + (_local14 * _local30));
c = (((_local12 * _local23) + (_local13 * _local27)) + (_local14 * _local31));
d = (((_local12 * _local24) + (_local13 * _local28)) + (_local14 * _local32));
e = (((_local15 * _local21) + (_local16 * _local25)) + (_local17 * _local29));
f = (((_local15 * _local22) + (_local16 * _local26)) + (_local17 * _local30));
g = (((_local15 * _local23) + (_local16 * _local27)) + (_local17 * _local31));
h = (((_local15 * _local24) + (_local16 * _local28)) + (_local17 * _local32));
i = (((_local18 * _local21) + (_local19 * _local25)) + (_local20 * _local29));
j = (((_local18 * _local22) + (_local19 * _local26)) + (_local20 * _local30));
k = (((_local18 * _local23) + (_local19 * _local27)) + (_local20 * _local31));
l = (((_local18 * _local24) + (_local19 * _local28)) + (_local20 * _local32));
}
public function inverseTransform(_arg1:Number=0, _arg2:Number=0, _arg3:Number=0, _arg4:Number=0, _arg5:Number=0, _arg6:Number=0, _arg7:Number=1, _arg8:Number=1, _arg9:Number=1):void{
var _local10:Number = Math.cos(_arg4);
var _local11:Number = Math.sin(-(_arg4));
var _local12:Number = Math.cos(_arg5);
var _local13:Number = Math.sin(-(_arg5));
var _local14:Number = Math.cos(_arg6);
var _local15:Number = Math.sin(-(_arg6));
var _local16:Number = (_local11 * _local13);
var _local17:Number = (1 / _arg7);
var _local18:Number = (1 / _arg8);
var _local19:Number = (1 / _arg9);
var _local20:Number = (_local12 * _local17);
var _local21:Number = (_local10 * _local18);
var _local22:Number = (_local11 * _local19);
var _local23:Number = (_local10 * _local19);
var _local24:Number = (_local14 * _local20);
var _local25:Number = (-(_local15) * _local20);
var _local26:Number = (_local13 * _local17);
var _local27:Number = -((((_local24 * _arg1) + (_local25 * _arg2)) + (_local26 * _arg3)));
var _local28:Number = ((_local15 * _local21) + ((_local16 * _local14) * _local18));
var _local29:Number = ((_local14 * _local21) - ((_local16 * _local15) * _local18));
var _local30:Number = ((-(_local11) * _local12) * _local18);
var _local31:Number = -((((_local28 * _arg1) + (_local29 * _arg2)) + (_local30 * _arg3)));
var _local32:Number = ((_local15 * _local22) - ((_local14 * _local13) * _local23));
var _local33:Number = ((_local14 * _local22) + ((_local13 * _local15) * _local23));
var _local34:Number = (_local12 * _local23);
var _local35:Number = -((((_local32 * _arg1) + (_local33 * _arg2)) + (_local34 * _arg3)));
var _local36:Number = a;
var _local37:Number = b;
var _local38:Number = c;
var _local39:Number = d;
var _local40:Number = e;
var _local41:Number = f;
var _local42:Number = g;
var _local43:Number = h;
var _local44:Number = i;
var _local45:Number = j;
var _local46:Number = k;
var _local47:Number = l;
a = (((_local24 * _local36) + (_local25 * _local40)) + (_local26 * _local44));
b = (((_local24 * _local37) + (_local25 * _local41)) + (_local26 * _local45));
c = (((_local24 * _local38) + (_local25 * _local42)) + (_local26 * _local46));
d = ((((_local24 * _local39) + (_local25 * _local43)) + (_local26 * _local47)) + _local27);
e = (((_local28 * _local36) + (_local29 * _local40)) + (_local30 * _local44));
f = (((_local28 * _local37) + (_local29 * _local41)) + (_local30 * _local45));
g = (((_local28 * _local38) + (_local29 * _local42)) + (_local30 * _local46));
h = ((((_local28 * _local39) + (_local29 * _local43)) + (_local30 * _local47)) + _local31);
i = (((_local32 * _local36) + (_local33 * _local40)) + (_local34 * _local44));
j = (((_local32 * _local37) + (_local33 * _local41)) + (_local34 * _local45));
k = (((_local32 * _local38) + (_local33 * _local42)) + (_local34 * _local46));
l = ((((_local32 * _local39) + (_local33 * _local43)) + (_local34 * _local47)) + _local35);
}
public function invert():void{
var _local1:Number = a;
var _local2:Number = b;
var _local3:Number = c;
var _local4:Number = d;
var _local5:Number = e;
var _local6:Number = f;
var _local7:Number = g;
var _local8:Number = h;
var _local9:Number = i;
var _local10:Number = j;
var _local11:Number = k;
var _local12:Number = l;
var _local13:Number = (((((((-(_local3) * _local6) * _local9) + ((_local2 * _local7) * _local9)) + ((_local3 * _local5) * _local10)) - ((_local1 * _local7) * _local10)) - ((_local2 * _local5) * _local11)) + ((_local1 * _local6) * _local11));
a = (((-(_local7) * _local10) + (_local6 * _local11)) / _local13);
b = (((_local3 * _local10) - (_local2 * _local11)) / _local13);
c = (((-(_local3) * _local6) + (_local2 * _local7)) / _local13);
d = ((((((((_local4 * _local7) * _local10) - ((_local3 * _local8) * _local10)) - ((_local4 * _local6) * _local11)) + ((_local2 * _local8) * _local11)) + ((_local3 * _local6) * _local12)) - ((_local2 * _local7) * _local12)) / _local13);
e = (((_local7 * _local9) - (_local5 * _local11)) / _local13);
f = (((-(_local3) * _local9) + (_local1 * _local11)) / _local13);
g = (((_local3 * _local5) - (_local1 * _local7)) / _local13);
h = ((((((((_local3 * _local8) * _local9) - ((_local4 * _local7) * _local9)) + ((_local4 * _local5) * _local11)) - ((_local1 * _local8) * _local11)) - ((_local3 * _local5) * _local12)) + ((_local1 * _local7) * _local12)) / _local13);
i = (((-(_local6) * _local9) + (_local5 * _local10)) / _local13);
j = (((_local2 * _local9) - (_local1 * _local10)) / _local13);
k = (((-(_local2) * _local5) + (_local1 * _local6)) / _local13);
l = ((((((((_local4 * _local6) * _local9) - ((_local2 * _local8) * _local9)) - ((_local4 * _local5) * _local10)) + ((_local1 * _local8) * _local10)) + ((_local2 * _local5) * _local12)) - ((_local1 * _local6) * _local12)) / _local13);
}
public function inverseCombine(_arg1:Matrix3D):void{
var _local2:Number = a;
var _local3:Number = b;
var _local4:Number = c;
var _local5:Number = d;
var _local6:Number = e;
var _local7:Number = f;
var _local8:Number = g;
var _local9:Number = h;
var _local10:Number = i;
var _local11:Number = j;
var _local12:Number = k;
var _local13:Number = l;
a = (((_local2 * _arg1.a) + (_local3 * _arg1.e)) + (_local4 * _arg1.i));
b = (((_local2 * _arg1.b) + (_local3 * _arg1.f)) + (_local4 * _arg1.j));
c = (((_local2 * _arg1.c) + (_local3 * _arg1.g)) + (_local4 * _arg1.k));
d = ((((_local2 * _arg1.d) + (_local3 * _arg1.h)) + (_local4 * _arg1.l)) + _local5);
e = (((_local6 * _arg1.a) + (_local7 * _arg1.e)) + (_local8 * _arg1.i));
f = (((_local6 * _arg1.b) + (_local7 * _arg1.f)) + (_local8 * _arg1.j));
g = (((_local6 * _arg1.c) + (_local7 * _arg1.g)) + (_local8 * _arg1.k));
h = ((((_local6 * _arg1.d) + (_local7 * _arg1.h)) + (_local8 * _arg1.l)) + _local9);
i = (((_local10 * _arg1.a) + (_local11 * _arg1.e)) + (_local12 * _arg1.i));
j = (((_local10 * _arg1.b) + (_local11 * _arg1.f)) + (_local12 * _arg1.j));
k = (((_local10 * _arg1.c) + (_local11 * _arg1.g)) + (_local12 * _arg1.k));
l = ((((_local10 * _arg1.d) + (_local11 * _arg1.h)) + (_local12 * _arg1.l)) + _local13);
}
public function toTransform(_arg1:Number=0, _arg2:Number=0, _arg3:Number=0, _arg4:Number=0, _arg5:Number=0, _arg6:Number=0, _arg7:Number=1, _arg8:Number=1, _arg9:Number=1):void{
var _local10:Number = Math.cos(_arg4);
var _local11:Number = Math.sin(_arg4);
var _local12:Number = Math.cos(_arg5);
var _local13:Number = Math.sin(_arg5);
var _local14:Number = Math.cos(_arg6);
var _local15:Number = Math.sin(_arg6);
var _local16:Number = (_local14 * _local13);
var _local17:Number = (_local15 * _local13);
var _local18:Number = (_local12 * _arg7);
var _local19:Number = (_local11 * _arg8);
var _local20:Number = (_local10 * _arg8);
var _local21:Number = (_local10 * _arg9);
var _local22:Number = (_local11 * _arg9);
a = (_local14 * _local18);
b = ((_local16 * _local19) - (_local15 * _local20));
c = ((_local16 * _local21) + (_local15 * _local22));
d = _arg1;
e = (_local15 * _local18);
f = ((_local17 * _local19) + (_local14 * _local20));
g = ((_local17 * _local21) - (_local14 * _local22));
h = _arg2;
i = (-(_local13) * _arg7);
j = (_local12 * _local19);
k = (_local12 * _local21);
l = _arg3;
}
public function inverseRotate(_arg1:Number=0, _arg2:Number=0, _arg3:Number=0):void{
var _local4:Number = Math.cos(_arg1);
var _local5:Number = Math.sin(-(_arg1));
var _local6:Number = Math.cos(_arg2);
var _local7:Number = Math.sin(-(_arg2));
var _local8:Number = Math.cos(_arg3);
var _local9:Number = Math.sin(-(_arg3));
var _local10:Number = (_local5 * _local7);
var _local11:Number = (_local6 * _local8);
var _local12:Number = (-(_local6) * _local9);
var _local13:Number = _local7;
var _local14:Number = ((_local4 * _local9) + (_local10 * _local8));
var _local15:Number = ((_local4 * _local8) - (_local10 * _local9));
var _local16:Number = (-(_local5) * _local6);
var _local17:Number = ((_local5 * _local9) - ((_local4 * _local8) * _local7));
var _local18:Number = ((_local5 * _local8) + ((_local4 * _local7) * _local9));
var _local19:Number = (_local4 * _local6);
var _local20:Number = a;
var _local21:Number = b;
var _local22:Number = c;
var _local23:Number = d;
var _local24:Number = e;
var _local25:Number = f;
var _local26:Number = g;
var _local27:Number = h;
var _local28:Number = i;
var _local29:Number = j;
var _local30:Number = k;
var _local31:Number = l;
a = (((_local11 * _local20) + (_local12 * _local24)) + (_local13 * _local28));
b = (((_local11 * _local21) + (_local12 * _local25)) + (_local13 * _local29));
c = (((_local11 * _local22) + (_local12 * _local26)) + (_local13 * _local30));
d = (((_local11 * _local23) + (_local12 * _local27)) + (_local13 * _local31));
e = (((_local14 * _local20) + (_local15 * _local24)) + (_local16 * _local28));
f = (((_local14 * _local21) + (_local15 * _local25)) + (_local16 * _local29));
g = (((_local14 * _local22) + (_local15 * _local26)) + (_local16 * _local30));
h = (((_local14 * _local23) + (_local15 * _local27)) + (_local16 * _local31));
i = (((_local17 * _local20) + (_local18 * _local24)) + (_local19 * _local28));
j = (((_local17 * _local21) + (_local18 * _local25)) + (_local19 * _local29));
k = (((_local17 * _local22) + (_local18 * _local26)) + (_local19 * _local30));
l = (((_local17 * _local23) + (_local18 * _local27)) + (_local19 * _local31));
}
public function copy(_arg1:Matrix3D):void{
a = _arg1.a;
b = _arg1.b;
c = _arg1.c;
d = _arg1.d;
e = _arg1.e;
f = _arg1.f;
g = _arg1.g;
h = _arg1.h;
i = _arg1.i;
j = _arg1.j;
k = _arg1.k;
l = _arg1.l;
}
public function fromAxisAngle(_arg1:Point3D, _arg2:Number=0):void{
var _local3:Number = Math.cos(_arg2);
var _local4:Number = Math.sin(_arg2);
var _local5:Number = (1 - _local3);
var _local6:Number = _arg1.x;
var _local7:Number = _arg1.y;
var _local8:Number = _arg1.z;
a = (((_local5 * _local6) * _local6) + _local3);
b = (((_local5 * _local6) * _local7) - (_local8 * _local4));
c = (((_local5 * _local6) * _local8) + (_local7 * _local4));
d = 0;
e = (((_local5 * _local6) * _local7) + (_local8 * _local4));
f = (((_local5 * _local7) * _local7) + _local3);
g = (((_local5 * _local7) * _local8) - (_local6 * _local4));
h = 0;
i = (((_local5 * _local6) * _local8) - (_local7 * _local4));
j = (((_local5 * _local7) * _local8) + (_local6 * _local4));
k = (((_local5 * _local8) * _local8) + _local3);
l = 0;
}
public function getRotations(_arg1:Point3D=null):Point3D{
if (_arg1 == null){
_arg1 = new Point3D();
};
_arg1.y = -(Math.asin(i));
if ((((-0.999 <= i)) && ((i <= 0.999)))){
_arg1.x = Math.atan2(j, k);
_arg1.z = Math.atan2(e, a);
} else {
_arg1.x = 0;
_arg1.z = Math.atan2(-(b), f);
};
return (_arg1);
}
public function inverseScale(_arg1:Number=1, _arg2:Number=1, _arg3:Number=1):void{
var _local4:Number = (1 / _arg1);
var _local5:Number = (1 / _arg2);
var _local6:Number = (1 / _arg3);
a = (a * _local4);
b = (b * _local4);
c = (c * _local4);
d = (d * _local4);
e = (e * _local5);
f = (f * _local5);
g = (g * _local5);
h = (h * _local5);
i = (i * _local6);
j = (j * _local6);
k = (k * _local6);
l = (l * _local6);
}
public function transform(_arg1:Number=0, _arg2:Number=0, _arg3:Number=0, _arg4:Number=0, _arg5:Number=0, _arg6:Number=0, _arg7:Number=1, _arg8:Number=1, _arg9:Number=1):void{
var _local10:Number = Math.cos(_arg4);
var _local11:Number = Math.sin(_arg4);
var _local12:Number = Math.cos(_arg5);
var _local13:Number = Math.sin(_arg5);
var _local14:Number = Math.cos(_arg6);
var _local15:Number = Math.sin(_arg6);
var _local16:Number = (_local14 * _local13);
var _local17:Number = (_local15 * _local13);
var _local18:Number = (_local12 * _arg7);
var _local19:Number = (_local11 * _arg8);
var _local20:Number = (_local10 * _arg8);
var _local21:Number = (_local10 * _arg9);
var _local22:Number = (_local11 * _arg9);
var _local23:Number = (_local14 * _local18);
var _local24:Number = ((_local16 * _local19) - (_local15 * _local20));
var _local25:Number = ((_local16 * _local21) + (_local15 * _local22));
var _local26:Number = _arg1;
var _local27:Number = (_local15 * _local18);
var _local28:Number = ((_local17 * _local19) + (_local14 * _local20));
var _local29:Number = ((_local17 * _local21) - (_local14 * _local22));
var _local30:Number = _arg2;
var _local31:Number = (-(_local13) * _arg7);
var _local32:Number = (_local12 * _local19);
var _local33:Number = (_local12 * _local21);
var _local34:Number = _arg3;
var _local35:Number = a;
var _local36:Number = b;
var _local37:Number = c;
var _local38:Number = d;
var _local39:Number = e;
var _local40:Number = f;
var _local41:Number = g;
var _local42:Number = h;
var _local43:Number = i;
var _local44:Number = j;
var _local45:Number = k;
var _local46:Number = l;
a = (((_local23 * _local35) + (_local24 * _local39)) + (_local25 * _local43));
b = (((_local23 * _local36) + (_local24 * _local40)) + (_local25 * _local44));
c = (((_local23 * _local37) + (_local24 * _local41)) + (_local25 * _local45));
d = ((((_local23 * _local38) + (_local24 * _local42)) + (_local25 * _local46)) + _local26);
e = (((_local27 * _local35) + (_local28 * _local39)) + (_local29 * _local43));
f = (((_local27 * _local36) + (_local28 * _local40)) + (_local29 * _local44));
g = (((_local27 * _local37) + (_local28 * _local41)) + (_local29 * _local45));
h = ((((_local27 * _local38) + (_local28 * _local42)) + (_local29 * _local46)) + _local30);
i = (((_local31 * _local35) + (_local32 * _local39)) + (_local33 * _local43));
j = (((_local31 * _local36) + (_local32 * _local40)) + (_local33 * _local44));
k = (((_local31 * _local37) + (_local32 * _local41)) + (_local33 * _local45));
l = ((((_local31 * _local38) + (_local32 * _local42)) + (_local33 * _local46)) + _local34);
}
public function translateLocal(_arg1:Number=0, _arg2:Number=0, _arg3:Number=0):void{
d = (d + (((a * _arg1) + (b * _arg2)) + (c * _arg3)));
h = (h + (((e * _arg1) + (f * _arg2)) + (g * _arg3)));
l = (l + (((i * _arg1) + (j * _arg2)) + (k * _arg3)));
}
public function inverseTranslate(_arg1:Number=0, _arg2:Number=0, _arg3:Number=0):void{
d = (d - _arg1);
h = (h - _arg2);
l = (l - _arg3);
}
public function combine(_arg1:Matrix3D):void{
var _local2:Number = a;
var _local3:Number = b;
var _local4:Number = c;
var _local5:Number = d;
var _local6:Number = e;
var _local7:Number = f;
var _local8:Number = g;
var _local9:Number = h;
var _local10:Number = i;
var _local11:Number = j;
var _local12:Number = k;
var _local13:Number = l;
a = (((_arg1.a * _local2) + (_arg1.b * _local6)) + (_arg1.c * _local10));
b = (((_arg1.a * _local3) + (_arg1.b * _local7)) + (_arg1.c * _local11));
c = (((_arg1.a * _local4) + (_arg1.b * _local8)) + (_arg1.c * _local12));
d = ((((_arg1.a * _local5) + (_arg1.b * _local9)) + (_arg1.c * _local13)) + _arg1.d);
e = (((_arg1.e * _local2) + (_arg1.f * _local6)) + (_arg1.g * _local10));
f = (((_arg1.e * _local3) + (_arg1.f * _local7)) + (_arg1.g * _local11));
g = (((_arg1.e * _local4) + (_arg1.f * _local8)) + (_arg1.g * _local12));
h = ((((_arg1.e * _local5) + (_arg1.f * _local9)) + (_arg1.g * _local13)) + _arg1.h);
i = (((_arg1.i * _local2) + (_arg1.j * _local6)) + (_arg1.k * _local10));
j = (((_arg1.i * _local3) + (_arg1.j * _local7)) + (_arg1.k * _local11));
k = (((_arg1.i * _local4) + (_arg1.j * _local8)) + (_arg1.k * _local12));
l = ((((_arg1.i * _local5) + (_arg1.j * _local9)) + (_arg1.k * _local13)) + _arg1.l);
}
public static function inverseTranslationMatrix(_arg1:Number=0, _arg2:Number=0, _arg3:Number=0):Matrix3D{
return (new Matrix3D(1, 0, 0, -(_arg1), 0, 1, 0, -(_arg2), 0, 0, 1, -(_arg3)));
}
public static function translationMatrix(_arg1:Number=0, _arg2:Number=0, _arg3:Number=0):Matrix3D{
return (new Matrix3D(1, 0, 0, _arg1, 0, 1, 0, _arg2, 0, 0, 1, _arg3));
}
public static function axisAngleToMatrix(_arg1:Point3D, _arg2:Number=0):Matrix3D{
var _local3:Number = Math.cos(_arg2);
var _local4:Number = Math.sin(_arg2);
var _local5:Number = (1 - _local3);
var _local6:Number = _arg1.x;
var _local7:Number = _arg1.y;
var _local8:Number = _arg1.z;
var _local9:Matrix3D = new Matrix3D((((_local5 * _local6) * _local6) + _local3), (((_local5 * _local6) * _local7) - (_local8 * _local4)), (((_local5 * _local6) * _local8) + (_local7 * _local4)), 0, (((_local5 * _local6) * _local7) + (_local8 * _local4)), (((_local5 * _local7) * _local7) + _local3), (((_local5 * _local7) * _local8) - (_local6 * _local4)), 0, (((_local5 * _local6) * _local8) - (_local7 * _local4)), (((_local5 * _local7) * _local8) + (_local6 * _local4)), (((_local5 * _local8) * _local8) + _local3), 0);
return (_local9);
}
public static function inverseRotationMatrix(_arg1:Number=0, _arg2:Number=0, _arg3:Number=0):Matrix3D{
var _local4:Number = Math.cos(_arg1);
var _local5:Number = Math.sin(-(_arg1));
var _local6:Number = Math.cos(_arg2);
var _local7:Number = Math.sin(-(_arg2));
var _local8:Number = Math.cos(_arg3);
var _local9:Number = Math.sin(-(_arg3));
var _local10:Number = (_local5 * _local7);
return (new Matrix3D((_local6 * _local8), (-(_local6) * _local9), _local7, 0, ((_local4 * _local9) + (_local10 * _local8)), ((_local4 * _local8) - (_local10 * _local9)), (-(_local5) * _local6), 0, ((_local5 * _local9) - ((_local4 * _local8) * _local7)), ((_local5 * _local8) + ((_local4 * _local7) * _local9)), (_local4 * _local6), 0));
}
public static function inverseTransformationMatrix(_arg1:Number=0, _arg2:Number=0, _arg3:Number=0, _arg4:Number=0, _arg5:Number=0, _arg6:Number=0, _arg7:Number=1, _arg8:Number=1, _arg9:Number=1):Matrix3D{
var _local10:Number = Math.cos(-(_arg4));
var _local11:Number = Math.sin(-(_arg4));
var _local12:Number = Math.cos(-(_arg5));
var _local13:Number = Math.sin(-(_arg5));
var _local14:Number = Math.cos(-(_arg6));
var _local15:Number = Math.sin(-(_arg6));
var _local16:Number = (_local11 * _local13);
var _local17:Number = (1 / _arg7);
var _local18:Number = (1 / _arg8);
var _local19:Number = (1 / _arg9);
var _local20:Number = (_local12 * _local17);
var _local21:Number = (_local10 * _local18);
var _local22:Number = (_local11 * _local19);
var _local23:Number = (_local10 * _local19);
var _local24:Number = (_local14 * _local20);
var _local25:Number = (-(_local15) * _local20);
var _local26:Number = (_local13 * _local17);
var _local27:Number = ((_local15 * _local21) + ((_local16 * _local14) * _local18));
var _local28:Number = ((_local14 * _local21) - ((_local16 * _local15) * _local18));
var _local29:Number = ((-(_local11) * _local12) * _local18);
var _local30:Number = ((_local15 * _local22) - ((_local14 * _local13) * _local23));
var _local31:Number = ((_local14 * _local22) + ((_local13 * _local15) * _local23));
var _local32:Number = (_local12 * _local23);
return (new Matrix3D(_local24, _local25, _local26, -((((_local24 * _arg1) + (_local25 * _arg2)) + (_local26 * _arg3))), _local27, _local28, _local29, -((((_local27 * _arg1) + (_local28 * _arg2)) + (_local29 * _arg3))), _local30, _local31, _local32, -((((_local30 * _arg1) + (_local31 * _arg2)) + (_local32 * _arg3)))));
}
public static function inverseMatrix(_arg1:Matrix3D):Matrix3D{
var _local2:Number = (((((((-(_arg1.c) * _arg1.f) * _arg1.i) + ((_arg1.b * _arg1.g) * _arg1.i)) + ((_arg1.c * _arg1.e) * _arg1.j)) - ((_arg1.a * _arg1.g) * _arg1.j)) - ((_arg1.b * _arg1.e) * _arg1.k)) + ((_arg1.a * _arg1.f) * _arg1.k));
var _local3:Number = (((-(_arg1.g) * _arg1.j) + (_arg1.f * _arg1.k)) / _local2);
var _local4:Number = (((_arg1.c * _arg1.j) - (_arg1.b * _arg1.k)) / _local2);
var _local5:Number = (((-(_arg1.c) * _arg1.f) + (_arg1.b * _arg1.g)) / _local2);
var _local6:Number = ((((((((_arg1.d * _arg1.g) * _arg1.j) - ((_arg1.c * _arg1.h) * _arg1.j)) - ((_arg1.d * _arg1.f) * _arg1.k)) + ((_arg1.b * _arg1.h) * _arg1.k)) + ((_arg1.c * _arg1.f) * _arg1.l)) - ((_arg1.b * _arg1.g) * _arg1.l)) / _local2);
var _local7:Number = (((_arg1.g * _arg1.i) - (_arg1.e * _arg1.k)) / _local2);
var _local8:Number = (((-(_arg1.c) * _arg1.i) + (_arg1.a * _arg1.k)) / _local2);
var _local9:Number = (((_arg1.c * _arg1.e) - (_arg1.a * _arg1.g)) / _local2);
var _local10:Number = ((((((((_arg1.c * _arg1.h) * _arg1.i) - ((_arg1.d * _arg1.g) * _arg1.i)) + ((_arg1.d * _arg1.e) * _arg1.k)) - ((_arg1.a * _arg1.h) * _arg1.k)) - ((_arg1.c * _arg1.e) * _arg1.l)) + ((_arg1.a * _arg1.g) * _arg1.l)) / _local2);
var _local11:Number = (((-(_arg1.f) * _arg1.i) + (_arg1.e * _arg1.j)) / _local2);
var _local12:Number = (((_arg1.b * _arg1.i) - (_arg1.a * _arg1.j)) / _local2);
var _local13:Number = (((-(_arg1.b) * _arg1.e) + (_arg1.a * _arg1.f)) / _local2);
var _local14:Number = ((((((((_arg1.d * _arg1.f) * _arg1.i) - ((_arg1.b * _arg1.h) * _arg1.i)) - ((_arg1.d * _arg1.e) * _arg1.j)) + ((_arg1.a * _arg1.h) * _arg1.j)) + ((_arg1.b * _arg1.e) * _arg1.l)) - ((_arg1.a * _arg1.f) * _arg1.l)) / _local2);
return (new Matrix3D(_local3, _local4, _local5, _local6, _local7, _local8, _local9, _local10, _local11, _local12, _local13, _local14));
}
public static function inverseScaleMatrix(_arg1:Number=1, _arg2:Number=1, _arg3:Number=1):Matrix3D{
return (new Matrix3D((1 / _arg1), 0, 0, 0, 0, (1 / _arg2), 0, 0, 0, 0, (1 / _arg3), 0));
}
public static function scaleMatrix(_arg1:Number=1, _arg2:Number=1, _arg3:Number=1):Matrix3D{
return (new Matrix3D(_arg1, 0, 0, 0, 0, _arg2, 0, 0, 0, 0, _arg3, 0));
}
public static function transformationMatrix(_arg1:Number=0, _arg2:Number=0, _arg3:Number=0, _arg4:Number=0, _arg5:Number=0, _arg6:Number=0, _arg7:Number=1, _arg8:Number=1, _arg9:Number=1):Matrix3D{
var _local10:Number = Math.cos(_arg4);
var _local11:Number = Math.sin(_arg4);
var _local12:Number = Math.cos(_arg5);
var _local13:Number = Math.sin(_arg5);
var _local14:Number = Math.cos(_arg6);
var _local15:Number = Math.sin(_arg6);
var _local16:Number = (_local14 * _local13);
var _local17:Number = (_local15 * _local13);
var _local18:Number = (_local12 * _arg7);
var _local19:Number = (_local11 * _arg8);
var _local20:Number = (_local10 * _arg8);
var _local21:Number = (_local10 * _arg9);
var _local22:Number = (_local11 * _arg9);
return (new Matrix3D((_local14 * _local18), ((_local16 * _local19) - (_local15 * _local20)), ((_local16 * _local21) + (_local15 * _local22)), _arg1, (_local15 * _local18), ((_local17 * _local19) + (_local14 * _local20)), ((_local17 * _local21) - (_local14 * _local22)), _arg2, (-(_local13) * _arg7), (_local12 * _local19), (_local12 * _local21), _arg3));
}
public static function product(_arg1:Matrix3D, _arg2:Matrix3D):Matrix3D{
return (new Matrix3D((((_arg1.a * _arg2.a) + (_arg1.b * _arg2.e)) + (_arg1.c * _arg2.i)), (((_arg1.a * _arg2.b) + (_arg1.b * _arg2.f)) + (_arg1.c * _arg2.j)), (((_arg1.a * _arg2.c) + (_arg1.b * _arg2.g)) + (_arg1.c * _arg2.k)), ((((_arg1.a * _arg2.d) + (_arg1.b * _arg2.h)) + (_arg1.c * _arg2.l)) + _arg1.d), (((_arg1.e * _arg2.a) + (_arg1.f * _arg2.e)) + (_arg1.g * _arg2.i)), (((_arg1.e * _arg2.b) + (_arg1.f * _arg2.f)) + (_arg1.g * _arg2.j)), (((_arg1.e * _arg2.c) + (_arg1.f * _arg2.g)) + (_arg1.g * _arg2.k)), ((((_arg1.e * _arg2.d) + (_arg1.f * _arg2.h)) + (_arg1.g * _arg2.l)) + _arg1.h), (((_arg1.i * _arg2.a) + (_arg1.j * _arg2.e)) + (_arg1.k * _arg2.i)), (((_arg1.i * _arg2.b) + (_arg1.j * _arg2.f)) + (_arg1.k * _arg2.j)), (((_arg1.i * _arg2.c) + (_arg1.j * _arg2.g)) + (_arg1.k * _arg2.k)), ((((_arg1.i * _arg2.d) + (_arg1.j * _arg2.h)) + (_arg1.k * _arg2.l)) + _arg1.l)));
}
public static function rotationMatrix(_arg1:Number=0, _arg2:Number=0, _arg3:Number=0):Matrix3D{
var _local4:Number = Math.cos(_arg1);
var _local5:Number = Math.sin(_arg1);
var _local6:Number = Math.cos(_arg2);
var _local7:Number = Math.sin(_arg2);
var _local8:Number = Math.cos(_arg3);
var _local9:Number = Math.sin(_arg3);
var _local10:Number = (_local8 * _local7);
var _local11:Number = (_local9 * _local7);
return (new Matrix3D((_local8 * _local6), ((_local10 * _local5) - (_local9 * _local4)), ((_local10 * _local4) + (_local9 * _local5)), 0, (_local9 * _local6), ((_local11 * _local5) + (_local8 * _local4)), ((_local11 * _local4) - (_local8 * _local5)), 0, -(_local7), (_local6 * _local5), (_local6 * _local4), 0));
}
}
}//package alternativa.types
Section 51
//Point3D (alternativa.types.Point3D)
package alternativa.types {
import flash.geom.*;
public final class Point3D {
public var x:Number;
public var y:Number;
public var z:Number;
public function Point3D(_arg1:Number=0, _arg2:Number=0, _arg3:Number=0){
this.x = _arg1;
this.y = _arg2;
this.z = _arg3;
}
public function floor():void{
x = Math.floor(x);
y = Math.floor(y);
z = Math.floor(z);
}
public function add(_arg1:Point3D):void{
x = (x + _arg1.x);
y = (y + _arg1.y);
z = (z + _arg1.z);
}
public function toString():String{
return ((((((("[Point3D X: " + x.toFixed(3)) + " Y:") + y.toFixed(3)) + " Z:") + z.toFixed(3)) + "]"));
}
public function multiply(_arg1:Number):void{
x = (x * _arg1);
y = (y * _arg1);
z = (z * _arg1);
}
public function transform(_arg1:Matrix3D):void{
var _local2:Number = x;
var _local3:Number = y;
var _local4:Number = z;
x = ((((_arg1.a * _local2) + (_arg1.b * _local3)) + (_arg1.c * _local4)) + _arg1.d);
y = ((((_arg1.e * _local2) + (_arg1.f * _local3)) + (_arg1.g * _local4)) + _arg1.h);
z = ((((_arg1.i * _local2) + (_arg1.j * _local3)) + (_arg1.k * _local4)) + _arg1.l);
}
public function get length():Number{
return (Math.sqrt((((x * x) + (y * y)) + (z * z))));
}
public function clone():Point3D{
return (new Point3D(x, y, z));
}
public function set length(_arg1:Number):void{
var _local2:Number;
if (((((!((x == 0))) || (!((y == 0))))) || (!((z == 0))))){
_local2 = (_arg1 / length);
x = (x * _local2);
y = (y * _local2);
z = (z * _local2);
} else {
z = _arg1;
};
}
public function normalize():void{
var _local1:Number;
if (((((!((x == 0))) || (!((y == 0))))) || (!((z == 0))))){
_local1 = Math.sqrt((((x * x) + (y * y)) + (z * z)));
x = (x / _local1);
y = (y / _local1);
z = (z / _local1);
} else {
z = 1;
};
}
public function get lengthSqr():Number{
return ((((x * x) + (y * y)) + (z * z)));
}
public function reset():void{
x = 0;
y = 0;
z = 0;
}
public function copy(_arg1:Point3D):void{
x = _arg1.x;
y = _arg1.y;
z = _arg1.z;
}
public function invert():void{
x = -(x);
y = -(y);
z = -(z);
}
public function subtract(_arg1:Point3D):void{
x = (x - _arg1.x);
y = (y - _arg1.y);
z = (z - _arg1.z);
}
public function toPoint():Point{
return (new Point(x, y));
}
public function round():void{
x = Math.round(x);
y = Math.round(y);
z = Math.round(z);
}
public function equals(_arg1:Point3D, _arg2:Number=0):Boolean{
return (((((((((((((x - _arg1.x) <= _arg2)) && (((x - _arg1.x) >= -(_arg2))))) && (((y - _arg1.y) <= _arg2)))) && (((y - _arg1.y) >= -(_arg2))))) && (((z - _arg1.z) <= _arg2)))) && (((z - _arg1.z) >= -(_arg2)))));
}
public static function cross(_arg1:Point3D, _arg2:Point3D):Point3D{
return (new Point3D(((_arg1.y * _arg2.z) - (_arg1.z * _arg2.y)), ((_arg1.z * _arg2.x) - (_arg1.x * _arg2.z)), ((_arg1.x * _arg2.y) - (_arg1.y * _arg2.x))));
}
public static function cross2D(_arg1:Point3D, _arg2:Point3D):Number{
return (((_arg1.x * _arg2.y) - (_arg1.y * _arg2.x)));
}
public static function angle(_arg1:Point3D, _arg2:Point3D):Number{
var _local3:Number = Math.sqrt(((((_arg1.x * _arg1.x) + (_arg1.y * _arg1.y)) + (_arg1.z * _arg1.z)) * (((_arg2.x * _arg2.x) + (_arg2.y * _arg2.y)) + (_arg2.z * _arg2.z))));
var _local4:Number = ((_local3)!=0) ? (dot(_arg1, _arg2) / _local3) : 1;
return (Math.acos(_local4));
}
public static function average(_arg1:Point3D, _arg2:Point3D=null, _arg3:Point3D=null, _arg4:Point3D=null):Point3D{
if (_arg2 == null){
return (_arg1.clone());
};
if (_arg3 == null){
return (new Point3D(((_arg1.x + _arg2.x) * 0.5), ((_arg1.y + _arg2.y) * 0.5), ((_arg1.z + _arg2.z) * 0.5)));
};
if (_arg4 == null){
return (new Point3D((((_arg1.x + _arg2.x) + _arg3.x) / 3), (((_arg1.y + _arg2.y) + _arg3.y) / 3), (((_arg1.z + _arg2.z) + _arg3.z) / 3)));
};
return (new Point3D(((((_arg1.x + _arg2.x) + _arg3.x) + _arg4.x) * 0.25), ((((_arg1.y + _arg2.y) + _arg3.y) + _arg4.y) * 0.25), ((((_arg1.z + _arg2.z) + _arg3.z) + _arg4.z) / 0.25)));
}
public static function random(_arg1:Number=0, _arg2:Number=0, _arg3:Number=0, _arg4:Number=0, _arg5:Number=0, _arg6:Number=0):Point3D{
return (new Point3D((_arg1 + (Math.random() * (_arg2 - _arg1))), (_arg3 + (Math.random() * (_arg4 - _arg3))), (_arg5 + (Math.random() * (_arg6 - _arg5)))));
}
public static function interpolate(_arg1:Point3D, _arg2:Point3D, _arg3:Number=0.5):Point3D{
return (new Point3D((_arg1.x + ((_arg2.x - _arg1.x) * _arg3)), (_arg1.y + ((_arg2.y - _arg1.y) * _arg3)), (_arg1.z + ((_arg2.z - _arg1.z) * _arg3))));
}
public static function dot(_arg1:Point3D, _arg2:Point3D):Number{
return ((((_arg1.x * _arg2.x) + (_arg1.y * _arg2.y)) + (_arg1.z * _arg2.z)));
}
public static function sum(_arg1:Point3D, _arg2:Point3D):Point3D{
return (new Point3D((_arg1.x + _arg2.x), (_arg1.y + _arg2.y), (_arg1.z + _arg2.z)));
}
public static function dot2D(_arg1:Point3D, _arg2:Point3D):Number{
return (((_arg1.x * _arg2.x) + (_arg1.y * _arg2.y)));
}
public static function difference(_arg1:Point3D, _arg2:Point3D):Point3D{
return (new Point3D((_arg1.x - _arg2.x), (_arg1.y - _arg2.y), (_arg1.z - _arg2.z)));
}
public static function angleFast(_arg1:Point3D, _arg2:Point3D):Number{
var _local3:Number = dot(_arg1, _arg2);
if (Math.abs(_local3) > 1){
_local3 = ((_local3)>0) ? 1 : -1;
};
return (Math.acos(_local3));
}
}
}//package alternativa.types
Section 52
//Set (alternativa.types.Set)
package alternativa.types {
import flash.utils.*;
public dynamic final class Set extends Dictionary {
private var weakKeys:Boolean;
public function Set(_arg1:Boolean=false){
this.weakKeys = _arg1;
super(_arg1);
}
public function add(_arg1):void{
this[_arg1] = true;
}
public function isEmpty():Boolean{
var _local1:*;
for (_local1 in this) {
return (false);
};
return (true);
}
public function remove(_arg1):void{
delete this[_arg1];
}
public function get length():uint{
var _local2:*;
var _local1:uint;
for (_local2 in this) {
_local1++;
};
return (_local1);
}
public function take(){
var _local1:*;
for (_local1 in this) {
delete this[_local1];
return (_local1);
};
return (null);
}
public function clear():void{
var _local1:*;
for (_local1 in this) {
delete this[_local1];
};
}
public function any(){
var _local3:*;
var _local1:uint;
var _local2:uint = (Math.random() * length);
for (_local3 in this) {
if (_local1 == _local2){
return (_local3);
};
_local1++;
};
return (null);
}
public function isSingle():Boolean{
var _local2:*;
var _local1:Boolean;
for (_local2 in this) {
if (_local1){
return (false);
};
_local1 = true;
};
return (_local1);
}
public function concat(_arg1:Set):void{
var _local2:*;
for (_local2 in _arg1) {
this[_local2] = true;
};
}
public function subtract(_arg1:Set):void{
var _local2:*;
for (_local2 in _arg1) {
delete this[_local2];
};
}
public function toString():String{
var _local3:*;
var _local1:int;
var _local2 = "";
for (_local3 in this) {
_local2 = (_local2 + ("," + _local3));
_local1++;
};
return (((("[Set length:" + _local1) + ((_local1 > 0)) ? (" " + _local2.substring(1)) : "") + "]"));
}
public function has(_arg1):Boolean{
return (this[_arg1]);
}
public function peek(){
var _local1:*;
for (_local1 in this) {
return (_local1);
};
return (null);
}
public function clone():Set{
var _local2:*;
var _local1:Set = new Set(weakKeys);
for (_local2 in this) {
_local1[_local2] = true;
};
return (_local1);
}
public function toArray():Array{
var _local2:*;
var _local1:Array = new Array();
for (_local2 in this) {
_local1.push(_local2);
};
return (_local1);
}
public function intersect(_arg1:Set):void{
var _local3:*;
var _local2:Set = new Set(true);
for (_local3 in this) {
if (_arg1[_local3]){
_local2[_local3] = true;
};
delete this[_local3];
};
concat(_local2);
}
public static function intersection(_arg1:Set, _arg2:Set, _arg3:Boolean=false):Set{
var _local5:*;
var _local4:Set = new Set(_arg3);
for (_local5 in _arg1) {
if (_arg2[_local5]){
_local4[_local5] = true;
};
};
return (_local4);
}
public static function createFromArray(_arg1:Array, _arg2:Boolean=false):Set{
var _local4:*;
var _local3:Set = new Set(_arg2);
for each (_local4 in _arg1) {
_local3[_local4] = true;
};
return (_local3);
}
public static function difference(_arg1:Set, _arg2:Set, _arg3:Boolean=false):Set{
var _local5:*;
var _local4:Set = new Set(_arg3);
for (_local5 in _arg1) {
if (!_arg2[_local5]){
_local4[_local5] = true;
};
};
return (_local4);
}
public static function union(_arg1:Set, _arg2:Set, _arg3:Boolean=false):Set{
var _local5:*;
var _local4:Set = new Set(_arg3);
for (_local5 in _arg1) {
_local4[_local5] = true;
};
for (_local5 in _arg2) {
_local4[_local5] = true;
};
return (_local4);
}
}
}//package alternativa.types
Section 53
//Texture (alternativa.types.Texture)
package alternativa.types {
import flash.display.*;
public class Texture {
alternativatypes var _height:uint;
alternativatypes var _width:uint;
alternativatypes var _name:String;
alternativatypes var _bitmapData:BitmapData;
public function Texture(_arg1:BitmapData, _arg2:String=null){
if (_arg1 == null){
throw (new Error("Cannot create texture from null bitmapData"));
};
_bitmapData = _arg1;
_width = _arg1.width;
_height = _arg1.height;
_name = _arg2;
}
public function get name():String{
return (_name);
}
public function get width():uint{
return (_width);
}
public function get height():uint{
return (_height);
}
public function get bitmapData():BitmapData{
return (_bitmapData);
}
public function toString():String{
return ((((((("[Texture " + ((_name)!=null) ? _name : "") + " ") + _width) + "x") + _height) + "]"));
}
}
}//package alternativa.types
Section 54
//BitmapUtils (alternativa.utils.BitmapUtils)
package alternativa.utils {
import flash.geom.*;
import flash.display.*;
public class BitmapUtils {
public static function getNonTransparentRect(_arg1:BitmapData):Rectangle{
return ((_arg1.transparent) ? _arg1.getColorBoundsRect(4278190080, 0, false) : _arg1.rect);
}
public static function getFragment(_arg1:BitmapData, _arg2:Rectangle):BitmapData{
var _local3:BitmapData = new BitmapData(_arg2.width, _arg2.height, _arg1.transparent, 0);
_local3.copyPixels(_arg1, _arg2, new Point());
return (_local3);
}
public static function mergeBitmapAlpha(_arg1:BitmapData, _arg2:BitmapData, _arg3:Boolean=false):BitmapData{
var _local4:BitmapData = new BitmapData(_arg1.width, _arg1.height);
_local4.copyPixels(_arg1, _arg1.rect, new Point());
_local4.copyChannel(_arg2, _arg2.rect, new Point(), BitmapDataChannel.RED, BitmapDataChannel.ALPHA);
if (_arg3){
_arg1.dispose();
_arg2.dispose();
};
return (_local4);
}
}
}//package alternativa.utils
Section 55
//KeyboardUtils (alternativa.utils.KeyboardUtils)
package alternativa.utils {
import flash.utils.*;
public class KeyboardUtils {
public static const F13:uint = 124;
public static const F14:uint = 125;
public static const LEFT:uint = 37;
public static const RIGHTBRACKET:uint = 221;
public static const EQUAL:uint = 187;
public static const F15:uint = 126;
public static const COMMAND:uint = 15;
public static const CONTROL:uint = 17;
public static const NUMPAD_DECIMAL:uint = 110;
public static const A:uint = 65;
public static const B:uint = 66;
public static const C:uint = 67;
public static const D:uint = 68;
public static const E:uint = 69;
public static const F:uint = 70;
public static const G:uint = 71;
public static const H:uint = 72;
public static const I:uint = 73;
public static const J:uint = 74;
public static const K:uint = 75;
public static const L:uint = 76;
public static const M:uint = 77;
public static const N:uint = 78;
public static const O:uint = 79;
public static const P:uint = 80;
public static const Q:uint = 81;
public static const R:uint = 82;
public static const S:uint = 83;
public static const T:uint = 84;
public static const U:uint = 85;
public static const V:uint = 86;
public static const W:uint = 87;
public static const X:uint = 88;
public static const Y:uint = 89;
public static const Z:uint = 90;
public static const QUOTE:uint = 222;
public static const SLASH:uint = 191;
public static const NUMPAD_ENTER:uint = 108;
public static const BACKSPACE:uint = 8;
public static const PAGE_DOWN:uint = 34;
public static const SHIFT:uint = 16;
public static const PAGE_UP:uint = 33;
public static const MINUS:uint = 189;
public static const NUMPAD:uint = 21;
public static const TAB:uint = 9;
public static const SEMICOLON:uint = 186;
public static const LEFTBRACKET:uint = 219;
public static const ESCAPE:uint = 27;
public static const F3:uint = 114;
public static const COMMA:uint = 188;
public static const F5:uint = 116;
public static const INSERT:uint = 45;
public static const END:uint = 35;
public static const NUMBER_2:uint = 50;
public static const NUMBER_3:uint = 51;
public static const NUMBER_5:uint = 53;
public static const NUMBER_6:uint = 54;
public static const PERIOD:uint = 190;
public static const NUMBER_1:uint = 49;
public static const DELETE:uint = 46;
public static const NUMPAD_6:uint = 102;
public static const NUMPAD_1:uint = 97;
public static const NUMPAD_2:uint = 98;
public static const NUMBER_7:uint = 55;
public static const NUMBER_0:uint = 48;
public static const NUMBER_9:uint = 57;
public static const NUMBER_4:uint = 52;
public static const NUMPAD_9:uint = 105;
public static const DOWN:uint = 40;
public static const NUMPAD_3:uint = 99;
public static const NUMBER_8:uint = 56;
public static const NUMPAD_5:uint = 101;
public static const F7:uint = 118;
public static const NUMPAD_7:uint = 103;
public static const BACKQUOTE:uint = 192;
public static const BACKSLASH:uint = 220;
public static const NUMPAD_DIVIDE:uint = 111;
public static const NUMPAD_4:uint = 100;
public static const F4:uint = 115;
public static const NUMPAD_MULTIPLY:uint = 106;
public static const NUMPAD_8:uint = 104;
public static const HOME:uint = 36;
public static const NUMPAD_0:uint = 96;
public static const CAPS_LOCK:uint = 20;
public static const NUMPAD_ADD:uint = 107;
public static const F1:uint = 112;
public static const SPACE:uint = 32;
public static const F12:uint = 123;
public static const NUMPAD_SUBTRACT:uint = 109;
public static const F6:uint = 117;
public static const F8:uint = 119;
public static const F11:uint = 122;
public static const ENTER:uint = 13;
public static const F2:uint = 113;
public static const F10:uint = 121;
public static const F9:uint = 120;
public static const RIGHT:uint = 39;
public static const UP:uint = 38;
private static var keyCodeStringRepresentation:Dictionary;
private static function fillKeyCodes():void{
keyCodeStringRepresentation = new Dictionary(true);
keyCodeStringRepresentation[A] = "A";
keyCodeStringRepresentation[B] = "B";
keyCodeStringRepresentation[C] = "C";
keyCodeStringRepresentation[D] = "D";
keyCodeStringRepresentation[E] = "E";
keyCodeStringRepresentation[F] = "F";
keyCodeStringRepresentation[G] = "G";
keyCodeStringRepresentation[H] = "H";
keyCodeStringRepresentation[I] = "I";
keyCodeStringRepresentation[J] = "J";
keyCodeStringRepresentation[K] = "K";
keyCodeStringRepresentation[L] = "L";
keyCodeStringRepresentation[M] = "M";
keyCodeStringRepresentation[N] = "N";
keyCodeStringRepresentation[O] = "O";
keyCodeStringRepresentation[P] = "P";
keyCodeStringRepresentation[Q] = "Q";
keyCodeStringRepresentation[R] = "R";
keyCodeStringRepresentation[S] = "S";
keyCodeStringRepresentation[T] = "T";
keyCodeStringRepresentation[U] = "U";
keyCodeStringRepresentation[V] = "V";
keyCodeStringRepresentation[W] = "W";
keyCodeStringRepresentation[X] = "X";
keyCodeStringRepresentation[Y] = "Y";
keyCodeStringRepresentation[Z] = "Z";
keyCodeStringRepresentation[SPACE] = "SPACE";
keyCodeStringRepresentation[SEMICOLON] = "SEMICOLON";
keyCodeStringRepresentation[COMMA] = "COMMA";
keyCodeStringRepresentation[PERIOD] = "PERIOD";
keyCodeStringRepresentation[SLASH] = "SLASH";
keyCodeStringRepresentation[BACKQUOTE] = "BACK QUOTE";
keyCodeStringRepresentation[LEFTBRACKET] = "LEFT BRACKET";
keyCodeStringRepresentation[BACKSLASH] = "BACK SLASH";
keyCodeStringRepresentation[RIGHTBRACKET] = "RIGHT BRACKET";
keyCodeStringRepresentation[QUOTE] = "'";
keyCodeStringRepresentation[BACKSPACE] = "BACKSPACE";
keyCodeStringRepresentation[TAB] = "TAB";
keyCodeStringRepresentation[PAGE_UP] = "PAGE UP";
keyCodeStringRepresentation[PAGE_DOWN] = "PAGE DOWN";
keyCodeStringRepresentation[END] = "END";
keyCodeStringRepresentation[HOME] = "HOME";
keyCodeStringRepresentation[INSERT] = "INSERT";
keyCodeStringRepresentation[DELETE] = "DELETE";
keyCodeStringRepresentation[NUMBER_0] = "0";
keyCodeStringRepresentation[NUMBER_1] = "1";
keyCodeStringRepresentation[NUMBER_2] = "2";
keyCodeStringRepresentation[NUMBER_3] = "3";
keyCodeStringRepresentation[NUMBER_4] = "4";
keyCodeStringRepresentation[NUMBER_5] = "5";
keyCodeStringRepresentation[NUMBER_6] = "6";
keyCodeStringRepresentation[NUMBER_7] = "7";
keyCodeStringRepresentation[NUMBER_8] = "8";
keyCodeStringRepresentation[NUMBER_9] = "9";
keyCodeStringRepresentation[EQUAL] = "EQUAL";
keyCodeStringRepresentation[MINUS] = "MINUS";
keyCodeStringRepresentation[NUMPAD] = "NUM LOCK";
keyCodeStringRepresentation[NUMPAD_0] = "0";
keyCodeStringRepresentation[NUMPAD_1] = "1";
keyCodeStringRepresentation[NUMPAD_2] = "2";
keyCodeStringRepresentation[NUMPAD_3] = "3";
keyCodeStringRepresentation[NUMPAD_4] = "4";
keyCodeStringRepresentation[NUMPAD_5] = "5";
keyCodeStringRepresentation[NUMPAD_6] = "6";
keyCodeStringRepresentation[NUMPAD_7] = "7";
keyCodeStringRepresentation[NUMPAD_8] = "8";
keyCodeStringRepresentation[NUMPAD_9] = "9";
keyCodeStringRepresentation[NUMPAD_ADD] = "NUM+";
keyCodeStringRepresentation[NUMPAD_DECIMAL] = "NUM DECIMAL";
keyCodeStringRepresentation[NUMPAD_DIVIDE] = "NUM DIVIDE";
keyCodeStringRepresentation[NUMPAD_ENTER] = "NUMPAD ENTER";
keyCodeStringRepresentation[NUMPAD_MULTIPLY] = "NUM MULTIPLY";
keyCodeStringRepresentation[NUMPAD_SUBTRACT] = "NUM SUBTRACT";
keyCodeStringRepresentation[ENTER] = "ENTER";
keyCodeStringRepresentation[COMMAND] = "COMMAND";
keyCodeStringRepresentation[SHIFT] = "SHIFT";
keyCodeStringRepresentation[CONTROL] = "CONTROL";
keyCodeStringRepresentation[CAPS_LOCK] = "CAPS LOCK";
keyCodeStringRepresentation[ESCAPE] = "ESCAPE";
keyCodeStringRepresentation[LEFT] = "LEFT";
keyCodeStringRepresentation[UP] = "UP";
keyCodeStringRepresentation[RIGHT] = "RIGHT";
keyCodeStringRepresentation[DOWN] = "DOWN";
keyCodeStringRepresentation[F1] = "F1";
keyCodeStringRepresentation[F2] = "F2";
keyCodeStringRepresentation[F3] = "F3";
keyCodeStringRepresentation[F4] = "F4";
keyCodeStringRepresentation[F5] = "F5";
keyCodeStringRepresentation[F6] = "F6";
keyCodeStringRepresentation[F7] = "F7";
keyCodeStringRepresentation[F8] = "F8";
keyCodeStringRepresentation[F9] = "F9";
keyCodeStringRepresentation[F10] = "F10";
keyCodeStringRepresentation[F11] = "F11";
keyCodeStringRepresentation[F12] = "F12";
keyCodeStringRepresentation[F13] = "F13";
keyCodeStringRepresentation[F14] = "F14";
keyCodeStringRepresentation[F15] = "F15";
}
public static function getKeyCodeStringRepresentation(_arg1:uint):String{
if (keyCodeStringRepresentation == null){
fillKeyCodes();
};
return (keyCodeStringRepresentation[_arg1]);
}
}
}//package alternativa.utils
Section 56
//MathUtils (alternativa.utils.MathUtils)
package alternativa.utils {
import flash.geom.*;
public final class MathUtils {
public static const DEG30:Number = (Math.PI / 6);
public static const DEG10:Number = (Math.PI / 18);
public static const DEG360:Number = (Math.PI + Math.PI);
public static const DEG1:Number = toRad;
public static const DEG5:Number = (Math.PI / 36);
private static const toDeg:Number = (180 / Math.PI);
private static const toRad:Number = (Math.PI / 180);
public static const DEG180:Number = Math.PI;
public static const DEG60:Number = (Math.PI / 3);
public static const DEG45:Number = (Math.PI / 4);
public static const DEG90:Number = (Math.PI / 2);
public static function vectorCross(_arg1:Point, _arg2:Point):Number{
return (((_arg1.x * _arg2.y) - (_arg1.y * _arg2.x)));
}
public static function segmentDistance(_arg1:Point, _arg2:Point, _arg3:Point):Number{
var _local4:Number = (_arg2.x - _arg1.x);
var _local5:Number = (_arg2.y - _arg1.y);
var _local6:Number = (_arg3.x - _arg1.x);
var _local7:Number = (_arg3.y - _arg1.y);
return ((((_local4 * _local7) - (_local5 * _local6)) / Math.sqrt(((_local4 * _local4) + (_local5 * _local5)))));
}
public static function vectorAngleFast(_arg1:Point, _arg2:Point):Number{
var _local3:Number = vectorDot(_arg1, _arg2);
if (Math.abs(_local3) > 1){
_local3 = ((_local3)>0) ? 1 : -1;
};
return (Math.acos(_local3));
}
public static function randomAngle():Number{
return ((Math.random() * DEG360));
}
public static function vectorAngle(_arg1:Point, _arg2:Point):Number{
var _local3:Number = (_arg1.length * _arg2.length);
var _local4:Number = ((_local3)!=0) ? (vectorDot(_arg1, _arg2) / _local3) : 1;
return (Math.acos(_local4));
}
public static function limitAngle(_arg1:Number):Number{
var _local2:Number = (_arg1 % DEG360);
_local2 = ((_local2)>0) ? ((_local2)>DEG180) ? (_local2 - DEG360) : _local2 : ((_local2)<-(DEG180)) ? (_local2 + DEG360) : _local2;
return (_local2);
}
public static function random(_arg1:Number=NaN, _arg2:Number=NaN):Number{
if (isNaN(_arg1)){
return (Math.random());
};
if (isNaN(_arg2)){
return ((Math.random() * _arg1));
};
return (((Math.random() * (_arg2 - _arg1)) + _arg1));
}
public static function vectorDot(_arg1:Point, _arg2:Point):Number{
return (((_arg1.x * _arg2.x) + (_arg1.y * _arg2.y)));
}
public static function toDegree(_arg1:Number):Number{
return ((_arg1 * toDeg));
}
public static function deltaAngle(_arg1:Number, _arg2:Number):Number{
var _local3:Number = (_arg2 - _arg1);
if (_local3 > DEG180){
return ((_local3 - DEG360));
};
if (_local3 < -(DEG180)){
return ((_local3 + DEG360));
};
return (_local3);
}
public static function toRadian(_arg1:Number):Number{
return ((_arg1 * toRad));
}
public static function triangleHasPoint(_arg1:Point, _arg2:Point, _arg3:Point, _arg4:Point):Boolean{
if (vectorCross(_arg3.subtract(_arg1), _arg4.subtract(_arg1)) <= 0){
if (vectorCross(_arg2.subtract(_arg3), _arg4.subtract(_arg3)) <= 0){
if (vectorCross(_arg1.subtract(_arg2), _arg4.subtract(_arg2)) <= 0){
return (true);
};
return (false);
} else {
return (false);
};
//unresolved jump
};
return (false);
}
public static function equals(_arg1:Number, _arg2:Number, _arg3:Number=0):Boolean{
return (((((_arg2 - _arg1) <= _arg3)) && (((_arg2 - _arg1) >= -(_arg3)))));
}
}
}//package alternativa.utils
Section 57
//ObjectUtils (alternativa.utils.ObjectUtils)
package alternativa.utils {
import flash.utils.*;
public class ObjectUtils {
public static function getClassTree(_arg1, _arg2:Class=null):Array{
var _local3:Array = new Array();
var _local4:Class = Class(getDefinitionByName(getQualifiedClassName(_arg1)));
_arg2 = ((_arg2)==null) ? Object : _arg2;
while (_local4 != _arg2) {
_local3.push(_local4);
_local4 = Class(getDefinitionByName(getQualifiedSuperclassName(_local4)));
};
_local3.push(_local4);
return (_local3);
}
public static function getClass(_arg1):Class{
return (Class(getDefinitionByName(getQualifiedClassName(_arg1))));
}
public static function getClassName(_arg1):String{
var _local2:String = getQualifiedClassName(_arg1);
var _local3:int = _local2.indexOf("::");
return (((_local3 == -1)) ? _local2 : _local2.substring((_local3 + 2)));
}
}
}//package alternativa.utils
Section 58
//TextUtils (alternativa.utils.TextUtils)
package alternativa.utils {
public final class TextUtils {
public static function insertVars(_arg1:String, ... _args):String{
var _local3:String = _arg1;
var _local4 = 1;
while (_local4 <= _args.length) {
_local3 = _local3.replace(("%" + _local4.toString()), _args[(_local4 - 1)]);
_local4++;
};
return (_local3);
}
}
}//package alternativa.utils
Section 59
//Background (com.gamezhero.api.as3.gui.Background)
package com.gamezhero.api.as3.gui {
import flash.display.*;
public class Background extends MovieClip {
private var _goal:MovieClip;
private var _bg:MovieClip;
public function Background(_arg1:MovieClip){
_goal = _arg1;
_goal.addChild(this);
ini();
iniEvents();
}
public function remove():void{
clearEvents();
_goal.removeChild(this);
}
private function clearEvents():void{
}
public function update(_arg1:Number, _arg2:Number):void{
this.x = 0;
this.y = 0;
this.width = (_arg1 + 100);
this.height = (_arg2 + 100);
}
private function getBg():MovieClip{
var _local1:MovieClip = new MovieClip();
_local1.graphics.beginFill(0, 1);
_local1.graphics.lineStyle(0, 0, 0);
_local1.graphics.moveTo(0, 0);
_local1.graphics.lineTo(1000, 0);
_local1.graphics.lineTo(1000, 1000);
_local1.graphics.lineTo(0, 1000);
_local1.graphics.lineTo(0, 0);
_local1.graphics.endFill();
return (_local1);
}
private function ini():void{
_bg = getBg();
this.addChild(_bg);
}
private function iniEvents():void{
}
}
}//package com.gamezhero.api.as3.gui
Section 60
//Indicator (com.gamezhero.api.as3.gui.Indicator)
package com.gamezhero.api.as3.gui {
import flash.display.*;
import flash.events.*;
import flash.text.*;
import flash.utils.*;
public class Indicator extends MovieClip {
private var _timer:Timer;
private var _goal:MovieClip;
private var _indicator:MovieClip;
private var _dalpha:Number;
private var _info_text:TextField;
private var _arr:Array;
private var _n:uint;// = 10
private var _timer_2:Timer;
private var _current:Number;// = 0
public function Indicator(_arg1:MovieClip){
_dalpha = (360 / _n);
_arr = new Array();
super();
_goal = _arg1;
_goal.addChild(this);
ini();
iniEvents();
}
public function setSize(_arg1:Number, _arg2:Number):void{
this.visible = true;
this.width = _arg1;
this.height = _arg2;
}
public function remove():void{
clearEvents();
_goal.removeChild(this);
}
private function getItem():MovieClip{
var _local1:MovieClip = new MovieClip();
_local1.graphics.beginFill(0xFFFFFF, 1);
_local1.graphics.lineStyle(0, 0, 0);
_local1.graphics.moveTo(32.3, -5.7);
_local1.graphics.curveTo(30, -3.3, 30, 0);
_local1.graphics.curveTo(30, 3.3, 32.3, 5.6);
_local1.graphics.curveTo(34.7, 8, 38.05, 8);
_local1.graphics.lineTo(57, 8);
_local1.graphics.curveTo(60.3, 8, 62.6, 5.6);
_local1.graphics.curveTo(65, 3.3, 65, 0);
_local1.graphics.curveTo(65, -3.3, 62.6, -5.7);
_local1.graphics.curveTo(60.3, -8, 57, -8);
_local1.graphics.lineTo(38.05, -8);
_local1.graphics.curveTo(34.7, -8, 32.3, -5.7);
_local1.graphics.endFill();
_indicator.addChild(_local1);
return (_local1);
}
private function clearEvents():void{
_timer.removeEventListener(TimerEvent.TIMER, updateIndicator);
_timer_2.removeEventListener(TimerEvent.TIMER, updateCurrent);
}
public function setPos(_arg1:Number, _arg2:Number):void{
this.visible = true;
this.x = _arg1;
this.y = _arg2;
}
private function updateIndicator(_arg1:TimerEvent=null):void{
var _local2:uint;
while (_local2 < _n) {
_arr[_local2].alpha = (_arr[_local2].alpha - 0.07);
if (_arr[_local2].alpha <= 0){
_arr[_local2].alpha = 0;
};
_local2++;
};
_arg1.updateAfterEvent();
}
public function createInfoText():void{
_info_text = new TextField();
var _local1:TextFormat = new TextFormat();
_local1.color = 0xFFFFFF;
_local1.size = 11;
_local1.font = "Arial";
_info_text.defaultTextFormat = _local1;
_info_text.autoSize = TextFieldAutoSize.CENTER;
_indicator.addChild(_info_text);
var _local2:Number = 100;
var _local3:Number = 20;
_local2 = _info_text.width;
_local3 = _info_text.height;
_info_text.x = (-(_local2) / 2);
_info_text.y = -10;
}
public function update(_arg1:Number, _arg2:Number):void{
this.visible = true;
this.x = (_arg1 / 2);
this.y = (_arg2 / 2);
}
private function iniEvents():void{
_timer.addEventListener(TimerEvent.TIMER, updateIndicator);
_timer.start();
_timer_2.addEventListener(TimerEvent.TIMER, updateCurrent);
_timer_2.start();
}
public function setVal(_arg1:String):void{
_info_text.text = _arg1;
}
private function getBorder():MovieClip{
var _local1:Number = 10;
var _local2:Number = 150;
var _local3:Number = 150;
var _local4:MovieClip = new MovieClip();
_local4.graphics.beginFill(0x333333, 1);
_local4.graphics.moveTo(_local1, 0);
_local4.graphics.lineTo((_local2 - _local1), 0);
_local4.graphics.curveTo(_local2, 0, _local2, _local1);
_local4.graphics.lineTo(_local2, _local1);
_local4.graphics.lineTo(_local2, (_local3 - _local1));
_local4.graphics.curveTo(_local2, _local3, (_local2 - _local1), _local3);
_local4.graphics.lineTo((_local2 - _local1), _local3);
_local4.graphics.lineTo(_local1, _local3);
_local4.graphics.curveTo(0, _local3, 0, (_local3 - _local1));
_local4.graphics.lineTo(0, (_local3 - _local1));
_local4.graphics.lineTo(0, _local1);
_local4.graphics.curveTo(0, 0, _local1, 0);
_local4.graphics.lineTo(_local1, 0);
_local4.graphics.endFill();
_indicator.addChild(_local4);
_local4.x = (-(_local4.width) / 2);
_local4.y = (-(_local4.height) / 2);
return (_local4);
}
private function ini():void{
var _local2:MovieClip;
this.visible = false;
_timer = new Timer((1000 / 40), 0);
_timer_2 = new Timer((1000 / 20), 0);
_indicator = new MovieClip();
this.addChild(_indicator);
getBorder();
var _local1:uint;
while (_local1 < _n) {
_local2 = getItem();
_local2.rotation = (_dalpha * _local1);
_local2.alpha = 0.2;
_arr.push(_local2);
_local1++;
};
createInfoText();
}
private function updateCurrent(_arg1:TimerEvent=null):void{
_current++;
if (_current >= _arr.length){
_current = 0;
};
_arr[_current].alpha = 1;
_arg1.updateAfterEvent();
}
}
}//package com.gamezhero.api.as3.gui
Section 61
//URL (com.gamezhero.api.as3.utils.URL)
package com.gamezhero.api.as3.utils {
public class URL {
private var _scheme:String;
private var _host:String;
private var _query:String;
private var _path:String;
private var _userinfo:String;
private var _port:String;
private var _url:String;
private var _fragment:String;
private static const PATTERN:RegExp = /^([A-Za-z0-9_+.]{1,8}:\/\/)?([!-~]+@)?([^\/?#:]*)(:[0-9]*)?(\/[^?#]*)?(\?[^#]*)?(\#.*)?/i;
public function URL(_arg1:String):void{
var _local2:Array = _arg1.match(URL.PATTERN);
_url = _local2[0];
_scheme = _local2[1];
_userinfo = _local2[2];
_host = _local2[3];
_port = _local2[4];
_path = _local2[5];
_query = _local2[6];
_fragment = _local2[7];
}
public function get port():int{
return (((_port.length <= 0)) ? undefined : int(_port.substring(1, _port.length)));
}
public function get fragment():String{
return (((_fragment.length <= 0)) ? undefined : _fragment);
}
public function get query():Object{
var _local2:String;
var _local3:Array;
var _local4:int;
var _local5:Array;
var _local1:Object = {raw:undefined, parsed:undefined};
if (((_query) && ((_query.length > 0)))){
_local1.raw = _query;
_local2 = _query.substring(1, _query.length);
_local3 = _local2.split("&");
_local1.parsed = ((_local3.length > 0)) ? {} : undefined;
_local4 = 0;
while (_local4 < _local3.length) {
_local5 = _local3[_local4].split("=");
_local1.parsed[_local5[0]] = _local5[1];
_local4++;
};
};
return (_local1);
}
public function get scheme():String{
return (((_scheme.length <= 0)) ? undefined : _scheme.substring(0, (_scheme.length - 3)));
}
public function get host():String{
return (((_host.length <= 0)) ? undefined : _host);
}
public function get path():String{
return (((_path.length <= 0)) ? undefined : _path);
}
public function get url():String{
return (((_url.length <= 0)) ? undefined : _url);
}
public function get userinfo():Object{
var _local2:Array;
var _local1:Object = {user:undefined, pass:undefined};
if (_userinfo){
_local2 = _userinfo.substring(0, (_userinfo.length - 1)).split(":");
_local1.user = (_local2[0]) ? _local2[0] : _local1.user;
_local1.pass = (_local2[1]) ? _local2[1] : _local1.pas;
};
return (_local1);
}
}
}//package com.gamezhero.api.as3.utils
Section 62
//GamePreloader (com.gamezhero.api.as3.GamePreloader)
package com.gamezhero.api.as3 {
import flash.display.*;
import flash.events.*;
import flash.net.*;
import com.google.analytics.*;
import com.gamezhero.api.as3.gui.*;
import flash.utils.*;
import flash.ui.*;
public class GamePreloader extends MovieClip {
private var _indicator:Indicator;
private var _obj_listener_preloader:Object;
private var _gamezhero_code_preloader:Number;
private var _quality_old:String;
private var _rate_old:Number;
private var _send_name_connection_preloader:String;
private var _recived_name_connection_preloader:String;
private var _obj:Object;
private var _scale_old:String;
private var _preloader_active_flag:Boolean;// = false
private var _urls:Dictionary;
private var _timer:Timer;
private var _loader_preloader_skin:Loader;
private var _bg:Background;
private var _recive_localconnection_preloader:LocalConnection;
private var _error_flag:Boolean;// = false
private var _in_target:String;
private var _align_old:String;
private var _send_localconnection_preloader:LocalConnection;
private var _par:MovieClip;
private var _amount_try:uint;// = 10
private var _in_url:String;// = "null"
private var _tracker:GATracker;
private var _debug_flag:Boolean;// = false
public static const finish:String = "PRELOAD_COMPLETE";
public function GamePreloader(_arg1:MovieClip, _arg2:Object=null){
var par = _arg1;
var iniObject = _arg2;
_timer = new Timer((1000 / 10), 0);
_obj = new Object();
_urls = new Dictionary();
_recive_localconnection_preloader = new LocalConnection();
_send_localconnection_preloader = new LocalConnection();
_loader_preloader_skin = new Loader();
_obj_listener_preloader = new Object();
super();
_par = par;
_par.addChild(this);
if (iniObject != null){
_obj = iniObject;
};
try {
_debug_flag = _obj["debug"];
} catch(e:Error) {
_debug_flag = false;
};
_bg = new Background(this);
_indicator = new Indicator(this);
_gamezhero_code_preloader = new Date().getTime();
_recived_name_connection_preloader = ("_recived_gamezhero_preloader_" + _gamezhero_code_preloader);
_send_name_connection_preloader = ("_send_gamezhero_preloader_" + _gamezhero_code_preloader);
iniLocalConnectionsPreloader();
iniEvents();
iniStage();
iniGoogleAnalitics();
}
private function ioErrorHandler(_arg1:IOErrorEvent=null):void{
beginScenario2();
}
private function preloaderLoaderError(_arg1:Event=null):void{
beginScenario2();
}
private function preloaderLoaderComplete(_arg1:Event=null):void{
}
private function actionDone(_arg1:TimerEvent=null):void{
var _local2:Event;
this.alpha = (this.alpha - 1);
if (this.alpha <= 1){
this.alpha = 0;
clearEvents();
clearStageEvents();
clearTimers();
setStageSettings();
_local2 = new Event(finish);
this.dispatchEvent(_local2);
_indicator.remove();
_bg.remove();
_par.removeChild(this);
};
_arg1.updateAfterEvent();
}
private function gotoAction(_arg1:MouseEvent=null):void{
trace((((("gotoAction 2 " + _in_url) + " ") + _in_target) + " "));
if (_in_url != "null"){
GamezheroGlobal.getURL(_in_url, _in_target);
_in_url = "null";
};
}
private function iniStage(_arg1:Event=null):void{
var event = _arg1;
this.removeEventListener(Event.ENTER_FRAME, iniStage);
try {
getStageSettings();
iniStageSettings();
iniContextMenu();
iniStageEvents();
if (_debug_flag == false){
loadPreloaderSkin();
} else {
beginScenario2();
};
} catch(e:Error) {
_amount_try--;
if (_amount_try <= 0){
beginScenario2();
} else {
this.addEventListener(Event.ENTER_FRAME, iniStage);
};
};
}
private function resizeAction(_arg1:Event=null):void{
var obj:Object;
var event = _arg1;
obj = new Object();
try {
obj.width = stage.stageWidth;
obj.height = stage.stageHeight;
} catch(e:Error) {
obj.width = 550;
obj.height = 400;
};
if ((((_error_flag == false)) && ((_preloader_active_flag == true)))){
try {
_send_localconnection_preloader.send(_send_name_connection_preloader, GamezheroGlobal.toText([117, 112, 100, 97, 116, 101, 80, 111, 115]), obj);
} catch(e:Error) {
beginScenario2();
};
};
_indicator.update(obj.width, obj.height);
_bg.update(obj.width, obj.height);
}
private function getStageSettings():void{
_scale_old = stage.scaleMode;
_align_old = stage.align;
_rate_old = stage.frameRate;
_quality_old = stage.quality;
}
private function beginScenario2():void{
_error_flag = true;
clearTimers();
_timer.addEventListener(TimerEvent.TIMER, updatePreloader2);
_timer.start();
}
private function iniEvents():void{
_par.loaderInfo.addEventListener(IOErrorEvent.IO_ERROR, ioErrorHandler);
_loader_preloader_skin.contentLoaderInfo.addEventListener(Event.INIT, preloaderLoaderInit);
_loader_preloader_skin.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, preloaderLoaderError);
_recive_localconnection_preloader.addEventListener(StatusEvent.STATUS, onStatusRecivePreloader);
_recive_localconnection_preloader.addEventListener(SecurityErrorEvent.SECURITY_ERROR, onErrorRecivePreloader);
_send_localconnection_preloader.addEventListener(StatusEvent.STATUS, onStatusSendPreloader);
_send_localconnection_preloader.addEventListener(SecurityErrorEvent.SECURITY_ERROR, onErrorSendPreloader);
}
private function updatePreloader2(_arg1:TimerEvent=null):void{
var obj:Object;
var event = _arg1;
iniStageSettings();
var proc:Number = (_par.loaderInfo.bytesLoaded / _par.loaderInfo.bytesTotal);
_indicator.setVal((Math.round((proc * 100)) + " %"));
if (proc >= 1){
action();
};
obj = new Object();
try {
obj.width = stage.stageWidth;
obj.height = stage.stageHeight;
} catch(e:Error) {
obj.width = 550;
obj.height = 400;
};
event.updateAfterEvent();
}
private function iniContextMenu():void{
var _local5:String;
var _local6:ContextMenuItem;
var _local1:String = GamezheroGlobal.getDomain(_par.stage);
var _local2:String = GamezheroGlobal.gameName;
_obj.gamezhero_url = (((("http://www.gamezhero.com/?utm_campaign=" + _local2) + "&utm_source=") + _local1) + "&utm_medium=preloader");
_obj.gamezhero_menu = {Free Online Games @ Gamezhero.com:(((("http://www.gamezhero.com/?utm_campaign=" + _local2) + "&utm_source=") + _local1) + "&utm_medium=context_menu"), Send To Friends:(((((("http://www.gamezhero.com/sendtofriends/" + _local2) + "-onlinegames.html?utm_campaign=") + _local2) + "&utm_source=") + _local1) + "&utm_medium=send_to_friends_context_menu"), Put This Game To Your Blog or Site:(((((("http://www.gamezhero.com/freewebsitegames/" + _local2) + "-onlinegames.html?utm_campaign=") + _local2) + "&utm_source=") + _local1) + "&utm_medium=free_web_site_games_context")};
var _local3:ContextMenu = new ContextMenu();
_local3.hideBuiltInItems();
var _local4:ContextMenuBuiltInItems = _local3.builtInItems;
_local4.quality = true;
_local4.print = true;
for (_local5 in _obj.gamezhero_menu) {
_local6 = new ContextMenuItem(_local5);
_urls[_local6] = _obj.gamezhero_menu[_local5];
_local6.addEventListener(ContextMenuEvent.MENU_ITEM_SELECT, getURLContextMenu);
_local3.customItems.push(_local6);
};
this.parent.contextMenu = _local3;
}
private function getInfo():Object{
var _local1:UserInfo = new UserInfo(_par);
return ((_local1 as Object));
}
private function onStatusRecivePreloader(_arg1:StatusEvent=null):void{
switch (_arg1.level){
case "status":
break;
case "error":
beginScenario2();
break;
};
}
private function iniLocalConnectionsPreloader():void{
_obj_listener_preloader = new Object();
_obj_listener_preloader.preloaderOk = function ():void{
_send_localconnection_preloader.send(_send_name_connection_preloader, GamezheroGlobal.toText([105, 110, 105, 80, 114, 101, 108, 111, 97, 100, 101, 114]), getInfo());
beginScenario1();
};
_obj_listener_preloader.preloaderGetUrlAction = function (_arg1:String, _arg2:String):void{
var url = _arg1;
var target = _arg2;
try {
_tracker.trackEvent("preloader", "click", GamezheroGlobal.gameName);
} catch(e:Error) {
};
gotoActionIni(url, target);
};
_obj_listener_preloader.finishAction = function (_arg1:Object):void{
action();
};
var dom:String = GamezheroGlobal.toText([102, 105, 108, 101, 115, 46, 103, 97, 109, 101, 122, 104, 101, 114, 111, 46, 99, 111, 109]);
_recive_localconnection_preloader.allowInsecureDomain(dom);
_recive_localconnection_preloader.allowDomain(dom);
_recive_localconnection_preloader.client = _obj_listener_preloader;
try {
_recive_localconnection_preloader.connect(_recived_name_connection_preloader);
} catch(e:Error) {
beginScenario2();
};
_send_localconnection_preloader.allowInsecureDomain(dom);
_send_localconnection_preloader.allowDomain(dom);
}
private function gotoActionIni(_arg1:String, _arg2:String):void{
trace((((("gotoAction 1 " + _arg1) + " ") + _arg2) + " "));
_in_url = _arg1;
_in_target = _arg2;
gotoAction();
}
private function onStatusSendPreloader(_arg1:StatusEvent=null):void{
switch (_arg1.level){
case "status":
break;
case "error":
beginScenario2();
break;
};
}
private function iniGoogleAnalitics():void{
try {
_tracker = new GATracker(this, "UA-262190-1", "AS3", false);
_tracker.trackEvent("preloader", "loading", GamezheroGlobal.gameName);
} catch(e:Error) {
};
}
private function getURLContextMenu(_arg1:ContextMenuEvent=null):void{
GamezheroGlobal.getURL(_urls[_arg1.target], "_blank");
}
private function iniStageEvents():void{
stage.addEventListener(Event.RESIZE, resizeAction);
resizeAction();
}
public function action(_arg1:Event=null):void{
clearTimers();
_timer.addEventListener(TimerEvent.TIMER, actionDone);
_timer.start();
}
private function iniStageSettings():void{
stage.scaleMode = StageScaleMode.NO_SCALE;
stage.align = StageAlign.TOP_LEFT;
stage.frameRate = 20;
stage.quality = StageQuality.HIGH;
}
private function clearEvents():void{
_par.loaderInfo.removeEventListener(IOErrorEvent.IO_ERROR, ioErrorHandler);
this.removeEventListener(Event.ENTER_FRAME, iniStage);
_loader_preloader_skin.contentLoaderInfo.removeEventListener(Event.INIT, preloaderLoaderInit);
_loader_preloader_skin.contentLoaderInfo.removeEventListener(IOErrorEvent.IO_ERROR, preloaderLoaderError);
_recive_localconnection_preloader.removeEventListener(StatusEvent.STATUS, onStatusRecivePreloader);
_recive_localconnection_preloader.removeEventListener(SecurityErrorEvent.SECURITY_ERROR, onErrorRecivePreloader);
_recive_localconnection_preloader.client = {};
_recive_localconnection_preloader.close();
_recive_localconnection_preloader = new LocalConnection();
_send_localconnection_preloader.removeEventListener(StatusEvent.STATUS, onStatusSendPreloader);
_send_localconnection_preloader.removeEventListener(SecurityErrorEvent.SECURITY_ERROR, onErrorSendPreloader);
_send_localconnection_preloader = new LocalConnection();
}
private function updatePreloader1(_arg1:TimerEvent=null):void{
var obj:Object;
var event = _arg1;
iniStageSettings();
var proc:Number = (_par.loaderInfo.bytesLoaded / _par.loaderInfo.bytesTotal);
_indicator.setVal("Loading...");
obj = new Object();
try {
obj.width = stage.stageWidth;
obj.height = stage.stageHeight;
} catch(e:Error) {
obj.width = 550;
obj.height = 400;
};
obj.loaded = proc;
_send_localconnection_preloader.send(_send_name_connection_preloader, GamezheroGlobal.toText([117, 112, 100, 97, 116, 101, 80, 114, 101, 108, 111, 97, 100, 101, 114]), obj);
event.updateAfterEvent();
}
private function loadPreloaderSkin():void{
var url:String = (GamezheroGlobal.toText([104, 116, 116, 112, 58, 47, 47, 102, 105, 108, 101, 115, 46, 103, 97, 109, 101, 122, 104, 101, 114, 111, 46, 99, 111, 109, 47, 112, 114, 101, 108, 111, 97, 100, 101, 114, 47, 112, 114, 101, 108, 111, 97, 100, 101, 114, 95, 118, 49, 46, 115, 119, 102, 63, 103, 97, 109, 101, 122, 104, 101, 114, 111, 67, 111, 100, 101, 61]) + String(_gamezhero_code_preloader));
var request:URLRequest = new URLRequest(url);
try {
_loader_preloader_skin.load(request);
addChild(_loader_preloader_skin);
} catch(e:Error) {
beginScenario2();
};
}
private function preloaderLoaderInit(_arg1:Event=null):void{
var _local2:Timer = new Timer(200, 1);
_local2.addEventListener(TimerEvent.TIMER, checkPreloader);
_local2.start();
}
private function checkPreloader(_arg1:TimerEvent=null):void{
_send_localconnection_preloader.send(_send_name_connection_preloader, GamezheroGlobal.toText([112, 114, 101, 108, 111, 97, 100, 101, 114, 73, 115, 79, 107]), null);
}
private function clearStageEvents():void{
try {
stage.removeEventListener(Event.RESIZE, resizeAction);
} catch(e:Error) {
};
}
private function onErrorRecivePreloader(_arg1:SecurityErrorEvent=null):void{
beginScenario2();
}
private function moveAction(_arg1:MouseEvent=null):void{
}
private function beginScenario1():void{
_preloader_active_flag = true;
clearTimers();
_timer.addEventListener(TimerEvent.TIMER, updatePreloader1);
_timer.start();
resizeAction();
}
private function clearTimers():void{
_timer.removeEventListener(TimerEvent.TIMER, updatePreloader1);
_timer.removeEventListener(TimerEvent.TIMER, updatePreloader2);
_timer.removeEventListener(TimerEvent.TIMER, actionDone);
}
private function onErrorSendPreloader(_arg1:SecurityErrorEvent=null):void{
beginScenario2();
}
private function setStageSettings():void{
stage.scaleMode = _scale_old;
stage.align = _align_old;
stage.frameRate = _rate_old;
stage.quality = _quality_old;
}
}
}//package com.gamezhero.api.as3
Section 63
//GamezheroApi (com.gamezhero.api.as3.GamezheroApi)
package com.gamezhero.api.as3 {
import flash.display.*;
import flash.events.*;
import flash.system.*;
public class GamezheroApi {
private static var _score_continue_function:Function;
private static var _preloader_next_step_function:Function;
private static var _preloader_goal:MovieClip;
private static var _score_submit_function:Function;
private static var _score_error_function:Function;
private static var _score_goal:MovieClip;
private static function scoreSubmitAction(_arg1:Event=null):void{
_score_submit_function.apply();
}
public static function preloader(_arg1:MovieClip, _arg2:Function):void{
var _local3:GamePreloader;
_preloader_goal = (_arg1 as MovieClip);
_preloader_next_step_function = _arg2;
if (GamezheroGlobal.gameName == "unset"){
trace("Error. GamezheroApi don't ini !");
} else {
_local3 = new GamePreloader(_preloader_goal, {debug:false});
_local3.addEventListener(GamePreloader.finish, preloaderNextStep);
};
}
public static function ini(_arg1:String):void{
Security.allowDomain("www.gamezhero.com", "gamezhero.com", "files.gamezhero.com", "data.gamezhero.com", "*.gamezhero.com");
Security.allowInsecureDomain("www.gamezhero.com", "gamezhero.com", "files.gamezhero.com", "data.gamezhero.com", "*.gamezhero.com");
GamezheroGlobal.gameName = _arg1;
}
private static function scoreErrorAction(_arg1:Event=null):void{
_score_error_function.apply();
}
public static function linkSendToFrined():void{
GamezheroGlobal.getURL((((((("http://www.gamezhero.com/sendtofriends/" + GamezheroGlobal.gameName) + "-games.html?utm_campaign=") + GamezheroGlobal.gameName) + "&utm_source=") + GamezheroGlobal.getDomain()) + "&utm_medium=send_to_friend"), "_blank");
}
private static function scoreContinueAction(_arg1:Event=null):void{
_score_continue_function.apply();
}
public static function score(_arg1:MovieClip, _arg2:String, _arg3:Number, _arg4:Number, _arg5:Number, _arg6:Function, _arg7:Function, _arg8:Function, _arg9:Object=null):void{
var _local10:Number;
var _local11:Number;
var _local12:Number;
var _local13:Object;
var _local14:SubmitArea;
GamezheroGlobal.gameCode = _arg2;
_score_goal = (_arg1 as MovieClip);
_score_submit_function = _arg6;
_score_continue_function = _arg7;
_score_error_function = _arg8;
if (GamezheroGlobal.gameName == "unset"){
trace("Error. GamezheroApi don't ini !");
} else {
_local10 = _arg3;
_local11 = _arg4;
_local12 = _arg5;
_local13 = _arg9;
if (_local13 == null){
_local13 = {border:{width:4, color:0xFFFFFF, alpha:100}, background:{topColor:0x999999, bottomColor:0x666666, topAlpha:100, bottomAlpha:100, cornerRadius:10}, language:"ENG"};
};
_local14 = new SubmitArea(_score_goal, _local11, _local12, _local10, _local13);
_local14.addEventListener(SubmitArea.SUBMITED, scoreSubmitAction);
_local14.addEventListener(SubmitArea.CONTINUE, scoreContinueAction);
_local14.addEventListener(SubmitArea.ERROR, scoreErrorAction);
};
}
private static function preloaderNextStep(_arg1:Event=null):void{
_preloader_next_step_function.apply();
}
public static function linkTopScore():void{
GamezheroGlobal.getURL((((((("http://www.gamezhero.com/topscore/" + GamezheroGlobal.gameName) + "/top100.html?utm_campaign=") + GamezheroGlobal.gameName) + "&utm_source=") + GamezheroGlobal.getDomain()) + "&utm_medium=top_score"), "_blank");
}
public static function linkMoreGames():void{
GamezheroGlobal.getURL((((("http://www.gamezhero.com/?utm_campaign=" + GamezheroGlobal.gameName) + "&utm_source=") + GamezheroGlobal.getDomain()) + "&utm_medium=more_free_games"), "_blank");
}
public static function linkZorroLogo():void{
GamezheroGlobal.getURL((((("http://www.gamezhero.com/?utm_campaign=" + GamezheroGlobal.gameName) + "&utm_source=") + GamezheroGlobal.getDomain()) + "&utm_medium=zorro_logo"), "_blank");
}
public static function linkPublish():void{
GamezheroGlobal.getURL((((((("http://www.gamezhero.com/freewebsitegames/" + GamezheroGlobal.gameName) + "-games.html?utm_campaign=") + GamezheroGlobal.gameName) + "&utm_source=") + GamezheroGlobal.getDomain()) + "&utm_medium=free_web_site_games"), "_blank");
}
}
}//package com.gamezhero.api.as3
Section 64
//GamezheroGlobal (com.gamezhero.api.as3.GamezheroGlobal)
package com.gamezhero.api.as3 {
import flash.display.*;
import flash.net.*;
import com.gamezhero.api.as3.utils.*;
import flash.external.*;
public class GamezheroGlobal {
public static const SAFARI:String = "safari";
public static const FIREFOX:String = "firefox";
public static const CHROME:String = "chrome";
public static const IE:String = "ie";
public static const OPERA:String = "opera";
public static var gameNameVar:String = "unset";
public static var host:String = "error";
public static var browser:String = "unset";
public static var gameCodeVar:String = "unset";
public static function getDomain(_arg1:Stage=null):String{
var url:URL;
var stage = _arg1;
if (host != "error"){
return (host);
};
try {
url = new URL(stage.loaderInfo.url);
host = url.host;
if (url.host == null){
host = "local";
};
} catch(e:Error) {
host = "error";
};
return (host);
}
public static function toText(_arg1:Array):String{
var _local2 = "";
var _local3:Number = 0;
while (_local3 < _arg1.length) {
_local2 = (_local2 + String.fromCharCode(_arg1[_local3]));
_local3++;
};
return (_local2);
}
public static function getURL(_arg1:String, _arg2:String):void{
var _local3:URLRequest = new URLRequest(_arg1);
navigateToURL(_local3, _arg2);
}
public static function get gameName():String{
return (gameNameVar);
}
public static function getBrowser():String{
var st:String;
if (browser == "unset"){
if (ExternalInterface.available){
try {
st = ExternalInterface.call("function (){ return navigator['userAgent']}");
st = st.toLowerCase();
if (st.indexOf("firefox") != -1){
browser = FIREFOX;
} else {
if (st.indexOf("chrome") != -1){
browser = CHROME;
} else {
if (st.indexOf("safari") != -1){
browser = SAFARI;
} else {
if (st.indexOf("opera") != -1){
browser = OPERA;
} else {
browser = IE;
};
};
};
};
} catch(e:Error) {
browser = IE;
};
} else {
browser = IE;
};
};
return (browser);
}
public static function set gameName(_arg1:String):void{
gameNameVar = _arg1;
}
public static function set gameCode(_arg1:String):void{
gameCodeVar = _arg1;
}
public static function get gameCode():String{
return (gameCodeVar);
}
}
}//package com.gamezhero.api.as3
Section 65
//SubmitArea (com.gamezhero.api.as3.SubmitArea)
package com.gamezhero.api.as3 {
import flash.display.*;
import flash.events.*;
import flash.net.*;
import flash.text.*;
import com.gamezhero.api.as3.gui.*;
import flash.utils.*;
public class SubmitArea extends MovieClip {
private var reciveLocalConnection_engine:LocalConnection;
private var sendLocalConnection_skin:LocalConnection;
private var score_value:Number;// = 0
private var sendNameConnection_skin:String;
private var x_pos:Number;// = 0
private var y_pos:Number;// = 0
private var _indicator:Indicator;
private var score:Number;
private var goal:MovieClip;
private var skin_mc:MovieClip;
private var loader_skin:Loader;
private var gamezheroCode_engine:Number;
private var engine_mc:MovieClip;
private var skin_info:Object;
private var _loader:URLVariables;
private var reciveLocalConnection_skin:LocalConnection;
private var recivedNameConnection_engine:String;
private var sendLocalConnection_engine:LocalConnection;
private var sendNameConnection_engine:String;
private var _loader_url:String;// = "null"
private var objListenerSkin:Object;
public var versionGame:String;// = "2.0"
private var gamezheroCode_skin:Number;
private var loader_engine:Loader;
private var objListenerEngine:Object;
private var recivedNameConnection_skin:String;
private var infoText:TextField;
public static const SUBMITED:String = "gamezhero_submited";
public static const CONTINUE:String = "gamezhero_continue";
public static const ERROR:String = "gamezhero_error";
public function SubmitArea(_arg1:DisplayObject, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object){
reciveLocalConnection_skin = new LocalConnection();
sendLocalConnection_skin = new LocalConnection();
reciveLocalConnection_engine = new LocalConnection();
sendLocalConnection_engine = new LocalConnection();
loader_skin = new Loader();
loader_engine = new Loader();
objListenerSkin = new Object();
objListenerEngine = new Object();
_loader = new URLVariables();
super();
gamezheroCode_skin = new Date().getTime();
gamezheroCode_engine = gamezheroCode_skin;
recivedNameConnection_skin = ("_send_gamezhero_skin_" + gamezheroCode_skin);
sendNameConnection_skin = ("_recive_gamezhero_skin_" + gamezheroCode_skin);
recivedNameConnection_engine = ("_send_gamezhero_engine_" + gamezheroCode_engine);
sendNameConnection_engine = ("_recive_gamezhero_engine_" + gamezheroCode_engine);
iniLocalConnectionsSkin();
iniLocalConnectionsEngine();
iniSubmitArea(_arg1, _arg2, _arg3, _arg4, _arg5);
iniEvents();
}
private function iniSkin():void{
loader_skin.x = x_pos;
loader_skin.y = y_pos;
infoText.text = "";
try {
_indicator.remove();
} catch(e:Error) {
};
sendLocalConnection_skin.send(sendNameConnection_skin, "iniSkin", skin_info);
}
private function loadSkin():void{
infoText.text = "Loading Skin...";
var url:String = (toText([104, 116, 116, 112, 58, 47, 47, 102, 105, 108, 101, 115, 46, 103, 97, 109, 101, 122, 104, 101, 114, 111, 46, 99, 111, 109, 47, 115, 99, 111, 114, 101, 47, 115, 107, 105, 110, 47, 115, 107, 105, 110, 95, 118, 49, 46, 115, 119, 102, 63, 103, 97, 109, 101, 122, 104, 101, 114, 111, 67, 111, 100, 101, 61]) + gamezheroCode_skin);
var request:URLRequest = new URLRequest(url);
try {
loader_skin.load(request);
addChild(loader_skin);
} catch(e:Error) {
infoText.text = "Error Loading Skin...";
errorAction();
};
}
public function submitAction(_arg1:String=""):void{
diactivateAllEvents();
deleteAll();
dispatchEvent(new Event(SUBMITED));
}
private function diactivateAllEvents():void{
loader_skin.contentLoaderInfo.removeEventListener(Event.INIT, skinLoaderInit);
loader_skin.contentLoaderInfo.removeEventListener(IOErrorEvent.IO_ERROR, skinLoaderError);
loader_engine.contentLoaderInfo.removeEventListener(Event.INIT, engineLoaderInit);
loader_engine.contentLoaderInfo.removeEventListener(IOErrorEvent.IO_ERROR, engineLoaderError);
reciveLocalConnection_skin.removeEventListener(StatusEvent.STATUS, onStatusReciveSkin);
reciveLocalConnection_skin.removeEventListener(SecurityErrorEvent.SECURITY_ERROR, onErrorReciveSkin);
sendLocalConnection_skin.removeEventListener(StatusEvent.STATUS, onStatusSendSkin);
sendLocalConnection_skin.removeEventListener(SecurityErrorEvent.SECURITY_ERROR, onErrorSendSkin);
reciveLocalConnection_engine.removeEventListener(StatusEvent.STATUS, onStatusReciveEngine);
reciveLocalConnection_engine.removeEventListener(SecurityErrorEvent.SECURITY_ERROR, onErrorReciveEngine);
sendLocalConnection_engine.removeEventListener(StatusEvent.STATUS, onStatusSendEngine);
sendLocalConnection_engine.removeEventListener(SecurityErrorEvent.SECURITY_ERROR, onErrorSendEngine);
}
private function onStatusReciveEngine(_arg1:StatusEvent=null):void{
switch (_arg1.level){
case "status":
break;
case "error":
infoText.text = "Error Connections 'Recive From Engine'";
break;
};
}
public function createInfoText():void{
infoText = new TextField();
infoText.autoSize = TextFieldAutoSize.LEFT;
var _local1:TextFormat = new TextFormat();
_local1.color = 0xFFFFFF;
_local1.size = 11;
_local1.font = "Arial";
infoText.defaultTextFormat = _local1;
this.addChild(infoText);
infoText.x = 10;
infoText.y = 10;
infoText.visible = false;
}
private function iniEvents():void{
loader_skin.contentLoaderInfo.addEventListener(Event.INIT, skinLoaderInit);
loader_skin.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, skinLoaderError);
loader_engine.contentLoaderInfo.addEventListener(Event.INIT, engineLoaderInit);
loader_engine.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, engineLoaderError);
reciveLocalConnection_skin.addEventListener(StatusEvent.STATUS, onStatusReciveSkin);
reciveLocalConnection_skin.addEventListener(SecurityErrorEvent.SECURITY_ERROR, onErrorReciveSkin);
sendLocalConnection_skin.addEventListener(StatusEvent.STATUS, onStatusSendSkin);
sendLocalConnection_skin.addEventListener(SecurityErrorEvent.SECURITY_ERROR, onErrorSendSkin);
reciveLocalConnection_engine.addEventListener(StatusEvent.STATUS, onStatusReciveEngine);
reciveLocalConnection_engine.addEventListener(SecurityErrorEvent.SECURITY_ERROR, onErrorReciveEngine);
sendLocalConnection_engine.addEventListener(StatusEvent.STATUS, onStatusSendEngine);
sendLocalConnection_engine.addEventListener(SecurityErrorEvent.SECURITY_ERROR, onErrorSendEngine);
}
private function engineLoaderError(_arg1:Event=null):void{
infoText.text = "Error Loading Engine...";
errorAction();
}
private function onStatusReciveSkin(_arg1:StatusEvent=null):void{
switch (_arg1.level){
case "status":
break;
case "error":
infoText.text = "Error Connections 'Recive From Skin'";
break;
};
}
private function engineLoaderInit(_arg1:Event=null):void{
infoText.text = "Check Engine Connection...";
var _local2:Timer = new Timer(200, 1);
_local2.addEventListener(TimerEvent.TIMER, checkEngine);
_local2.start();
}
private function onStatusSendEngine(_arg1:StatusEvent=null):void{
switch (_arg1.level){
case "status":
break;
case "error":
infoText.text = "Error Connections 'Send To Engine'";
break;
};
}
private function checkSkin(_arg1:TimerEvent=null):void{
sendLocalConnection_skin.send(sendNameConnection_skin, "skinIsOk");
}
private function iniLocalConnectionsSkin():void{
objListenerSkin = new Object();
objListenerSkin.skinOk = function ():void{
loadEngine();
};
objListenerSkin.submitAction = function (_arg1:String):void{
sendLocalConnection_engine.send(sendNameConnection_engine, toText([115, 101, 110, 100, 83, 99, 111, 114, 101]), _arg1);
};
objListenerSkin.errorInputActin = function ():void{
};
objListenerSkin.continueAction = function ():void{
continueAction();
};
var dom:String = toText([102, 105, 108, 101, 115, 46, 103, 97, 109, 101, 122, 104, 101, 114, 111, 46, 99, 111, 109]);
reciveLocalConnection_skin.allowInsecureDomain(dom);
reciveLocalConnection_skin.allowDomain(dom);
reciveLocalConnection_skin.client = objListenerSkin;
reciveLocalConnection_skin.connect(recivedNameConnection_skin);
sendLocalConnection_skin.allowInsecureDomain(dom);
sendLocalConnection_skin.allowDomain(dom);
}
private function onErrorReciveSkin(_arg1:SecurityErrorEvent=null):void{
errorAction();
}
private function onStatusSendSkin(_arg1:StatusEvent=null):void{
switch (_arg1.level){
case "status":
break;
case "error":
infoText.text = "Error Connections 'Send To Skin'";
break;
};
}
private function onErrorSendSkin(_arg1:SecurityErrorEvent=null):void{
errorAction();
}
private function skinLoaderInit(_arg1:Event=null):void{
infoText.text = "Check Skin Connection... ";
var _local2:Timer = new Timer(200, 1);
_local2.addEventListener(TimerEvent.TIMER, checkSkin);
_local2.start();
}
public function continueAction():void{
diactivateAllEvents();
deleteAll();
dispatchEvent(new Event(CONTINUE));
}
private function onErrorReciveEngine(_arg1:SecurityErrorEvent=null):void{
errorAction();
}
private function sendScoreAction(_arg1:MouseEvent=null):void{
var _local2:URLRequest;
if (_loader_url != "null"){
_local2 = new URLRequest(_loader_url);
_local2.method = URLRequestMethod.POST;
_local2.data = _loader;
navigateToURL(_local2, "_blank");
_loader = new URLVariables();
_loader_url = "null";
submitAction();
};
}
private function toText(_arg1:Array):String{
var _local2 = "";
var _local3:Number = 0;
while (_local3 < _arg1.length) {
_local2 = (_local2 + String.fromCharCode(_arg1[_local3]));
_local3++;
};
return (_local2);
}
private function iniSubmitArea(_arg1:DisplayObject, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object):void{
goal = (_arg1 as MovieClip);
goal.addChild(this);
x_pos = _arg2;
y_pos = _arg3;
score_value = Math.abs(Math.round(_arg4));
skin_info = _arg5;
skin_info.score = score_value;
skin_info.gameName = GamezheroGlobal.gameName;
skin_info.gameCode = GamezheroGlobal.gameCode;
skin_info.domain = GamezheroGlobal.getDomain(goal.stage);
_indicator = new Indicator(goal);
_indicator.setSize(50, 50);
_indicator.setPos(30, 30);
createInfoText();
loadSkin();
}
private function deleteAll():void{
this.removeChild(infoText);
this.removeChild(loader_skin);
this.removeChild(loader_engine);
try {
_indicator.remove();
} catch(e:Error) {
};
goal.removeChild(this);
}
private function onErrorSendEngine(_arg1:SecurityErrorEvent=null):void{
errorAction();
}
private function loadEngine():void{
infoText.text = "Loading Engine...";
var url:String = (toText([104, 116, 116, 112, 58, 47, 47, 102, 105, 108, 101, 115, 46, 103, 97, 109, 101, 122, 104, 101, 114, 111, 46, 99, 111, 109, 47, 115, 99, 111, 114, 101, 47, 101, 110, 103, 105, 110, 101, 47, 101, 110, 103, 105, 110, 101, 95, 118, 49, 46, 115, 119, 102, 63, 103, 97, 109, 101, 122, 104, 101, 114, 111, 67, 111, 100, 101, 61]) + gamezheroCode_engine);
var request:URLRequest = new URLRequest(url);
try {
loader_engine.load(request);
addChild(loader_engine);
} catch(e:Error) {
infoText.text = "Error Loading Engine...";
errorAction();
};
}
public function errorAction():void{
diactivateAllEvents();
deleteAll();
dispatchEvent(new Event(ERROR));
}
private function iniLocalConnectionsEngine():void{
objListenerEngine = new Object();
objListenerEngine.engineOk = function ():void{
sendLocalConnection_engine.send(sendNameConnection_engine, "iniEngine", skin_info);
infoText.text = "Engine Connections...";
};
objListenerEngine.engineError = function ():void{
infoText.text = "Error Engine...";
};
objListenerEngine.submitActionDone = function (_arg1:Object):void{
sendScore(_arg1);
};
objListenerEngine.engineActivated = function ():void{
iniSkin();
};
var dom:String = toText([102, 105, 108, 101, 115, 46, 103, 97, 109, 101, 122, 104, 101, 114, 111, 46, 99, 111, 109]);
reciveLocalConnection_engine.allowDomain(dom);
reciveLocalConnection_engine.allowInsecureDomain(dom);
reciveLocalConnection_engine.client = objListenerEngine;
reciveLocalConnection_engine.connect(recivedNameConnection_engine);
sendLocalConnection_engine.allowDomain(dom);
sendLocalConnection_engine.allowInsecureDomain(dom);
}
private function moveAction(_arg1:MouseEvent=null):void{
}
private function sendScore(_arg1:Object):void{
var _local2:String;
_loader = new URLVariables();
_loader_url = _arg1.url;
for (_local2 in _arg1.vars) {
_loader[_local2] = _arg1.vars[_local2];
};
sendScoreAction();
}
private function checkEngine(_arg1:TimerEvent=null):void{
sendLocalConnection_engine.send(sendNameConnection_engine, "engineIsOk");
}
private function fromText(_arg1:String):Array{
var _local2:Array = new Array();
var _local3:Number = 0;
while (_local3 < _arg1.length) {
_local2.push(_arg1.charCodeAt(_local3));
_local3++;
};
return (_local2);
}
private function skinLoaderError(_arg1:Event=null):void{
infoText.text = "Error Loading Skin...";
errorAction();
}
}
}//package com.gamezhero.api.as3
Section 66
//UserInfo (com.gamezhero.api.as3.UserInfo)
package com.gamezhero.api.as3 {
import flash.display.*;
import flash.system.*;
import flash.external.*;
public class UserInfo {
public var flash_domain:String;
private var _stage:Stage;
public var ad_zone:String;// = "preloader"
public var flash_height:Number;
public var flash_vars:Object;
public var referrer:String;
public var flash_url:String;
public var browser:String;
public var href:String;
private var _goal:MovieClip;
public var flash_width:Number;
public var game_name:String;
public var api_version:String;// = "AS3 - v3.0"
public var publisher:String;// = "gamezhero"
public var capabilities:String;
public function UserInfo(_arg1:MovieClip){
var g = _arg1;
_goal = g;
try {
_stage = _goal.stage;
} catch(e:Error) {
};
super();
iniInfo();
}
private function iniInfo():void{
var i:String;
this["publisher"] = "gamezhero";
this["ad_zone"] = "preloader";
this["api_version"] = "AS3 - v3.0";
this["flash_vars"] = new Object();
this["capabilities"] = Capabilities.serverString;
if (ExternalInterface.available){
try {
this["href"] = ExternalInterface.call("function (){return document.location.href}");
} catch(e:Error) {
this["href"] = "-1";
};
try {
this["browser"] = ExternalInterface.call("function (){var st = ''; for (i in navigator){ if (typeof(navigator[i])!='function'){ st+=i+'='+navigator[i]+'&'; }} return st}");
} catch(e:Error) {
this["browser"] = "-1";
};
try {
this["referrer"] = ExternalInterface.call("function (){return document.referrer}");
} catch(e:Error) {
this["referrer"] = "-1";
};
} else {
this["href"] = "-1";
this["browser"] = "-1";
this["referrer"] = "-1";
};
this["game_name"] = GamezheroGlobal.gameName;
this["flash_domain"] = GamezheroGlobal.getDomain();
try {
this["flash_width"] = _stage.stageWidth;
this["flash_height"] = _stage.stageHeight;
this["flash_url"] = _stage.root.loaderInfo.url;
} catch(e:Error) {
};
try {
for (i in _stage.root.loaderInfo.parameters) {
this["flash_vars"][i] = _stage.root.loaderInfo.parameters[i];
};
} catch(e:Error) {
};
}
}
}//package com.gamezhero.api.as3
Section 67
//CampaignInfo (com.google.analytics.campaign.CampaignInfo)
package com.google.analytics.campaign {
import com.google.analytics.utils.*;
public class CampaignInfo {
private var _new:Boolean;
private var _empty:Boolean;
public function CampaignInfo(_arg1:Boolean=true, _arg2:Boolean=false){
_empty = _arg1;
_new = _arg2;
}
public function toURLString():String{
var _local1:Variables = toVariables();
return (_local1.toString());
}
public function isNew():Boolean{
return (_new);
}
public function get utmcn():String{
return ("1");
}
public function isEmpty():Boolean{
return (_empty);
}
public function toVariables():Variables{
var _local1:Variables = new Variables();
_local1.URIencode = true;
if (((!(isEmpty())) && (isNew()))){
_local1.utmcn = utmcn;
};
if (((!(isEmpty())) && (!(isNew())))){
_local1.utmcr = utmcr;
};
return (_local1);
}
public function get utmcr():String{
return ("1");
}
}
}//package com.google.analytics.campaign
Section 68
//CampaignKey (com.google.analytics.campaign.CampaignKey)
package com.google.analytics.campaign {
public class CampaignKey {
public var UCMD:String;// = "utm_medium"
public var UCID:String;// = "utm_id"
public var UCTR:String;// = "utm_term"
public var UCSR:String;// = "utm_source"
public var UCNO:String;// = "utm_nooverride"
public var UCCN:String;// = "utm_campaign"
public var UGCLID:String;// = "gclid"
public var UCCT:String;// = "utm_content"
}
}//package com.google.analytics.campaign
Section 69
//CampaignManager (com.google.analytics.campaign.CampaignManager)
package com.google.analytics.campaign {
import com.google.analytics.core.*;
import com.google.analytics.v4.*;
import com.google.analytics.debug.*;
import com.google.analytics.utils.*;
public class CampaignManager {
private var _config:Configuration;
private var _domainHash:Number;
private var _debug:DebugConfiguration;
private var _timeStamp:Number;
private var _referrer:String;
private var _buffer:Buffer;
public static const trackingDelimiter:String = "|";
public function CampaignManager(_arg1:Configuration, _arg2:DebugConfiguration, _arg3:Buffer, _arg4:Number, _arg5:String, _arg6:Number){
_config = _arg1;
_debug = _arg2;
_buffer = _arg3;
_domainHash = _arg4;
_referrer = _arg5;
_timeStamp = _arg6;
}
public function getCampaignInformation(_arg1:String, _arg2:Boolean):CampaignInfo{
var _local4:CampaignTracker;
var _local8:CampaignTracker;
var _local9:int;
var _local3:CampaignInfo = new CampaignInfo();
var _local5:Boolean;
var _local6:Boolean;
var _local7:int;
if (((_config.allowLinker) && (_buffer.isGenuine()))){
if (!_buffer.hasUTMZ()){
return (_local3);
};
};
_local4 = getTrackerFromSearchString(_arg1);
if (isValid(_local4)){
_local6 = hasNoOverride(_arg1);
if (((_local6) && (!(_buffer.hasUTMZ())))){
return (_local3);
};
};
if (!isValid(_local4)){
_local4 = getOrganicCampaign();
if (((!(_buffer.hasUTMZ())) && (isIgnoredKeyword(_local4)))){
return (_local3);
};
};
if (((!(isValid(_local4))) && (_arg2))){
_local4 = getReferrerCampaign();
if (((!(_buffer.hasUTMZ())) && (isIgnoredReferral(_local4)))){
return (_local3);
};
};
if (!isValid(_local4)){
if (((!(_buffer.hasUTMZ())) && (_arg2))){
_local4 = getDirectCampaign();
};
};
if (!isValid(_local4)){
return (_local3);
};
if (((_buffer.hasUTMZ()) && (!(_buffer.utmz.isEmpty())))){
_local8 = new CampaignTracker();
_local8.fromTrackerString(_buffer.utmz.campaignTracking);
_local5 = (_local8.toTrackerString() == _local4.toTrackerString());
_local7 = _buffer.utmz.responseCount;
};
if (((!(_local5)) || (_arg2))){
_local9 = _buffer.utma.sessionCount;
_local7++;
if (_local9 == 0){
_local9 = 1;
};
_buffer.utmz.domainHash = _domainHash;
_buffer.utmz.campaignCreation = _timeStamp;
_buffer.utmz.campaignSessions = _local9;
_buffer.utmz.responseCount = _local7;
_buffer.utmz.campaignTracking = _local4.toTrackerString();
_debug.info(_buffer.utmz.toString(), VisualDebugMode.geek);
_local3 = new CampaignInfo(false, true);
} else {
_local3 = new CampaignInfo(false, false);
};
return (_local3);
}
public function hasNoOverride(_arg1:String):Boolean{
var _local2:CampaignKey = _config.campaignKey;
if (_arg1 == ""){
return (false);
};
var _local3:Variables = new Variables(_arg1);
var _local4 = "";
if (_local3.hasOwnProperty(_local2.UCNO)){
_local4 = _local3[_local2.UCNO];
switch (_local4){
case "1":
return (true);
case "":
case "0":
default:
return (false);
};
};
return (false);
}
public function getTrackerFromSearchString(_arg1:String):CampaignTracker{
var _local2:CampaignTracker = getOrganicCampaign();
var _local3:CampaignTracker = new CampaignTracker();
var _local4:CampaignKey = _config.campaignKey;
if (_arg1 == ""){
return (_local3);
};
var _local5:Variables = new Variables(_arg1);
if (_local5.hasOwnProperty(_local4.UCID)){
_local3.id = _local5[_local4.UCID];
};
if (_local5.hasOwnProperty(_local4.UCSR)){
_local3.source = _local5[_local4.UCSR];
};
if (_local5.hasOwnProperty(_local4.UGCLID)){
_local3.clickId = _local5[_local4.UGCLID];
};
if (_local5.hasOwnProperty(_local4.UCCN)){
_local3.name = _local5[_local4.UCCN];
} else {
_local3.name = "(not set)";
};
if (_local5.hasOwnProperty(_local4.UCMD)){
_local3.medium = _local5[_local4.UCMD];
} else {
_local3.medium = "(not set)";
};
if (_local5.hasOwnProperty(_local4.UCTR)){
_local3.term = _local5[_local4.UCTR];
} else {
if (((_local2) && (!((_local2.term == ""))))){
_local3.term = _local2.term;
};
};
if (_local5.hasOwnProperty(_local4.UCCT)){
_local3.content = _local5[_local4.UCCT];
};
return (_local3);
}
public function getOrganicCampaign():CampaignTracker{
var _local1:CampaignTracker;
var _local4:Array;
var _local5:OrganicReferrer;
var _local6:String;
if (((isInvalidReferrer(_referrer)) || (isFromGoogleCSE(_referrer, _config)))){
return (_local1);
};
var _local2:URL = new URL(_referrer);
var _local3 = "";
if (_local2.hostName != ""){
if (_local2.hostName.indexOf(".") > -1){
_local4 = _local2.hostName.split(".");
switch (_local4.length){
case 2:
_local3 = _local4[0];
break;
case 3:
_local3 = _local4[1];
break;
};
};
};
if (_config.organic.match(_local3)){
_local5 = _config.organic.getReferrerByName(_local3);
_local6 = _config.organic.getKeywordValue(_local5, _local2.search);
_local1 = new CampaignTracker();
_local1.source = _local5.engine;
_local1.name = "(organic)";
_local1.medium = "organic";
_local1.term = _local6;
};
return (_local1);
}
public function getDirectCampaign():CampaignTracker{
var _local1:CampaignTracker = new CampaignTracker();
_local1.source = "(direct)";
_local1.name = "(direct)";
_local1.medium = "(none)";
return (_local1);
}
public function isIgnoredKeyword(_arg1:CampaignTracker):Boolean{
if (((_arg1) && ((_arg1.medium == "organic")))){
return (_config.organic.isIgnoredKeyword(_arg1.term));
};
return (false);
}
public function isIgnoredReferral(_arg1:CampaignTracker):Boolean{
if (((_arg1) && ((_arg1.medium == "referral")))){
return (_config.organic.isIgnoredReferral(_arg1.source));
};
return (false);
}
public function isValid(_arg1:CampaignTracker):Boolean{
if (((_arg1) && (_arg1.isValid()))){
return (true);
};
return (false);
}
public function getReferrerCampaign():CampaignTracker{
var _local1:CampaignTracker;
if (((isInvalidReferrer(_referrer)) || (isFromGoogleCSE(_referrer, _config)))){
return (_local1);
};
var _local2:URL = new URL(_referrer);
var _local3:String = _local2.hostName;
var _local4:String = _local2.path;
if (_local3.indexOf("www.") == 0){
_local3 = _local3.substr(4);
};
_local1 = new CampaignTracker();
_local1.source = _local3;
_local1.name = "(referral)";
_local1.medium = "referral";
_local1.content = _local4;
return (_local1);
}
public static function isInvalidReferrer(_arg1:String):Boolean{
var _local2:URL;
if ((((((_arg1 == "")) || ((_arg1 == "-")))) || ((_arg1 == "0")))){
return (true);
};
if (_arg1.indexOf("://") > -1){
_local2 = new URL(_arg1);
if ((((_local2.protocol == Protocols.file)) || ((_local2.protocol == Protocols.none)))){
return (true);
};
};
return (false);
}
public static function isFromGoogleCSE(_arg1:String, _arg2:Configuration):Boolean{
var _local3:URL = new URL(_arg1);
if (_local3.hostName.indexOf(_arg2.google) > -1){
if (_local3.search.indexOf((_arg2.googleSearchParam + "=")) > -1){
if (_local3.path == ("/" + _arg2.googleCsePath)){
return (true);
};
};
};
return (false);
}
}
}//package com.google.analytics.campaign
Section 70
//CampaignTracker (com.google.analytics.campaign.CampaignTracker)
package com.google.analytics.campaign {
import com.google.analytics.utils.*;
public class CampaignTracker {
public var content:String;
public var source:String;
public var clickId:String;
public var name:String;
public var term:String;
public var medium:String;
public var id:String;
public function CampaignTracker(_arg1:String="", _arg2:String="", _arg3:String="", _arg4:String="", _arg5:String="", _arg6:String="", _arg7:String=""){
this.id = _arg1;
this.source = _arg2;
this.clickId = _arg3;
this.name = _arg4;
this.medium = _arg5;
this.term = _arg6;
this.content = _arg7;
}
public function isValid():Boolean{
if (((((!((id == ""))) || (!((source == ""))))) || (!((clickId == ""))))){
return (true);
};
return (false);
}
public function toTrackerString():String{
var _local1:Array = [];
_addIfNotEmpty(_local1, "utmcid=", id);
_addIfNotEmpty(_local1, "utmcsr=", source);
_addIfNotEmpty(_local1, "utmgclid=", clickId);
_addIfNotEmpty(_local1, "utmccn=", name);
_addIfNotEmpty(_local1, "utmcmd=", medium);
_addIfNotEmpty(_local1, "utmctr=", term);
_addIfNotEmpty(_local1, "utmcct=", content);
return (_local1.join(CampaignManager.trackingDelimiter));
}
private function _addIfNotEmpty(_arg1:Array, _arg2:String, _arg3:String):void{
if (_arg3 != ""){
_arg3 = _arg3.split("+").join("%20");
_arg3 = _arg3.split(" ").join("%20");
_arg1.push((_arg2 + _arg3));
};
}
public function fromTrackerString(_arg1:String):void{
var _local2:String = _arg1.split(CampaignManager.trackingDelimiter).join("&");
var _local3:Variables = new Variables(_local2);
if (_local3.hasOwnProperty("utmcid")){
this.id = _local3["utmcid"];
};
if (_local3.hasOwnProperty("utmcsr")){
this.source = _local3["utmcsr"];
};
if (_local3.hasOwnProperty("utmccn")){
this.name = _local3["utmccn"];
};
if (_local3.hasOwnProperty("utmcmd")){
this.medium = _local3["utmcmd"];
};
if (_local3.hasOwnProperty("utmctr")){
this.term = _local3["utmctr"];
};
if (_local3.hasOwnProperty("utmcct")){
this.content = _local3["utmcct"];
};
if (_local3.hasOwnProperty("utmgclid")){
this.clickId = _local3["utmgclid"];
};
}
}
}//package com.google.analytics.campaign
Section 71
//BrowserInfo (com.google.analytics.core.BrowserInfo)
package com.google.analytics.core {
import com.google.analytics.v4.*;
import com.google.analytics.utils.*;
public class BrowserInfo {
private var _config:Configuration;
private var _info:Environment;
public function BrowserInfo(_arg1:Configuration, _arg2:Environment){
_config = _arg1;
_info = _arg2;
}
public function get utmul():String{
return (_info.language.toLowerCase());
}
public function get utmje():String{
return ("0");
}
public function toURLString():String{
var _local1:Variables = toVariables();
return (_local1.toString());
}
public function get utmsr():String{
return (((_info.screenWidth + "x") + _info.screenHeight));
}
public function get utmfl():String{
var _local1:Version;
if (_config.detectFlash){
_local1 = _info.flashVersion;
return (((((_local1.major + ".") + _local1.minor) + " r") + _local1.build));
};
return ("-");
}
public function get utmcs():String{
return (_info.languageEncoding);
}
public function toVariables():Variables{
var _local1:Variables = new Variables();
_local1.URIencode = true;
_local1.utmcs = utmcs;
_local1.utmsr = utmsr;
_local1.utmsc = utmsc;
_local1.utmul = utmul;
_local1.utmje = utmje;
_local1.utmfl = utmfl;
return (_local1);
}
public function get utmsc():String{
return ((_info.screenColorDepth + "-bit"));
}
}
}//package com.google.analytics.core
Section 72
//Buffer (com.google.analytics.core.Buffer)
package com.google.analytics.core {
import flash.events.*;
import com.google.analytics.v4.*;
import com.google.analytics.debug.*;
import flash.net.*;
import com.google.analytics.data.*;
public dynamic class Buffer {
private var _SO:SharedObject;
private var _data:Object;
private var _OBJ:Object;
private var _utmb:UTMB;
private var _utmc:UTMC;
private var _utma:UTMA;
private var _debug:DebugConfiguration;
private var _utmk:UTMK;
private var _config:Configuration;
private var _utmv:UTMV;
private var _utmx:UTMX;
private var _utmz:UTMZ;
private var _volatile:Boolean;
public function Buffer(_arg1:Configuration, _arg2:DebugConfiguration, _arg3:Boolean=false, _arg4:Object=null){
var _local5:String;
super();
_config = _arg1;
_debug = _arg2;
_data = _arg4;
_volatile = _arg3;
if (_volatile){
_OBJ = new Object();
if (_data){
for (_local5 in _data) {
_OBJ[_local5] = _data[_local5];
};
};
};
}
public function save():void{
var flushStatus:String;
if (!isVolatile()){
flushStatus = null;
try {
flushStatus = _SO.flush();
} catch(e:Error) {
_debug.warning("Error...Could not write SharedObject to disk");
};
switch (flushStatus){
case SharedObjectFlushStatus.PENDING:
_debug.info("Requesting permission to save object...");
_SO.addEventListener(NetStatusEvent.NET_STATUS, _onFlushStatus);
break;
case SharedObjectFlushStatus.FLUSHED:
_debug.info("Value flushed to disk.");
break;
};
};
}
public function get utmv():UTMV{
if (!hasUTMV()){
_createUMTV();
};
return (_utmv);
}
public function get utmx():UTMX{
if (!hasUTMX()){
_createUMTX();
};
return (_utmx);
}
public function get utmz():UTMZ{
if (!hasUTMZ()){
_createUMTZ();
};
return (_utmz);
}
public function hasUTMA():Boolean{
if (_utma){
return (true);
};
return (false);
}
public function hasUTMB():Boolean{
if (_utmb){
return (true);
};
return (false);
}
public function hasUTMC():Boolean{
if (_utmc){
return (true);
};
return (false);
}
public function clearCookies():void{
utma.reset();
utmb.reset();
utmc.reset();
utmz.reset();
utmv.reset();
utmk.reset();
}
public function resetCurrentSession():void{
_clearUTMB();
_clearUTMC();
save();
}
public function hasUTMK():Boolean{
if (_utmk){
return (true);
};
return (false);
}
public function getLinkerUrl(_arg1:String="", _arg2:Boolean=false):String{
var _local3:String = toLinkerParams();
var _local4:String = _arg1;
var _local5:Array = _arg1.split("#");
if (_local3){
if (_arg2){
if (1 >= _local5.length){
_local4 = (_local4 + ("#" + _local3));
} else {
_local4 = (_local4 + ("&" + _local3));
};
} else {
if (1 >= _local5.length){
if (_arg1.indexOf("?") > -1){
_local4 = (_local4 + "&");
} else {
_local4 = (_local4 + "?");
};
_local4 = (_local4 + _local3);
} else {
_local4 = _local5[0];
if (_arg1.indexOf("?") > -1){
_local4 = (_local4 + "&");
} else {
_local4 = (_local4 + "?");
};
_local4 = (_local4 + ((_local3 + "#") + _local5[1]));
};
};
};
return (_local4);
}
public function generateCookiesHash():Number{
var _local1 = "";
_local1 = (_local1 + utma.valueOf());
_local1 = (_local1 + utmb.valueOf());
_local1 = (_local1 + utmc.valueOf());
_local1 = (_local1 + utmx.valueOf());
_local1 = (_local1 + utmz.valueOf());
_local1 = (_local1 + utmv.valueOf());
return (Utils.generateHash(_local1));
}
private function _createUMTA():void{
_utma = new UTMA();
_utma.proxy = this;
}
private function _createUMTB():void{
_utmb = new UTMB();
_utmb.proxy = this;
}
private function _createUMTC():void{
_utmc = new UTMC();
}
public function hasUTMV():Boolean{
if (_utmv){
return (true);
};
return (false);
}
private function _createUMTK():void{
_utmk = new UTMK();
_utmk.proxy = this;
}
public function hasUTMX():Boolean{
if (_utmx){
return (true);
};
return (false);
}
public function hasUTMZ():Boolean{
if (_utmz){
return (true);
};
return (false);
}
private function _createUMTV():void{
_utmv = new UTMV();
_utmv.proxy = this;
}
private function _createUMTX():void{
_utmx = new UTMX();
_utmx.proxy = this;
}
private function _createUMTZ():void{
_utmz = new UTMZ();
_utmz.proxy = this;
}
public function updateUTMA(_arg1:Number):void{
if (_debug.verbose){
_debug.info((("updateUTMA( " + _arg1) + " )"), VisualDebugMode.advanced);
};
if (!utma.isEmpty()){
if (isNaN(utma.sessionCount)){
utma.sessionCount = 1;
} else {
utma.sessionCount = (utma.sessionCount + 1);
};
utma.lastTime = utma.currentTime;
utma.currentTime = _arg1;
};
}
public function isGenuine():Boolean{
if (!hasUTMK()){
return (true);
};
return ((utmk.hash == generateCookiesHash()));
}
private function _onFlushStatus(_arg1:NetStatusEvent):void{
_debug.info("User closed permission dialog...");
switch (_arg1.info.code){
case "SharedObject.Flush.Success":
_debug.info("User granted permission -- value saved.");
break;
case "SharedObject.Flush.Failed":
_debug.info("User denied permission -- value not saved.");
break;
};
_SO.removeEventListener(NetStatusEvent.NET_STATUS, _onFlushStatus);
}
public function toLinkerParams():String{
var _local1 = "";
_local1 = (_local1 + utma.toURLString());
_local1 = (_local1 + ("&" + utmb.toURLString()));
_local1 = (_local1 + ("&" + utmc.toURLString()));
_local1 = (_local1 + ("&" + utmx.toURLString()));
_local1 = (_local1 + ("&" + utmz.toURLString()));
_local1 = (_local1 + ("&" + utmv.toURLString()));
_local1 = (_local1 + ("&__utmk=" + generateCookiesHash()));
return (_local1);
}
private function _clearUTMA():void{
_utma = null;
if (!isVolatile()){
_SO.data.utma = null;
delete _SO.data.utma;
};
}
private function _clearUTMC():void{
_utmc = null;
}
private function _clearUTMB():void{
_utmb = null;
if (!isVolatile()){
_SO.data.utmb = null;
delete _SO.data.utmb;
};
}
public function update(_arg1:String, _arg2):void{
if (isVolatile()){
_OBJ[_arg1] = _arg2;
} else {
_SO.data[_arg1] = _arg2;
};
}
public function createSO():void{
var saveSO:Boolean;
UTMZ.defaultTimespan = _config.conversionTimeout;
UTMB.defaultTimespan = _config.sessionTimeout;
if (!_volatile){
try {
_SO = SharedObject.getLocal(_config.cookieName, _config.cookiePath);
} catch(e:Error) {
if (_debug.active){
_debug.warning(((("Shared Object " + _config.cookieName) + " failed to be set\nreason: ") + e.message));
};
};
saveSO = false;
if (_SO.data.utma){
if (!hasUTMA()){
_createUMTA();
};
_utma.fromSharedObject(_SO.data.utma);
if (_debug.verbose){
_debug.info(("found: " + _utma.toString(true)), VisualDebugMode.geek);
};
if (_utma.isExpired()){
if (_debug.verbose){
_debug.warning("UTMA has expired", VisualDebugMode.advanced);
};
_clearUTMA();
saveSO = true;
};
};
if (_SO.data.utmb){
if (!hasUTMB()){
_createUMTB();
};
_utmb.fromSharedObject(_SO.data.utmb);
if (_debug.verbose){
_debug.info(("found: " + _utmb.toString(true)), VisualDebugMode.geek);
};
if (_utmb.isExpired()){
if (_debug.verbose){
_debug.warning("UTMB has expired", VisualDebugMode.advanced);
};
_clearUTMB();
saveSO = true;
};
};
if (_SO.data.utmc){
delete _SO.data.utmc;
saveSO = true;
};
if (_SO.data.utmk){
if (!hasUTMK()){
_createUMTK();
};
_utmk.fromSharedObject(_SO.data.utmk);
if (_debug.verbose){
_debug.info(("found: " + _utmk.toString()), VisualDebugMode.geek);
};
};
if (!hasUTMX()){
_createUMTX();
};
if (_SO.data.utmv){
if (!hasUTMV()){
_createUMTV();
};
_utmv.fromSharedObject(_SO.data.utmv);
if (_debug.verbose){
_debug.info(("found: " + _utmv.toString(true)), VisualDebugMode.geek);
};
if (_utmv.isExpired()){
if (_debug.verbose){
_debug.warning("UTMV has expired", VisualDebugMode.advanced);
};
_clearUTMV();
saveSO = true;
};
};
if (_SO.data.utmz){
if (!hasUTMZ()){
_createUMTZ();
};
_utmz.fromSharedObject(_SO.data.utmz);
if (_debug.verbose){
_debug.info(("found: " + _utmz.toString(true)), VisualDebugMode.geek);
};
if (_utmz.isExpired()){
if (_debug.verbose){
_debug.warning("UTMZ has expired", VisualDebugMode.advanced);
};
_clearUTMZ();
saveSO = true;
};
};
if (saveSO){
save();
};
};
}
private function _clearUTMZ():void{
_utmz = null;
if (!isVolatile()){
_SO.data.utmz = null;
delete _SO.data.utmz;
};
}
private function _clearUTMV():void{
_utmv = null;
if (!isVolatile()){
_SO.data.utmv = null;
delete _SO.data.utmv;
};
}
public function isVolatile():Boolean{
return (_volatile);
}
public function get utma():UTMA{
if (!hasUTMA()){
_createUMTA();
};
return (_utma);
}
public function get utmb():UTMB{
if (!hasUTMB()){
_createUMTB();
};
return (_utmb);
}
public function get utmc():UTMC{
if (!hasUTMC()){
_createUMTC();
};
return (_utmc);
}
public function get utmk():UTMK{
if (!hasUTMK()){
_createUMTK();
};
return (_utmk);
}
}
}//package com.google.analytics.core
Section 73
//DocumentInfo (com.google.analytics.core.DocumentInfo)
package com.google.analytics.core {
import com.google.analytics.v4.*;
import com.google.analytics.external.*;
import com.google.analytics.utils.*;
public class DocumentInfo {
private var _pageURL:String;
private var _utmr:String;
private var _config:Configuration;
private var _adSense:AdSenseGlobals;
private var _info:Environment;
public function DocumentInfo(_arg1:Configuration, _arg2:Environment, _arg3:String, _arg4:String=null, _arg5:AdSenseGlobals=null){
_config = _arg1;
_info = _arg2;
_utmr = _arg3;
_pageURL = _arg4;
_adSense = _arg5;
}
public function get utmr():String{
if (!_utmr){
return ("-");
};
return (_utmr);
}
public function toURLString():String{
var _local1:Variables = toVariables();
return (_local1.toString());
}
private function _renderPageURL(_arg1:String=""):String{
var _local2:String = _info.locationPath;
var _local3:String = _info.locationSearch;
if (((!(_arg1)) || ((_arg1 == "")))){
_arg1 = (_local2 + unescape(_local3));
if (_arg1 == ""){
_arg1 = "/";
};
};
return (_arg1);
}
public function get utmp():String{
return (_renderPageURL(_pageURL));
}
public function get utmhid():String{
return (String(_generateHitId()));
}
private function _generateHitId():Number{
var _local1:Number;
if (((_adSense.hid) && (!((_adSense.hid == ""))))){
_local1 = Number(_adSense.hid);
} else {
_local1 = Math.round((Math.random() * 2147483647));
_adSense.hid = String(_local1);
};
return (_local1);
}
public function toVariables():Variables{
var _local1:Variables = new Variables();
_local1.URIencode = true;
if (((_config.detectTitle) && (!((utmdt == ""))))){
_local1.utmdt = utmdt;
};
_local1.utmhid = utmhid;
_local1.utmr = utmr;
_local1.utmp = utmp;
return (_local1);
}
public function get utmdt():String{
return (_info.documentTitle);
}
}
}//package com.google.analytics.core
Section 74
//Domain (com.google.analytics.core.Domain)
package com.google.analytics.core {
import com.google.analytics.debug.*;
public class Domain {
private var _mode:DomainNameMode;
private var _debug:DebugConfiguration;
private var _name:String;
public function Domain(_arg1:DomainNameMode=null, _arg2:String="", _arg3:DebugConfiguration=null){
_debug = _arg3;
if (_arg1 == null){
_arg1 = DomainNameMode.auto;
};
_mode = _arg1;
if (_arg1 == DomainNameMode.custom){
this.name = _arg2;
} else {
_name = _arg2;
};
}
public function get mode():DomainNameMode{
return (_mode);
}
public function set mode(_arg1:DomainNameMode):void{
_mode = _arg1;
if (_mode == DomainNameMode.none){
_name = "";
};
}
public function get name():String{
return (_name);
}
public function set name(_arg1:String):void{
if (((!((_arg1.charAt(0) == "."))) && (_debug))){
_debug.warning(("missing leading period \".\", cookie will only be accessible on " + _arg1), VisualDebugMode.geek);
};
_name = _arg1;
}
}
}//package com.google.analytics.core
Section 75
//DomainNameMode (com.google.analytics.core.DomainNameMode)
package com.google.analytics.core {
public class DomainNameMode {
private var _value:int;
private var _name:String;
public static const custom:DomainNameMode = new DomainNameMode(2, "custom");
;
public static const none:DomainNameMode = new DomainNameMode(0, "none");
;
public static const auto:DomainNameMode = new DomainNameMode(1, "auto");
;
public function DomainNameMode(_arg1:int=0, _arg2:String=""){
_value = _arg1;
_name = _arg2;
}
public function valueOf():int{
return (_value);
}
public function toString():String{
return (_name);
}
}
}//package com.google.analytics.core
Section 76
//Ecommerce (com.google.analytics.core.Ecommerce)
package com.google.analytics.core {
import com.google.analytics.debug.*;
import com.google.analytics.ecommerce.*;
public class Ecommerce {
private var _debug:DebugConfiguration;
private var _trans:Array;
public function Ecommerce(_arg1:DebugConfiguration){
this._debug = _arg1;
_trans = new Array();
}
public function getTransLength():Number{
return (_trans.length);
}
public function getTransFromArray(_arg1:Number):Transaction{
return (_trans[_arg1]);
}
public function addTransaction(_arg1:String, _arg2:String, _arg3:String, _arg4:String, _arg5:String, _arg6:String, _arg7:String, _arg8:String):Transaction{
var _local9:Transaction;
_local9 = getTransaction(_arg1);
if (_local9 == null){
_local9 = new Transaction(_arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8);
_trans.push(_local9);
} else {
_local9.affiliation = _arg2;
_local9.total = _arg3;
_local9.tax = _arg4;
_local9.shipping = _arg5;
_local9.city = _arg6;
_local9.state = _arg7;
_local9.country = _arg8;
};
return (_local9);
}
public function getTransaction(_arg1:String):Transaction{
var _local2:Number;
_local2 = 0;
while (_local2 < _trans.length) {
if (_trans[_local2].id == _arg1){
return (_trans[_local2]);
};
_local2++;
};
return (null);
}
}
}//package com.google.analytics.core
Section 77
//EventInfo (com.google.analytics.core.EventInfo)
package com.google.analytics.core {
import com.google.analytics.data.*;
import com.google.analytics.utils.*;
public class EventInfo {
private var _ext10:X10;
private var _isEventHit:Boolean;
private var _x10:X10;
public function EventInfo(_arg1:Boolean, _arg2:X10, _arg3:X10=null){
_isEventHit = _arg1;
_x10 = _arg2;
_ext10 = _arg3;
}
public function toURLString():String{
var _local1:Variables = toVariables();
return (_local1.toString());
}
public function get utmt():String{
return ("event");
}
public function get utme():String{
return (_x10.renderMergedUrlString(_ext10));
}
public function toVariables():Variables{
var _local1:Variables = new Variables();
_local1.URIencode = true;
if (_isEventHit){
_local1.utmt = utmt;
};
_local1.utme = utme;
return (_local1);
}
}
}//package com.google.analytics.core
Section 78
//EventTracker (com.google.analytics.core.EventTracker)
package com.google.analytics.core {
import com.google.analytics.v4.*;
public class EventTracker {
private var _parent:GoogleAnalyticsAPI;
public var name:String;
public function EventTracker(_arg1:String, _arg2:GoogleAnalyticsAPI){
this.name = _arg1;
_parent = _arg2;
}
public function trackEvent(_arg1:String, _arg2:String=null, _arg3:Number=NaN):Boolean{
return (_parent.trackEvent(name, _arg1, _arg2, _arg3));
}
}
}//package com.google.analytics.core
Section 79
//ga_internal (com.google.analytics.core.ga_internal)
package com.google.analytics.core {
public namespace ga_internal;
}//package com.google.analytics.core
Section 80
//GIFRequest (com.google.analytics.core.GIFRequest)
package com.google.analytics.core {
import flash.display.*;
import flash.events.*;
import com.google.analytics.v4.*;
import com.google.analytics.debug.*;
import flash.net.*;
import com.google.analytics.utils.*;
import flash.system.*;
public class GIFRequest {
private var _info:Environment;
private var _count:int;
private var _utmac:String;
private var _alertcount:int;
private var _debug:DebugConfiguration;
private var _lastRequest:URLRequest;
private var _buffer:Buffer;
private var _config:Configuration;
private var _requests:Array;
public function GIFRequest(_arg1:Configuration, _arg2:DebugConfiguration, _arg3:Buffer, _arg4:Environment){
_config = _arg1;
_debug = _arg2;
_buffer = _arg3;
_info = _arg4;
_count = 0;
_alertcount = 0;
_requests = [];
}
public function get utmn():String{
return ((Utils.generate32bitRandom() as String));
}
public function onIOError(_arg1:IOErrorEvent):void{
var _local2:String = _lastRequest.url;
var _local3:String = String((_requests.length - 1));
var _local4 = (("Gif Request #" + _local3) + " failed");
if (_debug.GIFRequests){
if (!_debug.verbose){
if (_local2.indexOf("?") > -1){
_local2 = _local2.split("?")[0];
};
_local2 = _shortenURL(_local2);
};
if (int(_debug.mode) > int(VisualDebugMode.basic)){
_local4 = (_local4 + ((" \"" + _local2) + "\" does not exists or is unreachable"));
};
_debug.failure(_local4);
} else {
_debug.warning(_local4);
};
_removeListeners(_arg1.target);
}
public function send(_arg1:String, _arg2:Variables=null, _arg3:Boolean=false, _arg4:Boolean=false):void{
var _local5:String;
var _local6:URLRequest;
var _local7:URLRequest;
_utmac = _arg1;
if (!_arg2){
_arg2 = new Variables();
};
_arg2.URIencode = false;
_arg2.pre = ["utmwv", "utmn", "utmhn", "utmt", "utme", "utmcs", "utmsr", "utmsc", "utmul", "utmje", "utmfl", "utmdt", "utmhid", "utmr", "utmp"];
_arg2.post = ["utmcc"];
if (_debug.verbose){
_debug.info(((("tracking: " + _buffer.utmb.trackCount) + "/") + _config.trackingLimitPerSession), VisualDebugMode.geek);
};
if ((((_buffer.utmb.trackCount < _config.trackingLimitPerSession)) || (_arg3))){
if (_arg4){
updateToken();
};
if (((((_arg3) || (!(_arg4)))) || ((_buffer.utmb.token >= 1)))){
if (((!(_arg3)) && (_arg4))){
_buffer.utmb.token = (_buffer.utmb.token - 1);
};
_buffer.utmb.trackCount = (_buffer.utmb.trackCount + 1);
if (_debug.verbose){
_debug.info(_buffer.utmb.toString(), VisualDebugMode.geek);
};
_arg2.utmwv = utmwv;
_arg2.utmn = Utils.generate32bitRandom();
if (_info.domainName != ""){
_arg2.utmhn = _info.domainName;
};
if (_config.sampleRate < 1){
_arg2.utmsp = (_config.sampleRate * 100);
};
if ((((_config.serverMode == ServerOperationMode.local)) || ((_config.serverMode == ServerOperationMode.both)))){
_local5 = _info.locationSWFPath;
if (_local5.lastIndexOf("/") > 0){
_local5 = _local5.substring(0, _local5.lastIndexOf("/"));
};
_local6 = new URLRequest();
if (_config.localGIFpath.indexOf("http") == 0){
_local6.url = _config.localGIFpath;
} else {
_local6.url = (_local5 + _config.localGIFpath);
};
_local6.url = (_local6.url + ("?" + _arg2.toString()));
if (((_debug.active) && (_debug.GIFRequests))){
_debugSend(_local6);
} else {
sendRequest(_local6);
};
};
if ((((_config.serverMode == ServerOperationMode.remote)) || ((_config.serverMode == ServerOperationMode.both)))){
_local7 = new URLRequest();
if (_info.protocol == Protocols.HTTPS){
_local7.url = _config.secureRemoteGIFpath;
} else {
if (_info.protocol == Protocols.HTTP){
_local7.url = _config.remoteGIFpath;
} else {
_local7.url = _config.remoteGIFpath;
};
};
_arg2.utmac = utmac;
_arg2.utmcc = encodeURIComponent(utmcc);
_local7.url = (_local7.url + ("?" + _arg2.toString()));
if (((_debug.active) && (_debug.GIFRequests))){
_debugSend(_local7);
} else {
sendRequest(_local7);
};
};
};
};
}
public function onSecurityError(_arg1:SecurityErrorEvent):void{
if (_debug.GIFRequests){
_debug.failure(_arg1.text);
};
}
public function get utmsp():String{
return (((_config.sampleRate * 100) as String));
}
public function get utmcc():String{
var _local1:Array = [];
if (_buffer.hasUTMA()){
_local1.push((_buffer.utma.toURLString() + ";"));
};
if (_buffer.hasUTMZ()){
_local1.push((_buffer.utmz.toURLString() + ";"));
};
if (_buffer.hasUTMV()){
_local1.push((_buffer.utmv.toURLString() + ";"));
};
return (_local1.join("+"));
}
public function get utmac():String{
return (_utmac);
}
public function get utmwv():String{
return (_config.version);
}
public function sendRequest(_arg1:URLRequest):void{
var request = _arg1;
var loader:Loader = new Loader();
loader.name = String(_count++);
var context:LoaderContext = new LoaderContext(false);
loader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, onIOError);
loader.contentLoaderInfo.addEventListener(Event.COMPLETE, onComplete);
_lastRequest = request;
_requests[loader.name] = new RequestObject(request);
try {
loader.load(request, context);
} catch(e:Error) {
_debug.failure("\"Loader.load()\" could not instanciate Gif Request");
};
}
private function _removeListeners(_arg1:Object):void{
_arg1.removeEventListener(IOErrorEvent.IO_ERROR, onIOError);
_arg1.removeEventListener(Event.COMPLETE, onComplete);
}
public function updateToken():void{
var _local2:Number;
var _local1:Number = new Date().getTime();
_local2 = ((_local1 - _buffer.utmb.lastTime) * (_config.tokenRate / 1000));
if (_debug.verbose){
_debug.info(("tokenDelta: " + _local2), VisualDebugMode.geek);
};
if (_local2 >= 1){
_buffer.utmb.token = Math.min(Math.floor((_buffer.utmb.token + _local2)), _config.bucketCapacity);
_buffer.utmb.lastTime = _local1;
if (_debug.verbose){
_debug.info(_buffer.utmb.toString(), VisualDebugMode.geek);
};
};
}
public function get utmhn():String{
return (_info.domainName);
}
private function _shortenURL(_arg1:String):String{
var _local2:Array;
if (_arg1.length > 60){
_local2 = _arg1.split("/");
while (_arg1.length > 60) {
_local2.shift();
_arg1 = ("../" + _local2.join("/"));
};
};
return (_arg1);
}
private function _debugSend(_arg1:URLRequest):void{
var _local3:String;
var _local2 = "";
switch (_debug.mode){
case VisualDebugMode.geek:
_local2 = ((("Gif Request #" + _alertcount) + ":\n") + _arg1.url);
break;
case VisualDebugMode.advanced:
_local3 = _arg1.url;
if (_local3.indexOf("?") > -1){
_local3 = _local3.split("?")[0];
};
_local3 = _shortenURL(_local3);
_local2 = (((("Send Gif Request #" + _alertcount) + ":\n") + _local3) + " ?");
break;
case VisualDebugMode.basic:
default:
_local2 = (((("Send " + _config.serverMode.toString()) + " Gif Request #") + _alertcount) + " ?");
};
_debug.alertGifRequest(_local2, _arg1, this);
_alertcount++;
}
public function onComplete(_arg1:Event):void{
var _local2:String = _arg1.target.loader.name;
_requests[_local2].complete();
var _local3 = (("Gif Request #" + _local2) + " sent");
var _local4:String = _requests[_local2].request.url;
if (_debug.GIFRequests){
if (!_debug.verbose){
if (_local4.indexOf("?") > -1){
_local4 = _local4.split("?")[0];
};
_local4 = _shortenURL(_local4);
};
if (int(_debug.mode) > int(VisualDebugMode.basic)){
_local3 = (_local3 + ((" to \"" + _local4) + "\""));
};
_debug.success(_local3);
} else {
_debug.info(_local3);
};
_removeListeners(_arg1.target);
}
}
}//package com.google.analytics.core
Section 81
//IdleTimer (com.google.analytics.core.IdleTimer)
package com.google.analytics.core {
import flash.display.*;
import flash.events.*;
import com.google.analytics.v4.*;
import com.google.analytics.debug.*;
import flash.utils.*;
public class IdleTimer {
private var _stage:Stage;
private var _loop:Timer;
private var _lastMove:int;
private var _inactivity:Number;
private var _debug:DebugConfiguration;
private var _session:Timer;
private var _buffer:Buffer;
public function IdleTimer(_arg1:Configuration, _arg2:DebugConfiguration, _arg3:DisplayObject, _arg4:Buffer){
var _local5:Number = _arg1.idleLoop;
var _local6:Number = _arg1.idleTimeout;
var _local7:Number = _arg1.sessionTimeout;
_loop = new Timer((_local5 * 1000));
_session = new Timer((_local7 * 1000), 1);
_debug = _arg2;
_stage = _arg3.stage;
_buffer = _arg4;
_lastMove = getTimer();
_inactivity = (_local6 * 1000);
_loop.addEventListener(TimerEvent.TIMER, checkForIdle);
_session.addEventListener(TimerEvent.TIMER_COMPLETE, endSession);
_stage.addEventListener(MouseEvent.MOUSE_MOVE, onMouseMove);
_debug.info(((((("delay: " + _local5) + "sec , inactivity: ") + _local6) + "sec, sessionTimeout: ") + _local7), VisualDebugMode.geek);
_loop.start();
}
private function onMouseMove(_arg1:MouseEvent):void{
_lastMove = getTimer();
if (_session.running){
_debug.info("session timer reset", VisualDebugMode.geek);
_session.reset();
};
}
public function endSession(_arg1:TimerEvent):void{
_session.removeEventListener(TimerEvent.TIMER_COMPLETE, endSession);
_debug.info("session timer end session", VisualDebugMode.geek);
_session.reset();
_buffer.resetCurrentSession();
_debug.info(_buffer.utmb.toString(), VisualDebugMode.geek);
_debug.info(_buffer.utmc.toString(), VisualDebugMode.geek);
_session.addEventListener(TimerEvent.TIMER_COMPLETE, endSession);
}
public function checkForIdle(_arg1:TimerEvent):void{
var _local2:int = getTimer();
if ((_local2 - _lastMove) >= _inactivity){
if (!_session.running){
_debug.info("session timer start", VisualDebugMode.geek);
_session.start();
};
};
}
}
}//package com.google.analytics.core
Section 82
//Organic (com.google.analytics.core.Organic)
package com.google.analytics.core {
import com.google.analytics.utils.*;
public class Organic {
private var _sourcesCache:Array;
private var _sourcesEngine:Array;
private var _ignoredKeywords:Array;
private var _ignoredReferralsCache:Object;
private var _ignoredReferrals:Array;
private var _ignoredKeywordsCache:Object;
private var _sources:Array;
public static var throwErrors:Boolean = false;
public function Organic(){
_sources = [];
_sourcesCache = [];
_sourcesEngine = [];
_ignoredReferrals = [];
_ignoredReferralsCache = {};
_ignoredKeywords = [];
_ignoredKeywordsCache = {};
}
public function isIgnoredKeyword(_arg1:String):Boolean{
if (_ignoredKeywordsCache.hasOwnProperty(_arg1)){
return (true);
};
return (false);
}
public function getKeywordValue(_arg1:OrganicReferrer, _arg2:String):String{
var _local3:String = _arg1.keyword;
return (getKeywordValueFromPath(_local3, _arg2));
}
public function isIgnoredReferral(_arg1:String):Boolean{
if (_ignoredReferralsCache.hasOwnProperty(_arg1)){
return (true);
};
return (false);
}
public function clear():void{
clearEngines();
clearIgnoredReferrals();
clearIgnoredKeywords();
}
public function get count():int{
return (_sources.length);
}
public function get ignoredKeywordsCount():int{
return (_ignoredKeywords.length);
}
public function match(_arg1:String):Boolean{
if (_arg1 == ""){
return (false);
};
_arg1 = _arg1.toLowerCase();
if (_sourcesEngine[_arg1] != undefined){
return (true);
};
return (false);
}
public function clearIgnoredKeywords():void{
_ignoredKeywords = [];
_ignoredKeywordsCache = {};
}
public function addSource(_arg1:String, _arg2:String):void{
var _local3:OrganicReferrer = new OrganicReferrer(_arg1, _arg2);
if (_sourcesCache[_local3.toString()] == undefined){
_sources.push(_local3);
_sourcesCache[_local3.toString()] = (_sources.length - 1);
if (_sourcesEngine[_local3.engine] == undefined){
_sourcesEngine[_local3.engine] = [(_sources.length - 1)];
} else {
_sourcesEngine[_local3.engine].push((_sources.length - 1));
};
} else {
if (throwErrors){
throw (new Error((_local3.toString() + " already exists, we don't add it.")));
};
};
}
public function clearEngines():void{
_sources = [];
_sourcesCache = [];
_sourcesEngine = [];
}
public function get ignoredReferralsCount():int{
return (_ignoredReferrals.length);
}
public function addIgnoredReferral(_arg1:String):void{
if (_ignoredReferralsCache[_arg1] == undefined){
_ignoredReferrals.push(_arg1);
_ignoredReferralsCache[_arg1] = (_ignoredReferrals.length - 1);
} else {
if (throwErrors){
throw (new Error((("\"" + _arg1) + "\" already exists, we don't add it.")));
};
};
}
public function clearIgnoredReferrals():void{
_ignoredReferrals = [];
_ignoredReferralsCache = {};
}
public function getReferrerByName(_arg1:String):OrganicReferrer{
var _local2:int;
if (match(_arg1)){
_local2 = _sourcesEngine[_arg1][0];
return (_sources[_local2]);
};
return (null);
}
public function addIgnoredKeyword(_arg1:String):void{
if (_ignoredKeywordsCache[_arg1] == undefined){
_ignoredKeywords.push(_arg1);
_ignoredKeywordsCache[_arg1] = (_ignoredKeywords.length - 1);
} else {
if (throwErrors){
throw (new Error((("\"" + _arg1) + "\" already exists, we don't add it.")));
};
};
}
public function get sources():Array{
return (_sources);
}
public static function getKeywordValueFromPath(_arg1:String, _arg2:String):String{
var _local3:String;
var _local4:Variables;
if (_arg2.indexOf((_arg1 + "=")) > -1){
if (_arg2.charAt(0) == "?"){
_arg2 = _arg2.substr(1);
};
_arg2 = _arg2.split("+").join("%20");
_local4 = new Variables(_arg2);
_local3 = _local4[_arg1];
};
return (_local3);
}
}
}//package com.google.analytics.core
Section 83
//OrganicReferrer (com.google.analytics.core.OrganicReferrer)
package com.google.analytics.core {
public class OrganicReferrer {
private var _engine:String;
private var _keyword:String;
public function OrganicReferrer(_arg1:String, _arg2:String){
this.engine = _arg1;
this.keyword = _arg2;
}
public function get keyword():String{
return (_keyword);
}
public function get engine():String{
return (_engine);
}
public function set engine(_arg1:String):void{
_engine = _arg1.toLowerCase();
}
public function toString():String{
return (((engine + "?") + keyword));
}
public function set keyword(_arg1:String):void{
_keyword = _arg1.toLowerCase();
}
}
}//package com.google.analytics.core
Section 84
//RequestObject (com.google.analytics.core.RequestObject)
package com.google.analytics.core {
import flash.net.*;
import flash.utils.*;
public class RequestObject {
public var start:int;
public var end:int;
public var request:URLRequest;
public function RequestObject(_arg1:URLRequest){
start = getTimer();
this.request = _arg1;
}
public function hasCompleted():Boolean{
return ((end > 0));
}
public function toString():String{
var _local1:Array = [];
_local1.push((("duration: " + duration) + "ms"));
_local1.push(("url: " + request.url));
return ((("{ " + _local1.join(", ")) + " }"));
}
public function complete():void{
end = getTimer();
}
public function get duration():int{
if (!hasCompleted()){
return (0);
};
return ((end - start));
}
}
}//package com.google.analytics.core
Section 85
//ServerOperationMode (com.google.analytics.core.ServerOperationMode)
package com.google.analytics.core {
public class ServerOperationMode {
private var _value:int;
private var _name:String;
public static const both:ServerOperationMode = new ServerOperationMode(2, "both");
;
public static const remote:ServerOperationMode = new ServerOperationMode(1, "remote");
;
public static const local:ServerOperationMode = new ServerOperationMode(0, "local");
;
public function ServerOperationMode(_arg1:int=0, _arg2:String=""){
_value = _arg1;
_name = _arg2;
}
public function valueOf():int{
return (_value);
}
public function toString():String{
return (_name);
}
}
}//package com.google.analytics.core
Section 86
//TrackerCache (com.google.analytics.core.TrackerCache)
package com.google.analytics.core {
import com.google.analytics.v4.*;
import flash.errors.*;
public class TrackerCache implements GoogleAnalyticsAPI {
public var tracker:GoogleAnalyticsAPI;
private var _ar:Array;
public static var CACHE_THROW_ERROR:Boolean;
public function TrackerCache(_arg1:GoogleAnalyticsAPI=null){
this.tracker = _arg1;
_ar = [];
}
public function size():uint{
return (_ar.length);
}
public function flush():void{
var _local1:Object;
var _local2:String;
var _local3:Array;
var _local4:int;
var _local5:int;
if (tracker == null){
return;
};
if (size() > 0){
_local4 = _ar.length;
while (_local5 < _local4) {
_local1 = _ar.shift();
_local2 = (_local1.name as String);
_local3 = (_local1.args as Array);
if (((!((_local2 == null))) && ((_local2 in tracker)))){
(tracker[_local2] as Function).apply(tracker, _local3);
};
_local5++;
};
};
}
public function enqueue(_arg1:String, ... _args):Boolean{
if (_arg1 == null){
return (false);
};
_ar.push({name:_arg1, args:_args});
return (true);
}
public function link(_arg1:String, _arg2:Boolean=false):void{
enqueue("link", _arg1, _arg2);
}
public function addOrganic(_arg1:String, _arg2:String):void{
enqueue("addOrganic", _arg1, _arg2);
}
public function setAllowLinker(_arg1:Boolean):void{
enqueue("setAllowLinker", _arg1);
}
public function trackEvent(_arg1:String, _arg2:String, _arg3:String=null, _arg4:Number=NaN):Boolean{
enqueue("trackEvent", _arg1, _arg2, _arg3, _arg4);
return (true);
}
public function getLinkerUrl(_arg1:String="", _arg2:Boolean=false):String{
if (CACHE_THROW_ERROR){
throw (new IllegalOperationError("The tracker is not ready and you can use the 'getLinkerUrl' method for the moment."));
};
return ("");
}
public function getClientInfo():Boolean{
if (CACHE_THROW_ERROR){
throw (new IllegalOperationError("The tracker is not ready and you can use the 'getClientInfo' method for the moment."));
};
return (false);
}
public function trackTrans():void{
enqueue("trackTrans");
}
public function trackPageview(_arg1:String=""):void{
enqueue("trackPageview", _arg1);
}
public function setClientInfo(_arg1:Boolean):void{
enqueue("setClientInfo", _arg1);
}
public function linkByPost(_arg1:Object, _arg2:Boolean=false):void{
enqueue("linkByPost", _arg1, _arg2);
}
public function setCookieTimeout(_arg1:int):void{
enqueue("setCookieTimeout", _arg1);
}
public function isEmpty():Boolean{
return ((_ar.length == 0));
}
public function getDetectTitle():Boolean{
if (CACHE_THROW_ERROR){
throw (new IllegalOperationError("The tracker is not ready and you can use the 'getDetectTitle' method for the moment."));
};
return (false);
}
public function resetSession():void{
enqueue("resetSession");
}
public function setDetectFlash(_arg1:Boolean):void{
enqueue("setDetectFlash", _arg1);
}
public function clear():void{
_ar = [];
}
public function setCampNameKey(_arg1:String):void{
enqueue("setCampNameKey", _arg1);
}
public function addItem(_arg1:String, _arg2:String, _arg3:String, _arg4:String, _arg5:Number, _arg6:int):void{
enqueue("addItem", _arg1, _arg2, _arg3, _arg4, _arg5, _arg6);
}
public function createEventTracker(_arg1:String):EventTracker{
if (CACHE_THROW_ERROR){
throw (new IllegalOperationError("The tracker is not ready and you can use the 'createEventTracker' method for the moment."));
};
return (null);
}
public function clearIgnoredOrganic():void{
enqueue("clearIgnoredOrganic");
}
public function setVar(_arg1:String):void{
enqueue("setVar", _arg1);
}
public function setDomainName(_arg1:String):void{
enqueue("setDomainName", _arg1);
}
public function setCampSourceKey(_arg1:String):void{
enqueue("setCampSourceKey", _arg1);
}
public function addTrans(_arg1:String, _arg2:String, _arg3:Number, _arg4:Number, _arg5:Number, _arg6:String, _arg7:String, _arg8:String):void{
if (CACHE_THROW_ERROR){
throw (new IllegalOperationError("The tracker is not ready and you can use the 'addTrans' method for the moment."));
};
}
public function setCampContentKey(_arg1:String):void{
enqueue("setCampContentKey", _arg1);
}
public function setLocalServerMode():void{
enqueue("setLocalServerMode");
}
public function getLocalGifPath():String{
if (CACHE_THROW_ERROR){
throw (new IllegalOperationError("The tracker is not ready and you can use the 'getLocalGifPath' method for the moment."));
};
return ("");
}
public function setAllowAnchor(_arg1:Boolean):void{
enqueue("setAllowAnchor", _arg1);
}
public function clearIgnoredRef():void{
enqueue("clearIgnoredRef");
}
public function setLocalGifPath(_arg1:String):void{
enqueue("setLocalGifPath", _arg1);
}
public function getVersion():String{
if (CACHE_THROW_ERROR){
throw (new IllegalOperationError("The tracker is not ready and you can use the 'getVersion' method for the moment."));
};
return ("");
}
public function setCookiePath(_arg1:String):void{
enqueue("setCookiePath", _arg1);
}
public function setSampleRate(_arg1:Number):void{
enqueue("setSampleRate", _arg1);
}
public function setDetectTitle(_arg1:Boolean):void{
enqueue("setDetectTitle", _arg1);
}
public function setAllowHash(_arg1:Boolean):void{
enqueue("setAllowHash", _arg1);
}
public function addIgnoredOrganic(_arg1:String):void{
enqueue("addIgnoredOrganic", _arg1);
}
public function setCampNOKey(_arg1:String):void{
enqueue("setCampNOKey", _arg1);
}
public function getServiceMode():ServerOperationMode{
if (CACHE_THROW_ERROR){
throw (new IllegalOperationError("The tracker is not ready and you can use the 'getServiceMode' method for the moment."));
};
return (null);
}
public function setLocalRemoteServerMode():void{
enqueue("setLocalRemoteServerMode");
}
public function cookiePathCopy(_arg1:String):void{
enqueue("cookiePathCopy", _arg1);
}
public function getDetectFlash():Boolean{
if (CACHE_THROW_ERROR){
throw (new IllegalOperationError("The tracker is not ready and you can use the 'getDetectFlash' method for the moment."));
};
return (false);
}
public function setCampaignTrack(_arg1:Boolean):void{
enqueue("setCampaignTrack", _arg1);
}
public function clearOrganic():void{
enqueue("clearOrganic");
}
public function setCampTermKey(_arg1:String):void{
enqueue("setCampTermKey", _arg1);
}
public function addIgnoredRef(_arg1:String):void{
enqueue("addIgnoredRef", _arg1);
}
public function setCampMediumKey(_arg1:String):void{
enqueue("setCampMediumKey", _arg1);
}
public function setSessionTimeout(_arg1:int):void{
enqueue("setSessionTimeout", _arg1);
}
public function setRemoteServerMode():void{
enqueue("setRemoteServerMode");
}
public function element(){
return (_ar[0]);
}
public function getAccount():String{
if (CACHE_THROW_ERROR){
throw (new IllegalOperationError("The tracker is not ready and you can use the 'getAccount' method for the moment."));
};
return ("");
}
}
}//package com.google.analytics.core
Section 87
//TrackerMode (com.google.analytics.core.TrackerMode)
package com.google.analytics.core {
public class TrackerMode {
public static const BRIDGE:String = "Bridge";
public static const AS3:String = "AS3";
}
}//package com.google.analytics.core
Section 88
//Utils (com.google.analytics.core.Utils)
package com.google.analytics.core {
public class Utils {
public static function trim(_arg1:String, _arg2:Boolean=false):String{
var _local5:int;
var _local6:int;
var _local7:int;
if (_arg1 == ""){
return ("");
};
var _local3:Array = [" ", "\n", "\r", "\t"];
var _local4:String = _arg1;
if (_arg2){
_local5 = 0;
while ((((_local5 < _local3.length)) && ((_local4.indexOf(_local3[_local5]) > -1)))) {
_local4 = _local4.split(_local3[_local5]).join("");
_local5++;
};
} else {
_local6 = 0;
while ((((_local6 < _local4.length)) && ((_local3.indexOf(_local4.charAt(_local6)) > -1)))) {
_local6++;
};
_local4 = _local4.substr(_local6);
_local7 = (_local4.length - 1);
while ((((_local7 >= 0)) && ((_local3.indexOf(_local4.charAt(_local7)) > -1)))) {
_local7--;
};
_local4 = _local4.substring(0, (_local7 + 1));
};
return (_local4);
}
public static function generateHash(_arg1:String):int{
var _local4:int;
var _local5:int;
var _local2 = 1;
var _local3:int;
if (((!((_arg1 == null))) && (!((_arg1 == ""))))){
_local2 = 0;
_local4 = (_arg1.length - 1);
while (_local4 >= 0) {
_local5 = _arg1.charCodeAt(_local4);
_local2 = ((((_local2 << 6) & 268435455) + _local5) + (_local5 << 14));
_local3 = (_local2 & 266338304);
if (_local3 != 0){
_local2 = (_local2 ^ (_local3 >> 21));
};
_local4--;
};
};
return (_local2);
}
public static function generate32bitRandom():int{
return (Math.round((Math.random() * 2147483647)));
}
public static function validateAccount(_arg1:String):Boolean{
var _local2:RegExp = /^UA-[0-9]*-[0-9]*$/;
return (_local2.test(_arg1));
}
}
}//package com.google.analytics.core
Section 89
//Cookie (com.google.analytics.data.Cookie)
package com.google.analytics.data {
public interface Cookie {
function fromSharedObject(_arg1:Object):void;
function toURLString():String;
function get creation():Date;
function toSharedObject():Object;
function isExpired():Boolean;
function set creation(_arg1:Date):void;
function set expiration(_arg1:Date):void;
function get expiration():Date;
}
}//package com.google.analytics.data
Section 90
//UTMA (com.google.analytics.data.UTMA)
package com.google.analytics.data {
import com.google.analytics.utils.*;
public class UTMA extends UTMCookie {
private var _sessionId:Number;
private var _domainHash:Number;
private var _firstTime:Number;
private var _currentTime:Number;
private var _lastTime:Number;
private var _sessionCount:Number;
public function UTMA(_arg1:Number=NaN, _arg2:Number=NaN, _arg3:Number=NaN, _arg4:Number=NaN, _arg5:Number=NaN, _arg6:Number=NaN){
super("utma", "__utma", ["domainHash", "sessionId", "firstTime", "lastTime", "currentTime", "sessionCount"], (Timespan.twoyears * 1000));
this.domainHash = _arg1;
this.sessionId = _arg2;
this.firstTime = _arg3;
this.lastTime = _arg4;
this.currentTime = _arg5;
this.sessionCount = _arg6;
}
public function get lastTime():Number{
return (_lastTime);
}
public function set lastTime(_arg1:Number):void{
_lastTime = _arg1;
update();
}
public function set currentTime(_arg1:Number):void{
_currentTime = _arg1;
update();
}
public function get sessionId():Number{
return (_sessionId);
}
public function get sessionCount():Number{
return (_sessionCount);
}
public function get firstTime():Number{
return (_firstTime);
}
public function get currentTime():Number{
return (_currentTime);
}
public function set domainHash(_arg1:Number):void{
_domainHash = _arg1;
update();
}
public function set sessionId(_arg1:Number):void{
_sessionId = _arg1;
update();
}
public function set sessionCount(_arg1:Number):void{
_sessionCount = _arg1;
update();
}
public function get domainHash():Number{
return (_domainHash);
}
public function set firstTime(_arg1:Number):void{
_firstTime = _arg1;
update();
}
}
}//package com.google.analytics.data
Section 91
//UTMB (com.google.analytics.data.UTMB)
package com.google.analytics.data {
import com.google.analytics.utils.*;
public class UTMB extends UTMCookie {
private var _trackCount:Number;
private var _lastTime:Number;
private var _domainHash:Number;
private var _token:Number;
public static var defaultTimespan:Number = Timespan.thirtyminutes;
public function UTMB(_arg1:Number=NaN, _arg2:Number=NaN, _arg3:Number=NaN, _arg4:Number=NaN){
super("utmb", "__utmb", ["domainHash", "trackCount", "token", "lastTime"], (defaultTimespan * 1000));
this.domainHash = _arg1;
this.trackCount = _arg2;
this.token = _arg3;
this.lastTime = _arg4;
}
public function set token(_arg1:Number):void{
_token = _arg1;
update();
}
public function set trackCount(_arg1:Number):void{
_trackCount = _arg1;
update();
}
public function get lastTime():Number{
return (_lastTime);
}
public function set domainHash(_arg1:Number):void{
_domainHash = _arg1;
update();
}
public function set lastTime(_arg1:Number):void{
_lastTime = _arg1;
update();
}
public function get domainHash():Number{
return (_domainHash);
}
public function get token():Number{
return (_token);
}
public function get trackCount():Number{
return (_trackCount);
}
}
}//package com.google.analytics.data
Section 92
//UTMC (com.google.analytics.data.UTMC)
package com.google.analytics.data {
public class UTMC extends UTMCookie {
private var _domainHash:Number;
public function UTMC(_arg1:Number=NaN){
super("utmc", "__utmc", ["domainHash"]);
this.domainHash = _arg1;
}
public function get domainHash():Number{
return (_domainHash);
}
public function set domainHash(_arg1:Number):void{
_domainHash = _arg1;
update();
}
}
}//package com.google.analytics.data
Section 93
//UTMCookie (com.google.analytics.data.UTMCookie)
package com.google.analytics.data {
import com.google.analytics.core.*;
public class UTMCookie implements Cookie {
protected var inURL:String;
protected var name:String;
private var _creation:Date;
private var _expiration:Date;
public var proxy:Buffer;
protected var fields:Array;
private var _timespan:Number;
public function UTMCookie(_arg1:String, _arg2:String, _arg3:Array, _arg4:Number=0){
this.name = _arg1;
this.inURL = _arg2;
this.fields = _arg3;
_timestamp(_arg4);
}
public function isEmpty():Boolean{
var _local2:String;
var _local1:int;
var _local3:int;
while (_local3 < fields.length) {
_local2 = fields[_local3];
if ((((this[_local2] is Number)) && (isNaN(this[_local2])))){
_local1++;
} else {
if ((((this[_local2] is String)) && ((this[_local2] == "")))){
_local1++;
};
};
_local3++;
};
if (_local1 == fields.length){
return (true);
};
return (false);
}
public function resetTimestamp(_arg1:Number=NaN):void{
if (!isNaN(_arg1)){
_timespan = _arg1;
};
_creation = null;
_expiration = null;
_timestamp(_timespan);
}
protected function update():void{
resetTimestamp();
if (proxy){
proxy.update(name, toSharedObject());
};
}
public function reset():void{
var _local1:String;
var _local2:int;
while (_local2 < fields.length) {
_local1 = fields[_local2];
if ((this[_local1] is Number)){
this[_local1] = NaN;
} else {
if ((this[_local1] is String)){
this[_local1] = "";
};
};
_local2++;
};
resetTimestamp();
update();
}
public function fromSharedObject(_arg1:Object):void{
var _local2:String;
var _local3:int = fields.length;
var _local4:int;
while (_local4 < _local3) {
_local2 = fields[_local4];
if (_arg1[_local2]){
this[_local2] = _arg1[_local2];
};
_local4++;
};
if (_arg1.creation){
this.creation = _arg1.creation;
};
if (_arg1.expiration){
this.expiration = _arg1.expiration;
};
}
private function _timestamp(_arg1:Number):void{
creation = new Date();
_timespan = _arg1;
if (_arg1 > 0){
expiration = new Date((creation.valueOf() + _arg1));
};
}
public function isExpired():Boolean{
var _local1:Date = new Date();
var _local2:Number = (expiration.valueOf() - _local1.valueOf());
if (_local2 <= 0){
return (true);
};
return (false);
}
public function set expiration(_arg1:Date):void{
_expiration = _arg1;
}
public function get creation():Date{
return (_creation);
}
public function valueOf():String{
var _local2:String;
var _local3:*;
var _local4:Array;
var _local1:Array = [];
var _local5 = "";
var _local6:int;
while (_local6 < fields.length) {
_local2 = fields[_local6];
_local3 = this[_local2];
if ((_local3 is String)){
if (_local3 == ""){
_local3 = "-";
_local1.push(_local3);
} else {
_local1.push(_local3);
};
} else {
if ((_local3 is Number)){
if (_local3 == 0){
_local1.push(_local3);
} else {
if (isNaN(_local3)){
_local3 = "-";
_local1.push(_local3);
} else {
_local1.push(_local3);
};
};
};
};
_local6++;
};
if (isEmpty()){
return ("-");
};
return (("" + _local1.join(".")));
}
public function toURLString():String{
return (((inURL + "=") + valueOf()));
}
public function get expiration():Date{
if (_expiration){
return (_expiration);
};
return (new Date((new Date().valueOf() + 1000)));
}
public function toSharedObject():Object{
var _local2:String;
var _local3:*;
var _local1:Object = {};
var _local4:int;
for (;_local4 < fields.length;_local4++) {
_local2 = fields[_local4];
_local3 = this[_local2];
if ((_local3 is String)){
_local1[_local2] = _local3;
} else {
if (_local3 == 0){
_local1[_local2] = _local3;
} else {
if (isNaN(_local3)){
continue;
} else {
_local1[_local2] = _local3;
};
};
};
};
_local1.creation = creation;
_local1.expiration = expiration;
return (_local1);
}
public function toString(_arg1:Boolean=false):String{
var _local3:String;
var _local4:*;
var _local2:Array = [];
var _local5:int = fields.length;
var _local6:int;
for (;_local6 < _local5;_local6++) {
_local3 = fields[_local6];
_local4 = this[_local3];
if ((_local4 is String)){
_local2.push((((_local3 + ": \"") + _local4) + "\""));
} else {
if (_local4 == 0){
_local2.push(((_local3 + ": ") + _local4));
} else {
if (isNaN(_local4)){
continue;
} else {
_local2.push(((_local3 + ": ") + _local4));
};
};
};
};
var _local7 = (((name.toUpperCase() + " {") + _local2.join(", ")) + "}");
if (_arg1){
_local7 = (_local7 + (((" creation:" + creation) + ", expiration:") + expiration));
};
return (_local7);
}
public function set creation(_arg1:Date):void{
_creation = _arg1;
}
}
}//package com.google.analytics.data
Section 94
//UTMK (com.google.analytics.data.UTMK)
package com.google.analytics.data {
public class UTMK extends UTMCookie {
private var _hash:Number;
public function UTMK(_arg1:Number=NaN){
super("utmk", "__utmk", ["hash"]);
this.hash = _arg1;
}
public function set hash(_arg1:Number):void{
_hash = _arg1;
update();
}
public function get hash():Number{
return (_hash);
}
}
}//package com.google.analytics.data
Section 95
//UTMV (com.google.analytics.data.UTMV)
package com.google.analytics.data {
import com.google.analytics.utils.*;
public class UTMV extends UTMCookie {
private var _domainHash:Number;
private var _value:String;
public function UTMV(_arg1:Number=NaN, _arg2:String=""){
super("utmv", "__utmv", ["domainHash", "value"], (Timespan.twoyears * 1000));
this.domainHash = _arg1;
this.value = _arg2;
}
public function get value():String{
return (_value);
}
public function get domainHash():Number{
return (_domainHash);
}
public function set domainHash(_arg1:Number):void{
_domainHash = _arg1;
update();
}
public function set value(_arg1:String):void{
_value = _arg1;
update();
}
}
}//package com.google.analytics.data
Section 96
//UTMX (com.google.analytics.data.UTMX)
package com.google.analytics.data {
public class UTMX extends UTMCookie {
private var _value:String;
public function UTMX(){
super("utmx", "__utmx", ["value"], 0);
_value = "-";
}
public function get value():String{
return (_value);
}
public function set value(_arg1:String):void{
_value = _arg1;
}
}
}//package com.google.analytics.data
Section 97
//UTMZ (com.google.analytics.data.UTMZ)
package com.google.analytics.data {
import com.google.analytics.utils.*;
public class UTMZ extends UTMCookie {
private var _campaignTracking:String;
private var _campaignCreation:Number;
private var _responseCount:Number;
private var _domainHash:Number;
private var _campaignSessions:Number;
public static var defaultTimespan:Number = Timespan.sixmonths;
public function UTMZ(_arg1:Number=NaN, _arg2:Number=NaN, _arg3:Number=NaN, _arg4:Number=NaN, _arg5:String=""){
super("utmz", "__utmz", ["domainHash", "campaignCreation", "campaignSessions", "responseCount", "campaignTracking"], (defaultTimespan * 1000));
this.domainHash = _arg1;
this.campaignCreation = _arg2;
this.campaignSessions = _arg3;
this.responseCount = _arg4;
this.campaignTracking = _arg5;
}
public function set responseCount(_arg1:Number):void{
_responseCount = _arg1;
update();
}
public function set domainHash(_arg1:Number):void{
_domainHash = _arg1;
update();
}
public function set campaignCreation(_arg1:Number):void{
_campaignCreation = _arg1;
update();
}
public function get campaignTracking():String{
return (_campaignTracking);
}
public function get campaignSessions():Number{
return (_campaignSessions);
}
public function get domainHash():Number{
return (_domainHash);
}
public function get responseCount():Number{
return (_responseCount);
}
public function get campaignCreation():Number{
return (_campaignCreation);
}
public function set campaignSessions(_arg1:Number):void{
_campaignSessions = _arg1;
update();
}
public function set campaignTracking(_arg1:String):void{
_campaignTracking = _arg1;
update();
}
}
}//package com.google.analytics.data
Section 98
//X10 (com.google.analytics.data.X10)
package com.google.analytics.data {
public class X10 {
private var _delimEnd:String;// = ")"
private var _minimum:int;
private var _delimSet:String;// = "*"
private var _escapeChar:String;// = "'"
private var _delimBegin:String;// = "("
private var _delimNumValue:String;// = "!"
private var _key:String;// = "k"
private var _set:Array;
private var _hasData:int;
private var _escapeCharMap:Object;
private var _projectData:Object;
private var _value:String;// = "v"
public function X10(){
_set = [_key, _value];
super();
_projectData = {};
_escapeCharMap = {};
_escapeCharMap[_escapeChar] = "'0";
_escapeCharMap[_delimEnd] = "'1";
_escapeCharMap[_delimSet] = "'2";
_escapeCharMap[_delimNumValue] = "'3";
_minimum = 1;
}
private function _setInternal(_arg1:Number, _arg2:String, _arg3:Number, _arg4:String):void{
if (!hasProject(_arg1)){
_projectData[_arg1] = {};
};
if (_projectData[_arg1][_arg2] == undefined){
_projectData[_arg1][_arg2] = [];
};
_projectData[_arg1][_arg2][_arg3] = _arg4;
_hasData = (_hasData + 1);
}
private function _renderProject(_arg1:Object):String{
var _local4:int;
var _local5:Array;
var _local2 = "";
var _local3:Boolean;
var _local6:int = _set.length;
_local4 = 0;
while (_local4 < _local6) {
_local5 = _arg1[_set[_local4]];
if (_local5){
if (_local3){
_local2 = (_local2 + _set[_local4]);
};
_local2 = (_local2 + _renderDataType(_local5));
_local3 = false;
} else {
_local3 = true;
};
_local4++;
};
return (_local2);
}
public function hasProject(_arg1:Number):Boolean{
return (_projectData[_arg1]);
}
public function clearKey(_arg1:Number):void{
_clearInternal(_arg1, _key);
}
private function _renderDataType(_arg1:Array):String{
var _local3:String;
var _local4:int;
var _local2:Array = [];
_local4 = 0;
while (_local4 < _arg1.length) {
if (_arg1[_local4] != undefined){
_local3 = "";
if (((!((_local4 == _minimum))) && ((_arg1[(_local4 - 1)] == undefined)))){
_local3 = (_local3 + _local4.toString());
_local3 = (_local3 + _delimNumValue);
};
_local3 = (_local3 + _escapeExtensibleValue(_arg1[_local4]));
_local2.push(_local3);
};
_local4++;
};
return (((_delimBegin + _local2.join(_delimSet)) + _delimEnd));
}
public function getKey(_arg1:Number, _arg2:Number):String{
return ((_getInternal(_arg1, _key, _arg2) as String));
}
public function hasData():Boolean{
return ((_hasData > 0));
}
public function renderMergedUrlString(_arg1:X10=null):String{
var _local3:String;
if (!_arg1){
return (renderUrlString());
};
var _local2:Array = [_arg1.renderUrlString()];
for (_local3 in _projectData) {
if (((hasProject(Number(_local3))) && (!(_arg1.hasProject(Number(_local3)))))){
_local2.push((_local3 + _renderProject(_projectData[_local3])));
};
};
return (_local2.join(""));
}
public function setValue(_arg1:Number, _arg2:Number, _arg3:Number):Boolean{
if (((((!((Math.round(_arg3) == _arg3))) || (isNaN(_arg3)))) || ((_arg3 == Infinity)))){
return (false);
};
_setInternal(_arg1, _value, _arg2, _arg3.toString());
return (true);
}
public function renderUrlString():String{
var _local2:String;
var _local1:Array = [];
for (_local2 in _projectData) {
if (hasProject(Number(_local2))){
_local1.push((_local2 + _renderProject(_projectData[_local2])));
};
};
return (_local1.join(""));
}
private function _getInternal(_arg1:Number, _arg2:String, _arg3:Number):Object{
if (((hasProject(_arg1)) && (!((_projectData[_arg1][_arg2] == undefined))))){
return (_projectData[_arg1][_arg2][_arg3]);
};
return (undefined);
}
public function setKey(_arg1:Number, _arg2:Number, _arg3:String):Boolean{
_setInternal(_arg1, _key, _arg2, _arg3);
return (true);
}
public function clearValue(_arg1:Number):void{
_clearInternal(_arg1, _value);
}
private function _clearInternal(_arg1:Number, _arg2:String):void{
var _local3:Boolean;
var _local4:int;
var _local5:int;
if (((hasProject(_arg1)) && (!((_projectData[_arg1][_arg2] == undefined))))){
_projectData[_arg1][_arg2] = undefined;
_local3 = true;
_local5 = _set.length;
_local4 = 0;
while (_local4 < _local5) {
if (_projectData[_arg1][_set[_local4]] != undefined){
_local3 = false;
break;
};
_local4++;
};
if (_local3){
_projectData[_arg1] = undefined;
_hasData = (_hasData - 1);
};
};
}
public function getValue(_arg1:Number, _arg2:Number){
var _local3:* = _getInternal(_arg1, _value, _arg2);
if (_local3 == null){
return (null);
};
return (Number(_local3));
}
private function _escapeExtensibleValue(_arg1:String):String{
var _local3:int;
var _local4:String;
var _local5:String;
var _local2 = "";
_local3 = 0;
while (_local3 < _arg1.length) {
_local4 = _arg1.charAt(_local3);
_local5 = _escapeCharMap[_local4];
if (_local5){
_local2 = (_local2 + _local5);
} else {
_local2 = (_local2 + _local4);
};
_local3++;
};
return (_local2);
}
}
}//package com.google.analytics.data
Section 99
//_Style (com.google.analytics.debug._Style)
package com.google.analytics.debug {
import flash.net.*;
import flash.text.*;
public class _Style {
public var failureColor:uint;
public var borderColor:uint;
public var backgroundColor:uint;
private var _sheet:StyleSheet;
public var roundedCorner:uint;
public var warningColor:uint;
public var infoColor:uint;
public var alertColor:uint;
public var successColor:uint;
private var _loader:URLLoader;
private var _defaultSheet:String;
public function _Style(){
_sheet = new StyleSheet();
_loader = new URLLoader();
_init();
}
private function _parseSheet(_arg1:String):void{
_sheet.parseCSS(_arg1);
}
public function get sheet():StyleSheet{
return (_sheet);
}
private function _init():void{
_defaultSheet = "";
_defaultSheet = (_defaultSheet + "a{text-decoration: underline;}\n");
_defaultSheet = (_defaultSheet + ".uiLabel{color: #000000;font-family: Arial;font-size: 12;margin-left: 2;margin-right: 2;}\n");
_defaultSheet = (_defaultSheet + ".uiWarning{color: #ffffff;font-family: Arial;font-size: 14;font-weight: bold;margin-left: 6;margin-right: 6;}\n");
_defaultSheet = (_defaultSheet + ".uiAlert{color: #ffffff;font-family: Arial;font-size: 14;font-weight: bold;margin-left: 6;margin-right: 6;}\n");
_defaultSheet = (_defaultSheet + ".uiInfo{color: #000000;font-family: Arial;font-size: 14;font-weight: bold;margin-left: 6;margin-right: 6;}\n");
_defaultSheet = (_defaultSheet + ".uiSuccess{color: #ffffff;font-family: Arial;font-size: 12;font-weight: bold;margin-left: 6;margin-right: 6;}\n");
_defaultSheet = (_defaultSheet + ".uiFailure{color: #ffffff;font-family: Arial;font-size: 12;font-weight: bold;margin-left: 6;margin-right: 6;}\n");
_defaultSheet = (_defaultSheet + ".uiAlertAction{color: #ffffff;text-align: center;font-family: Arial;font-size: 12;font-weight: bold;margin-left: 6;margin-right: 6;}\n");
_defaultSheet = (_defaultSheet + ".uiAlertTitle{color: #ffffff;font-family: Arial;font-size: 16;font-weight: bold;margin-left: 6;margin-right: 6;}\n");
_defaultSheet = (_defaultSheet + "\n");
roundedCorner = 6;
backgroundColor = 0xCCCCCC;
borderColor = 0x555555;
infoColor = 16777113;
alertColor = 0xFFCC00;
warningColor = 0xCC0000;
successColor = 0xFF00;
failureColor = 0xFF0000;
_parseSheet(_defaultSheet);
}
}
}//package com.google.analytics.debug
Section 100
//Alert (com.google.analytics.debug.Alert)
package com.google.analytics.debug {
import flash.events.*;
public class Alert extends Label {
public var autoClose:Boolean;// = true
public var actionOnNextLine:Boolean;// = true
private var _actions:Array;
public function Alert(_arg1:String, _arg2:Array, _arg3:String="uiAlert", _arg4:uint=0, _arg5:Align=null, _arg6:Boolean=false, _arg7:Boolean=true){
if (_arg4 == 0){
_arg4 = Style.alertColor;
};
if (_arg5 == null){
_arg5 = Align.center;
};
super(_arg1, _arg3, _arg4, _arg5, _arg6);
this.selectable = true;
super.mouseChildren = true;
this.buttonMode = true;
this.mouseEnabled = true;
this.useHandCursor = true;
this.actionOnNextLine = _arg7;
_actions = [];
var _local8:int;
while (_local8 < _arg2.length) {
_arg2[_local8].container = this;
_actions.push(_arg2[_local8]);
_local8++;
};
}
private function _defineActions():void{
var _local3:AlertAction;
var _local1 = "";
if (actionOnNextLine){
_local1 = (_local1 + "\n");
} else {
_local1 = (_local1 + " |");
};
_local1 = (_local1 + " ");
var _local2:Array = [];
var _local4:int;
while (_local4 < _actions.length) {
_local3 = _actions[_local4];
_local2.push((((("<a href=\"event:" + _local3.activator) + "\">") + _local3.name) + "</a>"));
_local4++;
};
_local1 = (_local1 + _local2.join(" | "));
appendText(_local1, "uiAlertAction");
}
protected function isValidAction(_arg1:String):Boolean{
var _local2:int;
while (_local2 < _actions.length) {
if (_arg1 == _actions[_local2].activator){
return (true);
};
_local2++;
};
return (false);
}
override protected function layout():void{
super.layout();
_defineActions();
}
protected function getAction(_arg1:String):AlertAction{
var _local2:int;
while (_local2 < _actions.length) {
if (_arg1 == _actions[_local2].activator){
return (_actions[_local2]);
};
_local2++;
};
return (null);
}
protected function spaces(_arg1:int):String{
var _local2 = "";
var _local3 = " ";
var _local4:int;
while (_local4 < (_arg1 + 1)) {
_local2 = (_local2 + _local3);
_local4++;
};
return (_local2);
}
override public function onLink(_arg1:TextEvent):void{
var _local2:AlertAction;
if (isValidAction(_arg1.text)){
_local2 = getAction(_arg1.text);
if (_local2){
_local2.execute();
};
};
if (autoClose){
close();
};
}
public function close():void{
if (parent != null){
parent.removeChild(this);
};
}
}
}//package com.google.analytics.debug
Section 101
//AlertAction (com.google.analytics.debug.AlertAction)
package com.google.analytics.debug {
public class AlertAction {
public var container:Alert;
private var _callback;
public var activator:String;
public var name:String;
public function AlertAction(_arg1:String, _arg2:String, _arg3){
this.name = _arg1;
this.activator = _arg2;
_callback = _arg3;
}
public function execute():void{
if (_callback){
if ((_callback is Function)){
(_callback as Function)();
} else {
if ((_callback is String)){
var _local1 = container;
_local1[_callback]();
};
};
};
}
}
}//package com.google.analytics.debug
Section 102
//Align (com.google.analytics.debug.Align)
package com.google.analytics.debug {
public class Align {
private var _value:int;
private var _name:String;
public static const bottomRight:Align = new Align(18, "bottomRight");
;
public static const right:Align = new Align(16, "right");
;
public static const left:Align = new Align(32, "left");
;
public static const topRight:Align = new Align(17, "topRight");
;
public static const bottom:Align = new Align(2, "bottom");
;
public static const bottomLeft:Align = new Align(34, "bottomLeft");
;
public static const topLeft:Align = new Align(33, "topLeft");
;
public static const center:Align = new Align(0x0100, "center");
;
public static const none:Align = new Align(0, "none");
;
public static const top:Align = new Align(1, "top");
;
public function Align(_arg1:int=0, _arg2:String=""){
_value = _arg1;
_name = _arg2;
}
public function valueOf():int{
return (_value);
}
public function toString():String{
return (_name);
}
}
}//package com.google.analytics.debug
Section 103
//Background (com.google.analytics.debug.Background)
package com.google.analytics.debug {
import flash.display.*;
public class Background {
public static function drawRounded(_arg1, _arg2:Graphics, _arg3:uint=0, _arg4:uint=0):void{
var _local5:uint;
var _local6:uint;
var _local7:uint = Style.roundedCorner;
if ((((_arg3 > 0)) && ((_arg4 > 0)))){
_local5 = _arg3;
_local6 = _arg4;
} else {
_local5 = _arg1.width;
_local6 = _arg1.height;
};
if (((_arg1.stickToEdge) && (!((_arg1.alignement == Align.none))))){
switch (_arg1.alignement){
case Align.top:
_arg2.drawRoundRectComplex(0, 0, _local5, _local6, 0, 0, _local7, _local7);
break;
case Align.topLeft:
_arg2.drawRoundRectComplex(0, 0, _local5, _local6, 0, 0, 0, _local7);
break;
case Align.topRight:
_arg2.drawRoundRectComplex(0, 0, _local5, _local6, 0, 0, _local7, 0);
break;
case Align.bottom:
_arg2.drawRoundRectComplex(0, 0, _local5, _local6, _local7, _local7, 0, 0);
break;
case Align.bottomLeft:
_arg2.drawRoundRectComplex(0, 0, _local5, _local6, 0, _local7, 0, 0);
break;
case Align.bottomRight:
_arg2.drawRoundRectComplex(0, 0, _local5, _local6, _local7, 0, 0, 0);
break;
case Align.left:
_arg2.drawRoundRectComplex(0, 0, _local5, _local6, 0, _local7, 0, _local7);
break;
case Align.right:
_arg2.drawRoundRectComplex(0, 0, _local5, _local6, _local7, 0, _local7, 0);
break;
case Align.center:
_arg2.drawRoundRect(0, 0, _local5, _local6, _local7, _local7);
break;
};
} else {
_arg2.drawRoundRect(0, 0, _local5, _local6, _local7, _local7);
};
}
}
}//package com.google.analytics.debug
Section 104
//Debug (com.google.analytics.debug.Debug)
package com.google.analytics.debug {
import flash.events.*;
import flash.ui.*;
public class Debug extends Label {
private var _lines:Array;
private var _preferredForcedWidth:uint;// = 540
private var _linediff:int;// = 0
public var maxLines:uint;// = 16
public static var count:uint;
public function Debug(_arg1:uint=0, _arg2:Align=null, _arg3:Boolean=false){
if (_arg2 == null){
_arg2 = Align.bottom;
};
super("", "uiLabel", _arg1, _arg2, _arg3);
this.name = ("Debug" + count++);
_lines = [];
selectable = true;
addEventListener(KeyboardEvent.KEY_DOWN, onKey);
}
public function writeBold(_arg1:String):void{
write(_arg1, true);
}
private function _getLinesToDisplay(_arg1:int=0):Array{
var _local2:Array;
var _local3:uint;
var _local4:uint;
if ((_lines.length - 1) > maxLines){
if ((_linediff <= 0)){
_linediff = (_linediff + _arg1);
} else {
if ((((_linediff > 0)) && ((_arg1 < 0)))){
_linediff = (_linediff + _arg1);
};
};
_local3 = ((_lines.length - maxLines) + _linediff);
_local4 = (_local3 + maxLines);
_local2 = _lines.slice(_local3, _local4);
} else {
_local2 = _lines;
};
return (_local2);
}
private function onKey(_arg1:KeyboardEvent=null):void{
var _local2:Array;
switch (_arg1.keyCode){
case Keyboard.DOWN:
_local2 = _getLinesToDisplay(1);
break;
case Keyboard.UP:
_local2 = _getLinesToDisplay(-1);
break;
default:
_local2 = null;
};
if (_local2 == null){
return;
};
text = _local2.join("\n");
}
override public function get forcedWidth():uint{
if (this.parent){
if (UISprite(this.parent).forcedWidth > _preferredForcedWidth){
return (_preferredForcedWidth);
};
return (UISprite(this.parent).forcedWidth);
//unresolved jump
};
return (super.forcedWidth);
}
public function write(_arg1:String, _arg2:Boolean=false):void{
var _local3:Array;
if (_arg1.indexOf("") > -1){
_local3 = _arg1.split("\n");
} else {
_local3 = [_arg1];
};
var _local4 = "";
var _local5 = "";
if (_arg2){
_local4 = "<b>";
_local5 = "</b>";
};
var _local6:int;
while (_local6 < _local3.length) {
_lines.push(((_local4 + _local3[_local6]) + _local5));
_local6++;
};
var _local7:Array = _getLinesToDisplay();
text = _local7.join("\n");
}
public function close():void{
dispose();
}
override protected function dispose():void{
removeEventListener(KeyboardEvent.KEY_DOWN, onKey);
super.dispose();
}
}
}//package com.google.analytics.debug
Section 105
//DebugConfiguration (com.google.analytics.debug.DebugConfiguration)
package com.google.analytics.debug {
import com.google.analytics.core.*;
import flash.net.*;
import flash.utils.*;
public class DebugConfiguration {
public var showHideKey:Number;// = 32
private var _mode:VisualDebugMode;
private var _verbose:Boolean;// = false
public var destroyKey:Number;// = 8
public var GIFRequests:Boolean;// = false
public var showInfos:Boolean;// = true
public var infoTimeout:Number;// = 1000
public var minimizedOnStart:Boolean;// = false
private var _active:Boolean;// = false
public var traceOutput:Boolean;// = false
public var layout:ILayout;
public var warningTimeout:Number;// = 1500
public var javascript:Boolean;// = false
public var showWarnings:Boolean;// = true
private var _visualInitialized:Boolean;// = false
public function DebugConfiguration(){
_mode = VisualDebugMode.basic;
super();
}
public function get verbose():Boolean{
return (_verbose);
}
public function set verbose(_arg1:Boolean):void{
_verbose = _arg1;
}
public function set mode(_arg1):void{
if ((_arg1 is String)){
switch (_arg1){
case "geek":
_arg1 = VisualDebugMode.geek;
break;
case "advanced":
_arg1 = VisualDebugMode.advanced;
break;
case "basic":
default:
_arg1 = VisualDebugMode.basic;
};
};
_mode = _arg1;
}
public function success(_arg1:String):void{
if (layout){
layout.createSuccessAlert(_arg1);
};
if (traceOutput){
trace((("[+] " + _arg1) + " !!"));
};
}
public function get active():Boolean{
return (_active);
}
private function _initializeVisual():void{
if (layout){
layout.init();
_visualInitialized = true;
};
}
private function _destroyVisual():void{
if (((layout) && (_visualInitialized))){
layout.destroy();
};
}
public function warning(_arg1:String, _arg2:VisualDebugMode=null):void{
if (_filter(_arg2)){
return;
};
if (((layout) && (showWarnings))){
layout.createWarning(_arg1);
};
if (traceOutput){
trace((("## " + _arg1) + " ##"));
};
}
private function _filter(_arg1:VisualDebugMode=null):Boolean{
return (((_arg1) && ((int(_arg1) >= int(this.mode)))));
}
public function failure(_arg1:String):void{
if (layout){
layout.createFailureAlert(_arg1);
};
if (traceOutput){
trace((("[-] " + _arg1) + " !!"));
};
}
public function get mode(){
return (_mode);
}
public function set active(_arg1:Boolean):void{
_active = _arg1;
if (_active){
_initializeVisual();
} else {
_destroyVisual();
};
}
protected function trace(_arg1:String):void{
var _local7:Array;
var _local8:int;
var _local2:Array = [];
var _local3 = "";
var _local4 = "";
if (this.mode == VisualDebugMode.geek){
_local3 = (getTimer() + " - ");
_local4 = (new Array(_local3.length).join(" ") + " ");
};
if (_arg1.indexOf("\n") > -1){
_local7 = _arg1.split("\n");
_local8 = 0;
while (_local8 < _local7.length) {
if (_local7[_local8] == ""){
} else {
if (_local8 == 0){
_local2.push((_local3 + _local7[_local8]));
} else {
_local2.push((_local4 + _local7[_local8]));
};
};
_local8++;
};
} else {
_local2.push((_local3 + _arg1));
};
var _local5:int = _local2.length;
var _local6:int;
while (_local6 < _local5) {
trace(_local2[_local6]);
_local6++;
};
}
public function alert(_arg1:String):void{
if (layout){
layout.createAlert(_arg1);
};
if (traceOutput){
trace((("!! " + _arg1) + " !!"));
};
}
public function info(_arg1:String, _arg2:VisualDebugMode=null):void{
if (_filter(_arg2)){
return;
};
if (((layout) && (showInfos))){
layout.createInfo(_arg1);
};
if (traceOutput){
trace(_arg1);
};
}
public function alertGifRequest(_arg1:String, _arg2:URLRequest, _arg3:GIFRequest):void{
if (layout){
layout.createGIFRequestAlert(_arg1, _arg2, _arg3);
};
if (traceOutput){
trace(((">> " + _arg1) + " <<"));
};
}
}
}//package com.google.analytics.debug
Section 106
//FailureAlert (com.google.analytics.debug.FailureAlert)
package com.google.analytics.debug {
public class FailureAlert extends Alert {
public function FailureAlert(_arg1:DebugConfiguration, _arg2:String, _arg3:Array){
var _local4:Align = Align.bottomLeft;
var _local5:Boolean;
var _local6:Boolean;
if (_arg1.verbose){
_arg2 = ((("<u><span class=\"uiAlertTitle\">Failure</span>" + spaces(18)) + "</u>\n\n") + _arg2);
_local4 = Align.center;
_local5 = false;
_local6 = true;
};
super(_arg2, _arg3, "uiFailure", Style.failureColor, _local4, _local5, _local6);
}
}
}//package com.google.analytics.debug
Section 107
//GIFRequestAlert (com.google.analytics.debug.GIFRequestAlert)
package com.google.analytics.debug {
public class GIFRequestAlert extends Alert {
public function GIFRequestAlert(_arg1:String, _arg2:Array){
super(_arg1, _arg2);
}
}
}//package com.google.analytics.debug
Section 108
//ILayout (com.google.analytics.debug.ILayout)
package com.google.analytics.debug {
import flash.display.*;
import com.google.analytics.core.*;
import flash.net.*;
public interface ILayout {
function createAlert(_arg1:String):void;
function addToStage(_arg1:DisplayObject):void;
function createGIFRequestAlert(_arg1:String, _arg2:URLRequest, _arg3:GIFRequest):void;
function createWarning(_arg1:String):void;
function createPanel(_arg1:String, _arg2:uint, _arg3:uint):void;
function createInfo(_arg1:String):void;
function createFailureAlert(_arg1:String):void;
function addToPanel(_arg1:String, _arg2:DisplayObject):void;
function init():void;
function createSuccessAlert(_arg1:String):void;
function createVisualDebug():void;
function destroy():void;
function bringToFront(_arg1:DisplayObject):void;
function isAvailable():Boolean;
}
}//package com.google.analytics.debug
Section 109
//Info (com.google.analytics.debug.Info)
package com.google.analytics.debug {
import flash.events.*;
import flash.utils.*;
public class Info extends Label {
private var _timer:Timer;
public function Info(_arg1:String="", _arg2:uint=3000){
super(_arg1, "uiInfo", Style.infoColor, Align.top, true);
if (_arg2 > 0){
_timer = new Timer(_arg2, 1);
_timer.start();
_timer.addEventListener(TimerEvent.TIMER_COMPLETE, onComplete, false, 0, true);
};
}
public function close():void{
if (parent != null){
parent.removeChild(this);
};
}
override public function onLink(_arg1:TextEvent):void{
switch (_arg1.text){
case "hide":
close();
break;
};
}
public function onComplete(_arg1:TimerEvent):void{
close();
}
}
}//package com.google.analytics.debug
Section 110
//Label (com.google.analytics.debug.Label)
package com.google.analytics.debug {
import flash.display.*;
import flash.events.*;
import flash.text.*;
public class Label extends UISprite {
private var _color:uint;
private var _background:Shape;
private var _textField:TextField;
public var stickToEdge:Boolean;
private var _text:String;
protected var selectable:Boolean;
private var _tag:String;
public static var count:uint = 0;
public function Label(_arg1:String="", _arg2:String="uiLabel", _arg3:uint=0, _arg4:Align=null, _arg5:Boolean=false){
this.name = ("Label" + count++);
selectable = false;
_background = new Shape();
_textField = new TextField();
_text = _arg1;
_tag = _arg2;
if (_arg4 == null){
_arg4 = Align.none;
};
this.alignement = _arg4;
this.stickToEdge = _arg5;
if (_arg3 == 0){
_arg3 = Style.backgroundColor;
};
_color = _arg3;
_textField.addEventListener(TextEvent.LINK, onLink);
}
public function get tag():String{
return (_tag);
}
private function _draw():void{
var _local1:Graphics = _background.graphics;
_local1.clear();
_local1.beginFill(_color);
var _local2:uint = _textField.width;
var _local3:uint = _textField.height;
if (forcedWidth > 0){
_local2 = forcedWidth;
};
Background.drawRounded(this, _local1, _local2, _local3);
_local1.endFill();
}
public function get text():String{
return (_textField.text);
}
public function appendText(_arg1:String, _arg2:String=""):void{
if (_arg1 == ""){
return;
};
if (_arg2 == ""){
_arg2 = tag;
};
_textField.htmlText = (_textField.htmlText + (((("<span class=\"" + _arg2) + "\">") + _arg1) + "</span>"));
_text = (_text + _arg1);
_draw();
resize();
}
public function set text(_arg1:String):void{
if (_arg1 == ""){
_arg1 = _text;
};
_textField.htmlText = (((("<span class=\"" + tag) + "\">") + _arg1) + "</span>");
_text = _arg1;
_draw();
resize();
}
override protected function layout():void{
_textField.type = TextFieldType.DYNAMIC;
_textField.autoSize = TextFieldAutoSize.LEFT;
_textField.background = false;
_textField.selectable = selectable;
_textField.multiline = true;
_textField.styleSheet = Style.sheet;
this.text = _text;
addChild(_background);
addChild(_textField);
}
public function set tag(_arg1:String):void{
_tag = _arg1;
text = "";
}
public function onLink(_arg1:TextEvent):void{
}
override protected function dispose():void{
_textField.removeEventListener(TextEvent.LINK, onLink);
super.dispose();
}
}
}//package com.google.analytics.debug
Section 111
//Layout (com.google.analytics.debug.Layout)
package com.google.analytics.debug {
import flash.display.*;
import flash.events.*;
import com.google.analytics.core.*;
import flash.net.*;
import com.google.analytics.*;
public class Layout implements ILayout {
private var _display:DisplayObject;
private var _infoQueue:Array;
private var _maxCharPerLine:int;// = 85
private var _hasInfo:Boolean;
private var _warningQueue:Array;
private var _hasDebug:Boolean;
private var _hasWarning:Boolean;
private var _mainPanel:Panel;
private var _GRAlertQueue:Array;
private var _debug:DebugConfiguration;
public var visualDebug:Debug;
private var _hasGRAlert:Boolean;
public function Layout(_arg1:DebugConfiguration, _arg2:DisplayObject){
_display = _arg2;
_debug = _arg1;
_hasWarning = false;
_hasInfo = false;
_hasDebug = false;
_hasGRAlert = false;
_warningQueue = [];
_infoQueue = [];
_GRAlertQueue = [];
}
private function onKey(_arg1:KeyboardEvent=null):void{
switch (_arg1.keyCode){
case _debug.showHideKey:
_mainPanel.visible = !(_mainPanel.visible);
break;
case _debug.destroyKey:
destroy();
break;
};
}
public function createWarning(_arg1:String):void{
if (((_hasWarning) || (!(isAvailable())))){
_warningQueue.push(_arg1);
return;
};
_arg1 = _filterMaxChars(_arg1);
_hasWarning = true;
var _local2:Warning = new Warning(_arg1, _debug.warningTimeout);
addToPanel("analytics", _local2);
_local2.addEventListener(Event.REMOVED_FROM_STAGE, _clearWarning, false, 0, true);
if (_hasDebug){
visualDebug.writeBold(_arg1);
};
}
public function bringToFront(_arg1:DisplayObject):void{
_display.stage.setChildIndex(_arg1, (_display.stage.numChildren - 1));
}
public function createFailureAlert(_arg1:String):void{
var _local2:AlertAction;
if (_debug.verbose){
_arg1 = _filterMaxChars(_arg1);
_local2 = new AlertAction("Close", "close", "close");
} else {
_local2 = new AlertAction("X", "close", "close");
};
var _local3:Alert = new FailureAlert(_debug, _arg1, [_local2]);
addToPanel("analytics", _local3);
if (_hasDebug){
if (_debug.verbose){
_arg1 = _arg1.split("\n").join("");
_arg1 = _filterMaxChars(_arg1, 66);
};
visualDebug.writeBold(_arg1);
};
}
public function init():void{
var _local1 = 10;
var _local2:uint = (_display.stage.stageWidth - (_local1 * 2));
var _local3:uint = (_display.stage.stageHeight - (_local1 * 2));
var _local4:Panel = new Panel("analytics", _local2, _local3);
_local4.alignement = Align.top;
_local4.stickToEdge = false;
_local4.title = ("Google Analytics v" + GATracker.version);
_mainPanel = _local4;
addToStage(_local4);
bringToFront(_local4);
if (_debug.minimizedOnStart){
_mainPanel.onToggle();
};
createVisualDebug();
_display.stage.addEventListener(KeyboardEvent.KEY_DOWN, onKey, false, 0, true);
}
public function addToPanel(_arg1:String, _arg2:DisplayObject):void{
var _local4:Panel;
var _local3:DisplayObject = _display.stage.getChildByName(_arg1);
if (_local3){
_local4 = (_local3 as Panel);
_local4.addData(_arg2);
} else {
trace((("panel \"" + _arg1) + "\" not found"));
};
}
private function _clearInfo(_arg1:Event):void{
_hasInfo = false;
if (_infoQueue.length > 0){
createInfo(_infoQueue.shift());
};
}
private function _filterMaxChars(_arg1:String, _arg2:int=0):String{
var _local6:String;
var _local3 = "\n";
var _local4:Array = [];
var _local5:Array = _arg1.split(_local3);
if (_arg2 == 0){
_arg2 = _maxCharPerLine;
};
var _local7:int;
while (_local7 < _local5.length) {
_local6 = _local5[_local7];
while (_local6.length > _arg2) {
_local4.push(_local6.substr(0, _arg2));
_local6 = _local6.substring(_arg2);
};
_local4.push(_local6);
_local7++;
};
return (_local4.join(_local3));
}
private function _clearGRAlert(_arg1:Event):void{
_hasGRAlert = false;
if (_GRAlertQueue.length > 0){
createGIFRequestAlert.apply(this, _GRAlertQueue.shift());
};
}
public function createSuccessAlert(_arg1:String):void{
var _local2:AlertAction;
if (_debug.verbose){
_arg1 = _filterMaxChars(_arg1);
_local2 = new AlertAction("Close", "close", "close");
} else {
_local2 = new AlertAction("X", "close", "close");
};
var _local3:Alert = new SuccessAlert(_debug, _arg1, [_local2]);
addToPanel("analytics", _local3);
if (_hasDebug){
if (_debug.verbose){
_arg1 = _arg1.split("\n").join("");
_arg1 = _filterMaxChars(_arg1, 66);
};
visualDebug.writeBold(_arg1);
};
}
public function isAvailable():Boolean{
return (!((_display.stage == null)));
}
public function createAlert(_arg1:String):void{
_arg1 = _filterMaxChars(_arg1);
var _local2:Alert = new Alert(_arg1, [new AlertAction("Close", "close", "close")]);
addToPanel("analytics", _local2);
if (_hasDebug){
visualDebug.writeBold(_arg1);
};
}
public function createInfo(_arg1:String):void{
if (((_hasInfo) || (!(isAvailable())))){
_infoQueue.push(_arg1);
return;
};
_arg1 = _filterMaxChars(_arg1);
_hasInfo = true;
var _local2:Info = new Info(_arg1, _debug.infoTimeout);
addToPanel("analytics", _local2);
_local2.addEventListener(Event.REMOVED_FROM_STAGE, _clearInfo, false, 0, true);
if (_hasDebug){
visualDebug.write(_arg1);
};
}
public function createGIFRequestAlert(_arg1:String, _arg2:URLRequest, _arg3:GIFRequest):void{
var message = _arg1;
var request = _arg2;
var ref = _arg3;
if (_hasGRAlert){
_GRAlertQueue.push([message, request, ref]);
return;
};
_hasGRAlert = true;
var f:Function = function ():void{
ref.sendRequest(request);
};
message = _filterMaxChars(message);
var gra:GIFRequestAlert = new GIFRequestAlert(message, [new AlertAction("OK", "ok", f), new AlertAction("Cancel", "cancel", "close")]);
addToPanel("analytics", gra);
gra.addEventListener(Event.REMOVED_FROM_STAGE, _clearGRAlert, false, 0, true);
if (_hasDebug){
if (_debug.verbose){
message = message.split("\n").join("");
message = _filterMaxChars(message, 66);
};
visualDebug.write(message);
};
}
public function createVisualDebug():void{
if (!visualDebug){
visualDebug = new Debug();
visualDebug.alignement = Align.bottom;
visualDebug.stickToEdge = true;
addToPanel("analytics", visualDebug);
_hasDebug = true;
};
}
public function addToStage(_arg1:DisplayObject):void{
_display.stage.addChild(_arg1);
}
private function _clearWarning(_arg1:Event):void{
_hasWarning = false;
if (_warningQueue.length > 0){
createWarning(_warningQueue.shift());
};
}
public function createPanel(_arg1:String, _arg2:uint, _arg3:uint):void{
var _local4:Panel = new Panel(_arg1, _arg2, _arg3);
_local4.alignement = Align.center;
_local4.stickToEdge = false;
addToStage(_local4);
bringToFront(_local4);
}
public function destroy():void{
_mainPanel.close();
_debug.layout = null;
}
}
}//package com.google.analytics.debug
Section 112
//Margin (com.google.analytics.debug.Margin)
package com.google.analytics.debug {
public class Margin {
public var top:int;
public var left:int;
public var bottom:int;
public var right:int;
public function Margin(_arg1:int=0, _arg2:int=0, _arg3:int=0, _arg4:int=0){
this.top = _arg1;
this.bottom = _arg2;
this.left = _arg3;
this.right = _arg4;
}
}
}//package com.google.analytics.debug
Section 113
//Panel (com.google.analytics.debug.Panel)
package com.google.analytics.debug {
import flash.display.*;
import flash.events.*;
public class Panel extends UISprite {
private var _savedH:uint;
private var _data:UISprite;
private var _mask:Sprite;
private var _background:Shape;
private var _savedW:uint;
private var _stickToEdge:Boolean;
private var _border:Shape;
private var _borderColor:uint;
protected var baseAlpha:Number;
private var _backgroundColor:uint;
private var _title:Label;
private var _colapsed:Boolean;
private var _name:String;
public function Panel(_arg1:String, _arg2:uint, _arg3:uint, _arg4:uint=0, _arg5:uint=0, _arg6:Number=0.3, _arg7:Align=null, _arg8:Boolean=false){
_name = _arg1;
this.name = _arg1;
this.mouseEnabled = false;
_colapsed = false;
forcedWidth = _arg2;
forcedHeight = _arg3;
this.baseAlpha = _arg6;
_background = new Shape();
_data = new UISprite();
_data.forcedWidth = _arg2;
_data.forcedHeight = _arg3;
_data.mouseEnabled = false;
_title = new Label(_arg1, "uiLabel", 0xFFFFFF, Align.topLeft, _arg8);
_title.buttonMode = true;
_title.margin.top = 0.6;
_title.margin.left = 0.6;
_title.addEventListener(MouseEvent.CLICK, onToggle);
_title.mouseChildren = false;
_border = new Shape();
_mask = new Sprite();
_mask.useHandCursor = false;
_mask.mouseEnabled = false;
_mask.mouseChildren = false;
if (_arg7 == null){
_arg7 = Align.none;
};
this.alignement = _arg7;
this.stickToEdge = _arg8;
if (_arg4 == 0){
_arg4 = Style.backgroundColor;
};
_backgroundColor = _arg4;
if (_arg5 == 0){
_arg5 = Style.borderColor;
};
_borderColor = _arg5;
}
public function get stickToEdge():Boolean{
return (_stickToEdge);
}
public function onToggle(_arg1:MouseEvent=null):void{
if (_colapsed){
_data.visible = true;
} else {
_data.visible = false;
};
_colapsed = !(_colapsed);
_update();
resize();
}
public function set stickToEdge(_arg1:Boolean):void{
_stickToEdge = _arg1;
_title.stickToEdge = _arg1;
}
override protected function dispose():void{
_title.removeEventListener(MouseEvent.CLICK, onToggle);
super.dispose();
}
private function _draw():void{
var _local1:uint;
var _local2:uint;
if (((_savedW) && (_savedH))){
forcedWidth = _savedW;
forcedHeight = _savedH;
};
if (!_colapsed){
_local1 = forcedWidth;
_local2 = forcedHeight;
} else {
_local1 = _title.width;
_local2 = _title.height;
_savedW = forcedWidth;
_savedH = forcedHeight;
forcedWidth = _local1;
forcedHeight = _local2;
};
var _local3:Graphics = _background.graphics;
_local3.clear();
_local3.beginFill(_backgroundColor);
Background.drawRounded(this, _local3, _local1, _local2);
_local3.endFill();
var _local4:Graphics = _data.graphics;
_local4.clear();
_local4.beginFill(_backgroundColor, 0);
Background.drawRounded(this, _local4, _local1, _local2);
_local4.endFill();
var _local5:Graphics = _border.graphics;
_local5.clear();
_local5.lineStyle(0.1, _borderColor);
Background.drawRounded(this, _local5, _local1, _local2);
_local5.endFill();
var _local6:Graphics = _mask.graphics;
_local6.clear();
_local6.beginFill(_backgroundColor);
Background.drawRounded(this, _local6, (_local1 + 1), (_local2 + 1));
_local6.endFill();
}
public function get title():String{
return (_title.text);
}
private function _update():void{
_draw();
if (baseAlpha < 1){
_background.alpha = baseAlpha;
_border.alpha = baseAlpha;
};
}
public function addData(_arg1:DisplayObject):void{
_data.addChild(_arg1);
}
override protected function layout():void{
_update();
addChild(_background);
addChild(_data);
addChild(_title);
addChild(_border);
addChild(_mask);
mask = _mask;
}
public function set title(_arg1:String):void{
_title.text = _arg1;
}
public function close():void{
dispose();
if (parent != null){
parent.removeChild(this);
};
}
}
}//package com.google.analytics.debug
Section 114
//Style (com.google.analytics.debug.Style)
package com.google.analytics.debug {
public const Style:_Style = new _Style();
}//package com.google.analytics.debug
Section 115
//SuccessAlert (com.google.analytics.debug.SuccessAlert)
package com.google.analytics.debug {
public class SuccessAlert extends Alert {
public function SuccessAlert(_arg1:DebugConfiguration, _arg2:String, _arg3:Array){
var _local4:Align = Align.bottomLeft;
var _local5:Boolean;
var _local6:Boolean;
if (_arg1.verbose){
_arg2 = ((("<u><span class=\"uiAlertTitle\">Success</span>" + spaces(18)) + "</u>\n\n") + _arg2);
_local4 = Align.center;
_local5 = false;
_local6 = true;
};
super(_arg2, _arg3, "uiSuccess", Style.successColor, _local4, _local5, _local6);
}
}
}//package com.google.analytics.debug
Section 116
//UISprite (com.google.analytics.debug.UISprite)
package com.google.analytics.debug {
import flash.display.*;
import flash.events.*;
public class UISprite extends Sprite {
private var _forcedWidth:uint;
public var margin:Margin;
protected var alignTarget:DisplayObject;
protected var listenResize:Boolean;
public var alignement:Align;
private var _forcedHeight:uint;
public function UISprite(_arg1:DisplayObject=null){
listenResize = false;
alignement = Align.none;
this.alignTarget = _arg1;
margin = new Margin();
addEventListener(Event.ADDED_TO_STAGE, _onAddedToStage);
addEventListener(Event.REMOVED_FROM_STAGE, _onRemovedFromStage);
}
public function get forcedHeight():uint{
if (_forcedHeight){
return (_forcedHeight);
};
return (height);
}
private function _onAddedToStage(_arg1:Event):void{
layout();
resize();
}
protected function dispose():void{
var _local1:DisplayObject;
var _local2:int;
while (_local2 < numChildren) {
_local1 = getChildAt(_local2);
if (_local1){
removeChild(_local1);
};
_local2++;
};
}
public function set forcedHeight(_arg1:uint):void{
_forcedHeight = _arg1;
}
public function set forcedWidth(_arg1:uint):void{
_forcedWidth = _arg1;
}
protected function layout():void{
}
public function get forcedWidth():uint{
if (_forcedWidth){
return (_forcedWidth);
};
return (width);
}
public function alignTo(_arg1:Align, _arg2:DisplayObject=null):void{
var _local3:uint;
var _local4:uint;
var _local5:uint;
var _local6:uint;
var _local7:UISprite;
if (_arg2 == null){
if ((parent is Stage)){
_arg2 = this.stage;
} else {
_arg2 = parent;
};
};
if (_arg2 == this.stage){
if (this.stage == null){
return;
};
_local3 = this.stage.stageHeight;
_local4 = this.stage.stageWidth;
_local5 = 0;
_local6 = 0;
} else {
_local7 = (_arg2 as UISprite);
if (_local7.forcedHeight){
_local3 = _local7.forcedHeight;
} else {
_local3 = _local7.height;
};
if (_local7.forcedWidth){
_local4 = _local7.forcedWidth;
} else {
_local4 = _local7.width;
};
_local5 = 0;
_local6 = 0;
};
switch (_arg1){
case Align.top:
x = ((_local4 / 2) - (forcedWidth / 2));
y = (_local6 + margin.top);
break;
case Align.bottom:
x = ((_local4 / 2) - (forcedWidth / 2));
y = (((_local6 + _local3) - forcedHeight) - margin.bottom);
break;
case Align.left:
x = (_local5 + margin.left);
y = ((_local3 / 2) - (forcedHeight / 2));
break;
case Align.right:
x = (((_local5 + _local4) - forcedWidth) - margin.right);
y = ((_local3 / 2) - (forcedHeight / 2));
break;
case Align.center:
x = ((_local4 / 2) - (forcedWidth / 2));
y = ((_local3 / 2) - (forcedHeight / 2));
break;
case Align.topLeft:
x = (_local5 + margin.left);
y = (_local6 + margin.top);
break;
case Align.topRight:
x = (((_local5 + _local4) - forcedWidth) - margin.right);
y = (_local6 + margin.top);
break;
case Align.bottomLeft:
x = (_local5 + margin.left);
y = (((_local6 + _local3) - forcedHeight) - margin.bottom);
break;
case Align.bottomRight:
x = (((_local5 + _local4) - forcedWidth) - margin.right);
y = (((_local6 + _local3) - forcedHeight) - margin.bottom);
break;
};
if (((!(listenResize)) && (!((_arg1 == Align.none))))){
_arg2.addEventListener(Event.RESIZE, onResize, false, 0, true);
listenResize = true;
};
this.alignement = _arg1;
this.alignTarget = _arg2;
}
private function _onRemovedFromStage(_arg1:Event):void{
removeEventListener(Event.ADDED_TO_STAGE, _onAddedToStage);
removeEventListener(Event.REMOVED_FROM_STAGE, _onRemovedFromStage);
dispose();
}
public function resize():void{
if (alignement != Align.none){
alignTo(alignement, alignTarget);
};
}
protected function onResize(_arg1:Event):void{
resize();
}
}
}//package com.google.analytics.debug
Section 117
//Warning (com.google.analytics.debug.Warning)
package com.google.analytics.debug {
import flash.events.*;
import flash.utils.*;
public class Warning extends Label {
private var _timer:Timer;
public function Warning(_arg1:String="", _arg2:uint=3000){
super(_arg1, "uiWarning", Style.warningColor, Align.top, false);
margin.top = 32;
if (_arg2 > 0){
_timer = new Timer(_arg2, 1);
_timer.start();
_timer.addEventListener(TimerEvent.TIMER_COMPLETE, onComplete, false, 0, true);
};
}
public function close():void{
if (parent != null){
parent.removeChild(this);
};
}
override public function onLink(_arg1:TextEvent):void{
switch (_arg1.text){
case "hide":
close();
break;
};
}
public function onComplete(_arg1:TimerEvent):void{
close();
}
}
}//package com.google.analytics.debug
Section 118
//VisualDebugMode (com.google.analytics.debug.VisualDebugMode)
package com.google.analytics.debug {
public class VisualDebugMode {
private var _value:int;
private var _name:String;
public static const advanced:VisualDebugMode = new VisualDebugMode(1, "advanced");
;
public static const geek:VisualDebugMode = new VisualDebugMode(2, "geek");
;
public static const basic:VisualDebugMode = new VisualDebugMode(0, "basic");
;
public function VisualDebugMode(_arg1:int=0, _arg2:String=""){
_value = _arg1;
_name = _arg2;
}
public function valueOf():int{
return (_value);
}
public function toString():String{
return (_name);
}
}
}//package com.google.analytics.debug
Section 119
//Item (com.google.analytics.ecommerce.Item)
package com.google.analytics.ecommerce {
import com.google.analytics.utils.*;
public class Item {
private var _price:String;
private var _id:String;
private var _sku:String;
private var _category:String;
private var _quantity:String;
private var _name:String;
public function Item(_arg1:String, _arg2:String, _arg3:String, _arg4:String, _arg5:String, _arg6:String){
this._id = _arg1;
this._sku = _arg2;
this._name = _arg3;
this._category = _arg4;
this._price = _arg5;
this._quantity = _arg6;
}
public function set sku(_arg1:String):void{
_sku = _arg1;
}
public function get price():String{
return (_price);
}
public function get name():String{
return (_name);
}
public function get quantity():String{
return (_quantity);
}
public function set name(_arg1:String):void{
_name = _arg1;
}
public function set price(_arg1:String):void{
_price = _arg1;
}
public function get id():String{
return (_id);
}
public function get sku():String{
return (_sku);
}
public function set quantity(_arg1:String):void{
_quantity = _arg1;
}
public function toGifParams():Variables{
var _local1:Variables = new Variables();
_local1.URIencode = true;
_local1.post = ["utmt", "utmtid", "utmipc", "utmipn", "utmiva", "utmipr", "utmiqt"];
_local1.utmt = "item";
_local1.utmtid = _id;
_local1.utmipc = _sku;
_local1.utmipn = _name;
_local1.utmiva = _category;
_local1.utmipr = _price;
_local1.utmiqt = _quantity;
return (_local1);
}
public function set id(_arg1:String):void{
_id = _arg1;
}
public function set category(_arg1:String):void{
_category = _arg1;
}
public function get category():String{
return (_category);
}
}
}//package com.google.analytics.ecommerce
Section 120
//Transaction (com.google.analytics.ecommerce.Transaction)
package com.google.analytics.ecommerce {
import com.google.analytics.utils.*;
public class Transaction {
private var _items:Array;
private var _total:String;
private var _vars:Variables;
private var _shipping:String;
private var _city:String;
private var _state:String;
private var _country:String;
private var _tax:String;
private var _affiliation:String;
private var _id:String;
public function Transaction(_arg1:String, _arg2:String, _arg3:String, _arg4:String, _arg5:String, _arg6:String, _arg7:String, _arg8:String){
this._id = _arg1;
this._affiliation = _arg2;
this._total = _arg3;
this._tax = _arg4;
this._shipping = _arg5;
this._city = _arg6;
this._state = _arg7;
this._country = _arg8;
_items = new Array();
}
public function get total():String{
return (_total);
}
public function getItemFromArray(_arg1:Number):Item{
return (_items[_arg1]);
}
public function set total(_arg1:String):void{
_total = _arg1;
}
public function getItem(_arg1:String):Item{
var _local2:Number;
_local2 = 0;
while (_local2 < _items.length) {
if (_items[_local2].sku == _arg1){
return (_items[_local2]);
};
_local2++;
};
return (null);
}
public function getItemsLength():Number{
return (_items.length);
}
public function addItem(_arg1:String, _arg2:String, _arg3:String, _arg4:String, _arg5:String):void{
var _local6:Item;
_local6 = getItem(_arg1);
if (_local6 == null){
_local6 = new Item(_id, _arg1, _arg2, _arg3, _arg4, _arg5);
_items.push(_local6);
} else {
_local6.name = _arg2;
_local6.category = _arg3;
_local6.price = _arg4;
_local6.quantity = _arg5;
};
}
public function set shipping(_arg1:String):void{
_shipping = _arg1;
}
public function get country():String{
return (_country);
}
public function get state():String{
return (_state);
}
public function set tax(_arg1:String):void{
_tax = _arg1;
}
public function set affiliation(_arg1:String):void{
_affiliation = _arg1;
}
public function set state(_arg1:String):void{
_state = _arg1;
}
public function get id():String{
return (_id);
}
public function get tax():String{
return (_tax);
}
public function toGifParams():Variables{
var _local1:Variables = new Variables();
_local1.URIencode = true;
_local1.utmt = "tran";
_local1.utmtid = id;
_local1.utmtst = affiliation;
_local1.utmtto = total;
_local1.utmttx = tax;
_local1.utmtsp = shipping;
_local1.utmtci = city;
_local1.utmtrg = state;
_local1.utmtco = country;
_local1.post = ["utmtid", "utmtst", "utmtto", "utmttx", "utmtsp", "utmtci", "utmtrg", "utmtco"];
return (_local1);
}
public function get affiliation():String{
return (_affiliation);
}
public function get city():String{
return (_city);
}
public function get shipping():String{
return (_shipping);
}
public function set id(_arg1:String):void{
_id = _arg1;
}
public function set city(_arg1:String):void{
_city = _arg1;
}
public function set country(_arg1:String):void{
_country = _arg1;
}
}
}//package com.google.analytics.ecommerce
Section 121
//AnalyticsEvent (com.google.analytics.events.AnalyticsEvent)
package com.google.analytics.events {
import flash.events.*;
import com.google.analytics.*;
public class AnalyticsEvent extends Event {
public var tracker:AnalyticsTracker;
public static const READY:String = "ready";
public function AnalyticsEvent(_arg1:String, _arg2:AnalyticsTracker, _arg3:Boolean=false, _arg4:Boolean=false){
super(_arg1, _arg3, _arg4);
this.tracker = _arg2;
}
override public function clone():Event{
return (new AnalyticsEvent(type, tracker, bubbles, cancelable));
}
}
}//package com.google.analytics.events
Section 122
//AdSenseGlobals (com.google.analytics.external.AdSenseGlobals)
package com.google.analytics.external {
import com.google.analytics.debug.*;
public class AdSenseGlobals extends JavascriptProxy {
private var _gaGlobalVerified:Boolean;// = false
public static var gaGlobal_js:XML = <script>
<![CDATA[
function()
{
try
{
gaGlobal
}
catch(e)
{
gaGlobal = {} ;
}
}
]]>
</script>
;
public function AdSenseGlobals(_arg1:DebugConfiguration){
super(_arg1);
}
public function set vid(_arg1:String):void{
if (!isAvailable()){
return;
};
_verify();
setProperty("gaGlobal.vid", _arg1);
}
public function get hid():String{
if (!isAvailable()){
return (null);
};
_verify();
return (getProperty("gaGlobal.hid"));
}
public function set hid(_arg1:String):void{
if (!isAvailable()){
return;
};
_verify();
setProperty("gaGlobal.hid", _arg1);
}
public function get dh():String{
if (!isAvailable()){
return (null);
};
_verify();
return (getProperty("gaGlobal.dh"));
}
public function get sid():String{
if (!isAvailable()){
return (null);
};
_verify();
return (getProperty("gaGlobal.sid"));
}
public function get vid():String{
if (!isAvailable()){
return (null);
};
_verify();
return (getProperty("gaGlobal.vid"));
}
private function _verify():void{
if (!_gaGlobalVerified){
executeBlock(gaGlobal_js);
_gaGlobalVerified = true;
};
}
public function set sid(_arg1:String):void{
if (!isAvailable()){
return;
};
_verify();
setProperty("gaGlobal.sid", _arg1);
}
public function get gaGlobal():Object{
if (!isAvailable()){
return (null);
};
_verify();
return (getProperty("gaGlobal"));
}
}
}//package com.google.analytics.external
Section 123
//HTMLDOM (com.google.analytics.external.HTMLDOM)
package com.google.analytics.external {
import com.google.analytics.debug.*;
public class HTMLDOM extends JavascriptProxy {
private var _referrer:String;
private var _language:String;
private var _host:String;
private var _pathname:String;
private var _location:String;
private var _search:String;
private var _characterSet:String;
private var _title:String;
private var _protocol:String;
private var _colorDepth:String;
public static var cache_properties_js:XML = <script>
<![CDATA[
function()
{
var obj = {};
obj.host = document.location.host;
obj.language = navigator.language ? navigator.language : navigator.browserLanguage;
obj.characterSet = document.characterSet ? document.characterSet : document.charset;
obj.colorDepth = window.screen.colorDepth;
obj.location = document.location.toString();
obj.pathname = document.location.pathname;
obj.protocol = document.location.protocol;
obj.search = document.location.search;
obj.referrer = document.referrer;
obj.title = document.title;
return obj;
}
]]>
</script>
;
public function HTMLDOM(_arg1:DebugConfiguration){
super(_arg1);
}
public function get search():String{
if (_search){
return (_search);
};
if (!isAvailable()){
return (null);
};
_search = getProperty("document.location.search");
return (_search);
}
public function get location():String{
if (_location){
return (_location);
};
if (!isAvailable()){
return (null);
};
_location = getPropertyString("document.location");
return (_location);
}
public function get pathname():String{
if (_pathname){
return (_pathname);
};
if (!isAvailable()){
return (null);
};
_pathname = getProperty("document.location.pathname");
return (_pathname);
}
public function cacheProperties():void{
if (!isAvailable()){
return;
};
var _local1:Object = call(cache_properties_js);
if (_local1){
_host = _local1.host;
_language = _local1.language;
_characterSet = _local1.characterSet;
_colorDepth = _local1.colorDepth;
_location = _local1.location;
_pathname = _local1.pathname;
_protocol = _local1.protocol;
_search = _local1.search;
_referrer = _local1.referrer;
_title = _local1.title;
};
}
public function get language():String{
if (_language){
return (_language);
};
if (!isAvailable()){
return (null);
};
var _local1:String = getProperty("navigator.language");
if (_local1 == null){
_local1 = getProperty("navigator.browserLanguage");
};
_language = _local1;
return (_language);
}
public function get colorDepth():String{
if (_colorDepth){
return (_colorDepth);
};
if (!isAvailable()){
return (null);
};
_colorDepth = getProperty("window.screen.colorDepth");
return (_colorDepth);
}
public function get referrer():String{
if (_referrer){
return (_referrer);
};
if (!isAvailable()){
return (null);
};
_referrer = getProperty("document.referrer");
return (_referrer);
}
public function get protocol():String{
if (_protocol){
return (_protocol);
};
if (!isAvailable()){
return (null);
};
_protocol = getProperty("document.location.protocol");
return (_protocol);
}
public function get host():String{
if (_host){
return (_host);
};
if (!isAvailable()){
return (null);
};
_host = getProperty("document.location.host");
return (_host);
}
public function get characterSet():String{
if (_characterSet){
return (_characterSet);
};
if (!isAvailable()){
return (null);
};
var _local1:String = getProperty("document.characterSet");
if (_local1 == null){
_local1 = getProperty("document.charset");
};
_characterSet = _local1;
return (_characterSet);
}
public function get title():String{
if (_title){
return (_title);
};
if (!isAvailable()){
return (null);
};
_title = getProperty("document.title");
return (_title);
}
}
}//package com.google.analytics.external
Section 124
//JavascriptProxy (com.google.analytics.external.JavascriptProxy)
package com.google.analytics.external {
import com.google.analytics.debug.*;
import flash.system.*;
import flash.external.*;
public class JavascriptProxy {
private var _notAvailableWarning:Boolean;// = true
private var _debug:DebugConfiguration;
public static var setProperty_js:XML = <script>
<![CDATA[
function( path , value )
{
var paths;
var prop;
if( path.indexOf(".") > 0 )
{
paths = path.split(".");
prop = paths.pop() ;
}
else
{
paths = [];
prop = path;
}
var target = window ;
var len = paths.length ;
for( var i = 0 ; i < len ; i++ )
{
target = target[ paths[i] ] ;
}
target[ prop ] = value ;
}
]]>
</script>
;
public static var hasProperty_js:XML = <script>
<![CDATA[
function( path )
{
var paths;
if( path.indexOf(".") > 0 )
{
paths = path.split(".");
}
else
{
paths = [path];
}
var target = window ;
var len = paths.length ;
for( var i = 0 ; i < len ; i++ )
{
target = target[ paths[i] ] ;
}
if( target )
{
return true;
}
else
{
return false;
}
}
]]>
</script>
;
public static var setPropertyRef_js:XML = <script>
<![CDATA[
function( path , target )
{
var paths;
var prop;
if( path.indexOf(".") > 0 )
{
paths = path.split(".");
prop = paths.pop() ;
}
else
{
paths = [];
prop = path;
}
alert( "paths:"+paths.length+", prop:"+prop );
var targets;
var name;
if( target.indexOf(".") > 0 )
{
targets = target.split(".");
name = targets.pop();
}
else
{
targets = [];
name = target;
}
alert( "targets:"+targets.length+", name:"+name );
var root = window;
var len = paths.length;
for( var i = 0 ; i < len ; i++ )
{
root = root[ paths[i] ] ;
}
var ref = window;
var depth = targets.length;
for( var j = 0 ; j < depth ; j++ )
{
ref = ref[ targets[j] ] ;
}
root[ prop ] = ref[name] ;
}
]]>
</script>
;
public function JavascriptProxy(_arg1:DebugConfiguration){
_debug = _arg1;
}
public function getProperty(_arg1:String){
return (call((_arg1 + ".valueOf")));
}
public function hasProperty(_arg1:String):Boolean{
return (call(hasProperty_js, _arg1));
}
public function setProperty(_arg1:String, _arg2):void{
call(setProperty_js, _arg1, _arg2);
}
public function executeBlock(_arg1:String):void{
var data = _arg1;
if (isAvailable()){
try {
ExternalInterface.call(data);
} catch(e:SecurityError) {
if (_debug.javascript){
_debug.warning("ExternalInterface is not allowed.\nEnsure that allowScriptAccess is set to \"always\" in the Flash embed HTML.");
};
} catch(e:Error) {
if (_debug.javascript){
_debug.warning(("ExternalInterface failed to make the call\nreason: " + e.message));
};
};
};
}
public function getPropertyString(_arg1:String):String{
return (call((_arg1 + ".toString")));
}
public function setPropertyByReference(_arg1:String, _arg2:String):void{
call(setPropertyRef_js, _arg1, _arg2);
}
public function call(_arg1:String, ... _args){
var output:String;
var functionName = _arg1;
var args = _args;
if (isAvailable()){
try {
if (((_debug.javascript) && (_debug.verbose))){
output = "";
output = ("Flash->JS: " + functionName);
output = (output + "( ");
if (args.length > 0){
output = (output + args.join(","));
};
output = (output + " )");
_debug.info(output);
};
args.unshift(functionName);
return (ExternalInterface.call.apply(ExternalInterface, args));
} catch(e:SecurityError) {
if (_debug.javascript){
_debug.warning("ExternalInterface is not allowed.\nEnsure that allowScriptAccess is set to \"always\" in the Flash embed HTML.");
};
} catch(e:Error) {
if (_debug.javascript){
_debug.warning(("ExternalInterface failed to make the call\nreason: " + e.message));
};
};
};
return (null);
}
public function isAvailable():Boolean{
var _local1:Boolean = ExternalInterface.available;
if (((_local1) && ((Capabilities.playerType == "External")))){
_local1 = false;
};
if (((((!(_local1)) && (_debug.javascript))) && (_notAvailableWarning))){
_debug.warning("ExternalInterface is not available.");
_notAvailableWarning = false;
};
return (_local1);
}
}
}//package com.google.analytics.external
Section 125
//Environment (com.google.analytics.utils.Environment)
package com.google.analytics.utils {
import com.google.analytics.debug.*;
import com.google.analytics.external.*;
import flash.system.*;
public class Environment {
private var _dom:HTMLDOM;
private var _appName:String;
private var _debug:DebugConfiguration;
private var _appVersion:Version;
private var _url:String;
private var _protocol:Protocols;
private var _userAgent:UserAgent;
public function Environment(_arg1:String="", _arg2:String="", _arg3:String="", _arg4:DebugConfiguration=null, _arg5:HTMLDOM=null){
var _local6:Version;
super();
if (_arg2 == ""){
if (isAIR()){
_arg2 = "AIR";
} else {
_arg2 = "Flash";
};
};
if (_arg3 == ""){
_local6 = flashVersion;
} else {
_local6 = Version.fromString(_arg3);
};
_url = _arg1;
_appName = _arg2;
_appVersion = _local6;
_debug = _arg4;
_dom = _arg5;
}
public function isAIR():Boolean{
return ((((playerType == "Desktop")) && ((Security.sandboxType.toString() == "application"))));
}
public function get screenWidth():Number{
return (Capabilities.screenResolutionX);
}
public function get playerType():String{
return (Capabilities.playerType);
}
public function get locationSearch():String{
var _local1:String = _dom.search;
if (_local1){
return (_local1);
};
return ("");
}
public function get protocol():Protocols{
if (!_protocol){
_findProtocol();
};
return (_protocol);
}
public function get flashVersion():Version{
var _local1:Version = Version.fromString(Capabilities.version.split(" ")[1], ",");
return (_local1);
}
public function get userAgent():UserAgent{
if (!_userAgent){
_userAgent = new UserAgent(this, appName, appVersion.toString(4));
};
return (_userAgent);
}
public function get languageEncoding():String{
var _local1:String;
if (System.useCodePage){
_local1 = _dom.characterSet;
if (_local1){
return (_local1);
};
return ("-");
};
return ("UTF-8");
}
public function get appName():String{
return (_appName);
}
public function get screenColorDepth():String{
var _local1:String;
switch (Capabilities.screenColor){
case "bw":
_local1 = "1";
break;
case "gray":
_local1 = "2";
break;
case "color":
default:
_local1 = "24";
};
var _local2:String = _dom.colorDepth;
if (_local2){
_local1 = _local2;
};
return (_local1);
}
private function _findProtocol():void{
var _local4:String;
var _local5:String;
var _local1:Protocols = Protocols.none;
if (_url != ""){
_local4 = _url.toLowerCase();
_local5 = _local4.substr(0, 5);
switch (_local5){
case "file:":
_local1 = Protocols.file;
break;
case "http:":
_local1 = Protocols.HTTP;
break;
case "https":
if (_local4.charAt(5) == ":"){
_local1 = Protocols.HTTPS;
};
break;
default:
_protocol = Protocols.none;
};
};
var _local2:String = _dom.protocol;
var _local3:String = (_local1.toString() + ":").toLowerCase();
if (((((_local2) && (!((_local2 == _local3))))) && (_debug))){
_debug.warning(((("Protocol mismatch: SWF=" + _local3) + ", DOM=") + _local2));
};
_protocol = _local1;
}
public function get locationSWFPath():String{
return (_url);
}
public function get platform():String{
var _local1:String = Capabilities.manufacturer;
return (_local1.split("Adobe ")[1]);
}
public function get operatingSystem():String{
return (Capabilities.os);
}
public function set appName(_arg1:String):void{
_appName = _arg1;
userAgent.applicationProduct = _arg1;
}
function set url(_arg1:String):void{
_url = _arg1;
}
public function get referrer():String{
var _local1:String = _dom.referrer;
if (_local1){
return (_local1);
};
if (protocol == Protocols.file){
return ("localhost");
};
return ("");
}
public function isInHTML():Boolean{
return ((Capabilities.playerType == "PlugIn"));
}
public function get language():String{
var _local1:String = _dom.language;
var _local2:String = Capabilities.language;
if (_local1){
if ((((_local1.length > _local2.length)) && ((_local1.substr(0, _local2.length) == _local2)))){
_local2 = _local1;
};
};
return (_local2);
}
public function get domainName():String{
var _local1:String;
var _local2:String;
var _local3:int;
if ((((protocol == Protocols.HTTP)) || ((protocol == Protocols.HTTPS)))){
_local1 = _url.toLowerCase();
if (protocol == Protocols.HTTP){
_local2 = _local1.split("http://").join("");
} else {
if (protocol == Protocols.HTTPS){
_local2 = _local1.split("https://").join("");
};
};
_local3 = _local2.indexOf("/");
if (_local3 > -1){
_local2 = _local2.substring(0, _local3);
};
return (_local2);
};
if (protocol == Protocols.file){
return ("localhost");
};
return ("");
}
public function set userAgent(_arg1:UserAgent):void{
_userAgent = _arg1;
}
public function set appVersion(_arg1:Version):void{
_appVersion = _arg1;
userAgent.applicationVersion = _arg1.toString(4);
}
public function get screenHeight():Number{
return (Capabilities.screenResolutionY);
}
public function get locationPath():String{
var _local1:String = _dom.pathname;
if (_local1){
return (_local1);
};
return ("");
}
public function get documentTitle():String{
var _local1:String = _dom.title;
if (_local1){
return (_local1);
};
return ("");
}
public function get appVersion():Version{
return (_appVersion);
}
}
}//package com.google.analytics.utils
Section 126
//Protocols (com.google.analytics.utils.Protocols)
package com.google.analytics.utils {
public class Protocols {
private var _value:int;
private var _name:String;
public static const none:Protocols = new Protocols(0, "none");
;
public static const HTTPS:Protocols = new Protocols(3, "HTTPS");
;
public static const file:Protocols = new Protocols(1, "file");
;
public static const HTTP:Protocols = new Protocols(2, "HTTP");
;
public function Protocols(_arg1:int=0, _arg2:String=""){
_value = _arg1;
_name = _arg2;
}
public function valueOf():int{
return (_value);
}
public function toString():String{
return (_name);
}
}
}//package com.google.analytics.utils
Section 127
//Timespan (com.google.analytics.utils.Timespan)
package com.google.analytics.utils {
public class Timespan {
public static var sixmonths:Number = 15768000;
public static var twoyears:Number = 63072000;
public static var thirtyminutes:Number = 1800;
}
}//package com.google.analytics.utils
Section 128
//URL (com.google.analytics.utils.URL)
package com.google.analytics.utils {
public class URL {
private var _url:String;
public function URL(_arg1:String=""){
_url = _arg1.toLowerCase();
}
public function get domain():String{
var _local1:Array;
if (((!((hostName == ""))) && ((hostName.indexOf(".") > -1)))){
_local1 = hostName.split(".");
switch (_local1.length){
case 2:
return (hostName);
case 3:
if (_local1[1] == "co"){
return (hostName);
};
_local1.shift();
return (_local1.join("."));
case 4:
_local1.shift();
return (_local1.join("."));
};
};
return ("");
}
public function get path():String{
var _local1:String = _url;
if (_local1.indexOf("://") > -1){
_local1 = _local1.split("://")[1];
};
if (_local1.indexOf(hostName) == 0){
_local1 = _local1.substr(hostName.length);
};
if (_local1.indexOf("?") > -1){
_local1 = _local1.split("?")[0];
};
if (_local1.charAt(0) != "/"){
_local1 = ("/" + _local1);
};
return (_local1);
}
public function get protocol():Protocols{
var _local1:String = _url.split("://")[0];
switch (_local1){
case "file":
return (Protocols.file);
case "http":
return (Protocols.HTTP);
case "https":
return (Protocols.HTTPS);
default:
return (Protocols.none);
};
}
public function get hostName():String{
var _local1:String = _url;
if (_local1.indexOf("://") > -1){
_local1 = _local1.split("://")[1];
};
if (_local1.indexOf("/") > -1){
_local1 = _local1.split("/")[0];
};
if (_local1.indexOf("?") > -1){
_local1 = _local1.split("?")[0];
};
if ((((protocol == Protocols.file)) || ((protocol == Protocols.none)))){
return ("");
};
return (_local1);
}
public function get subDomain():String{
if (((!((domain == ""))) && (!((domain == hostName))))){
return (hostName.split(("." + domain)).join(""));
};
return ("");
}
public function get search():String{
var _local1:String = _url;
if (_local1.indexOf("://") > -1){
_local1 = _local1.split("://")[1];
};
if (_local1.indexOf(hostName) == 0){
_local1 = _local1.substr(hostName.length);
};
if (_local1.indexOf("?") > -1){
_local1 = _local1.split("?")[1];
} else {
_local1 = "";
};
return (_local1);
}
}
}//package com.google.analytics.utils
Section 129
//UserAgent (com.google.analytics.utils.UserAgent)
package com.google.analytics.utils {
import com.google.analytics.core.*;
import flash.system.*;
public class UserAgent {
private var _localInfo:Environment;
private var _applicationProduct:String;
private var _version:Version;
public static var minimal:Boolean = false;
public function UserAgent(_arg1:Environment, _arg2:String="", _arg3:String=""){
_localInfo = _arg1;
applicationProduct = _arg2;
_version = Version.fromString(_arg3);
}
public function get tamarinProductToken():String{
if (UserAgent.minimal){
return ("");
};
if (System.vmVersion){
return (("Tamarin/" + Utils.trim(System.vmVersion, true)));
};
return ("");
}
public function get applicationVersion():String{
return (_version.toString(2));
}
public function get vendorProductToken():String{
var _local1 = "";
if (_localInfo.isAIR()){
_local1 = (_local1 + "AIR");
} else {
_local1 = (_local1 + "FlashPlayer");
};
_local1 = (_local1 + "/");
_local1 = (_local1 + _version.toString(3));
return (_local1);
}
public function toString():String{
var _local1 = "";
_local1 = (_local1 + applicationProductToken);
if (applicationComment != ""){
_local1 = (_local1 + (" " + applicationComment));
};
if (tamarinProductToken != ""){
_local1 = (_local1 + (" " + tamarinProductToken));
};
if (vendorProductToken != ""){
_local1 = (_local1 + (" " + vendorProductToken));
};
return (_local1);
}
public function get applicationComment():String{
var _local1:Array = [];
_local1.push(_localInfo.platform);
_local1.push(_localInfo.playerType);
if (!UserAgent.minimal){
_local1.push(_localInfo.operatingSystem);
_local1.push(_localInfo.language);
};
if (Capabilities.isDebugger){
_local1.push("DEBUG");
};
if (_local1.length > 0){
return ((("(" + _local1.join("; ")) + ")"));
};
return ("");
}
public function set applicationVersion(_arg1:String):void{
_version = Version.fromString(_arg1);
}
public function get applicationProductToken():String{
var _local1:String = applicationProduct;
if (applicationVersion != ""){
_local1 = (_local1 + ("/" + applicationVersion));
};
return (_local1);
}
public function set applicationProduct(_arg1:String):void{
_applicationProduct = _arg1;
}
public function get applicationProduct():String{
return (_applicationProduct);
}
}
}//package com.google.analytics.utils
Section 130
//Variables (com.google.analytics.utils.Variables)
package com.google.analytics.utils {
import flash.net.*;
public dynamic class Variables {
public var post:Array;
public var URIencode:Boolean;
public var pre:Array;
public var sort:Boolean;// = true
public function Variables(_arg1:String=null, _arg2:Array=null, _arg3:Array=null){
pre = [];
post = [];
super();
if (_arg1){
decode(_arg1);
};
if (_arg2){
this.pre = _arg2;
};
if (_arg3){
this.post = _arg3;
};
}
private function _join(_arg1:Variables):void{
var _local2:String;
if (!_arg1){
return;
};
for (_local2 in _arg1) {
this[_local2] = _arg1[_local2];
};
}
public function join(... _args):void{
var _local2:int = _args.length;
var _local3:int;
while (_local3 < _local2) {
if (!(_args[_local3] is Variables)){
} else {
_join(_args[_local3]);
};
_local3++;
};
}
public function toString():String{
var _local2:String;
var _local3:String;
var _local4:String;
var _local5:int;
var _local6:int;
var _local7:String;
var _local8:String;
var _local1:Array = [];
for (_local3 in this) {
_local2 = this[_local3];
if (URIencode){
_local2 = encodeURI(_local2);
};
_local1.push(((_local3 + "=") + _local2));
};
if (sort){
_local1.sort();
};
if (pre.length > 0){
pre.reverse();
_local5 = 0;
while (_local5 < pre.length) {
_local7 = pre[_local5];
_local6 = 0;
while (_local6 < _local1.length) {
_local4 = _local1[_local6];
if (_local4.indexOf(_local7) == 0){
_local1.unshift(_local1.splice(_local6, 1)[0]);
};
_local6++;
};
_local5++;
};
pre.reverse();
};
if (post.length > 0){
_local5 = 0;
while (_local5 < post.length) {
_local8 = post[_local5];
_local6 = 0;
while (_local6 < _local1.length) {
_local4 = _local1[_local6];
if (_local4.indexOf(_local8) == 0){
_local1.push(_local1.splice(_local6, 1)[0]);
};
_local6++;
};
_local5++;
};
};
return (_local1.join("&"));
}
public function decode(_arg1:String):void{
var _local2:Array;
var _local3:String;
var _local4:String;
var _local5:String;
var _local6:Array;
if (_arg1 == ""){
return;
};
if (_arg1.charAt(0) == "?"){
_arg1 = _arg1.substr(1, _arg1.length);
};
if (_arg1.indexOf("&") > -1){
_local2 = _arg1.split("&");
} else {
_local2 = [_arg1];
};
var _local7:int;
while (_local7 < _local2.length) {
_local3 = _local2[_local7];
if (_local3.indexOf("=") > -1){
_local6 = _local3.split("=");
_local4 = _local6[0];
_local5 = decodeURI(_local6[1]);
this[_local4] = _local5;
};
_local7++;
};
}
public function toURLVariables():URLVariables{
var _local2:String;
var _local1:URLVariables = new URLVariables();
for (_local2 in this) {
_local1[_local2] = this[_local2];
};
return (_local1);
}
}
}//package com.google.analytics.utils
Section 131
//Version (com.google.analytics.utils.Version)
package com.google.analytics.utils {
public class Version {
private var _revision:uint;
private var _maxBuild:uint;// = 0xFF
private var _maxMinor:uint;// = 15
private var _maxMajor:uint;// = 15
private var _separator:String;// = "."
private var _maxRevision:uint;// = 0xFFFF
private var _build:uint;
private var _major:uint;
private var _minor:uint;
public function Version(_arg1:uint=0, _arg2:uint=0, _arg3:uint=0, _arg4:uint=0){
var _local5:Version;
super();
if ((((((((_arg1 > _maxMajor)) && ((_arg2 == 0)))) && ((_arg3 == 0)))) && ((_arg4 == 0)))){
_local5 = Version.fromNumber(_arg1);
_arg1 = _local5.major;
_arg2 = _local5.minor;
_arg3 = _local5.build;
_arg4 = _local5.revision;
};
this.major = _arg1;
this.minor = _arg2;
this.build = _arg3;
this.revision = _arg4;
}
public function toString(_arg1:int=0):String{
var _local2:Array;
if ((((_arg1 <= 0)) || ((_arg1 > 4)))){
_arg1 = getFields();
};
switch (_arg1){
case 1:
_local2 = [major];
break;
case 2:
_local2 = [major, minor];
break;
case 3:
_local2 = [major, minor, build];
break;
case 4:
default:
_local2 = [major, minor, build, revision];
};
return (_local2.join(_separator));
}
public function set revision(_arg1:uint):void{
_revision = Math.min(_arg1, _maxRevision);
}
public function get revision():uint{
return (_revision);
}
public function set build(_arg1:uint):void{
_build = Math.min(_arg1, _maxBuild);
}
public function set minor(_arg1:uint):void{
_minor = Math.min(_arg1, _maxMinor);
}
public function get build():uint{
return (_build);
}
public function set major(_arg1:uint):void{
_major = Math.min(_arg1, _maxMajor);
}
public function get minor():uint{
return (_minor);
}
private function getFields():int{
var _local1 = 4;
if (revision == 0){
_local1--;
};
if ((((_local1 == 3)) && ((build == 0)))){
_local1--;
};
if ((((_local1 == 2)) && ((minor == 0)))){
_local1--;
};
return (_local1);
}
public function valueOf():uint{
return (((((major << 28) | (minor << 24)) | (build << 16)) | revision));
}
public function get major():uint{
return (_major);
}
public function equals(_arg1):Boolean{
if (!(_arg1 is Version)){
return (false);
};
if ((((((((_arg1.major == major)) && ((_arg1.minor == minor)))) && ((_arg1.build == build)))) && ((_arg1.revision == revision)))){
return (true);
};
return (false);
}
public static function fromString(_arg1:String="", _arg2:String="."):Version{
var _local4:Array;
var _local3:Version = new (Version);
if ((((_arg1 == "")) || ((_arg1 == null)))){
return (_local3);
};
if (_arg1.indexOf(_arg2) > -1){
_local4 = _arg1.split(_arg2);
_local3.major = parseInt(_local4[0]);
_local3.minor = parseInt(_local4[1]);
_local3.build = parseInt(_local4[2]);
_local3.revision = parseInt(_local4[3]);
} else {
_local3.major = parseInt(_arg1);
};
return (_local3);
}
public static function fromNumber(_arg1:Number=0):Version{
var _local2:Version = new (Version);
if (((((((((((isNaN(_arg1)) || ((_arg1 == 0)))) || ((_arg1 < 0)))) || ((_arg1 == Number.MAX_VALUE)))) || ((_arg1 == Number.POSITIVE_INFINITY)))) || ((_arg1 == Number.NEGATIVE_INFINITY)))){
return (_local2);
};
_local2.major = (_arg1 >>> 28);
_local2.minor = ((_arg1 & 251658240) >>> 24);
_local2.build = ((_arg1 & 0xFF0000) >>> 16);
_local2.revision = (_arg1 & 0xFFFF);
return (_local2);
}
}
}//package com.google.analytics.utils
Section 132
//Bridge (com.google.analytics.v4.Bridge)
package com.google.analytics.v4 {
import com.google.analytics.core.*;
import com.google.analytics.debug.*;
import com.google.analytics.external.*;
public class Bridge implements GoogleAnalyticsAPI {
private var _debug:DebugConfiguration;
private var _proxy:JavascriptProxy;
private var _jsContainer:String;// = "_GATracker"
private var _hasGATracker:Boolean;// = false
private var _account:String;
private static var _linkTrackingObject_js:XML = <script>
<![CDATA[
function( container , target )
{
var targets ;
var name ;
if( target.indexOf(".") > 0 )
{
targets = target.split(".");
name = targets.pop();
}
else
{
targets = [];
name = target;
}
var ref = window;
var depth = targets.length;
for( var j = 0 ; j < depth ; j++ )
{
ref = ref[ targets[j] ] ;
}
window[container][target] = ref[name] ;
}
]]>
</script>
;
private static var _createTrackingObject_js:XML = <script>
<![CDATA[
function( acct )
{
_GATracker[acct] = _gat._getTracker(acct);
}
]]>
</script>
;
private static var _injectTrackingObject_js:XML = <script>
<![CDATA[
function()
{
try
{
_GATracker
}
catch(e)
{
_GATracker = {};
}
}
]]>
</script>
;
private static var _checkGAJS_js:XML = <script>
<![CDATA[
function()
{
if( _gat && _gat._getTracker )
{
return true;
}
return false;
}
]]>
</script>
;
private static var _checkValidTrackingObject_js:XML = <script>
<![CDATA[
function(acct)
{
if( _GATracker[acct] && (_GATracker[acct]._getAccount) )
{
return true ;
}
else
{
return false;
}
}
]]>
</script>
;
public function Bridge(_arg1:String, _arg2:DebugConfiguration, _arg3:JavascriptProxy){
var _local4:String;
var _local5:String;
var _local6:String;
super();
_account = _arg1;
_debug = _arg2;
_proxy = _arg3;
if (!_checkGAJS()){
_local4 = "";
_local4 = (_local4 + "ga.js not found, be sure to check if\n");
_local4 = (_local4 + "<script src=\"http://www.google-analytics.com/ga.js\"></script>\n");
_local4 = (_local4 + "is included in the HTML.");
_debug.warning(_local4);
throw (new Error(_local4));
};
if (!_hasGATracker){
if (((_debug.javascript) && (_debug.verbose))){
_local5 = "";
_local5 = (_local5 + "The Google Analytics tracking code was not found on the container page\n");
_local5 = (_local5 + "we create it");
_debug.info(_local5, VisualDebugMode.advanced);
};
_injectTrackingObject();
};
if (Utils.validateAccount(_arg1)){
_createTrackingObject(_arg1);
} else {
if (_checkTrackingObject(_arg1)){
_linkTrackingObject(_arg1);
} else {
_local6 = "";
_local6 = (_local6 + (("JS Object \"" + _arg1) + "\" doesn't exist in DOM\n"));
_local6 = (_local6 + "Bridge object not created.");
_debug.warning(_local6);
throw (new Error(_local6));
};
};
}
public function link(_arg1:String, _arg2:Boolean=false):void{
_debug.info((((("link( " + _arg1) + ", ") + _arg2) + " )"));
_call("_link", _arg1, _arg2);
}
public function addOrganic(_arg1:String, _arg2:String):void{
_debug.info((("addOrganic( " + [_arg1, _arg2].join(", ")) + " )"));
_call("_addOrganic", _arg1);
}
public function setAllowLinker(_arg1:Boolean):void{
_debug.info((("setAllowLinker( " + _arg1) + " )"));
_call("_setAllowLinker", _arg1);
}
public function getLinkerUrl(_arg1:String="", _arg2:Boolean=false):String{
_debug.info((((("getLinkerUrl(" + _arg1) + ", ") + _arg2) + ")"));
return (_call("_getLinkerUrl", _arg1, _arg2));
}
private function _linkTrackingObject(_arg1:String):void{
_proxy.call(_linkTrackingObject_js, _jsContainer, _arg1);
}
public function setClientInfo(_arg1:Boolean):void{
_debug.info((("setClientInfo( " + _arg1) + " )"));
_call("_setClientInfo", _arg1);
}
public function trackTrans():void{
_debug.info("trackTrans()");
_call("_trackTrans");
}
public function trackEvent(_arg1:String, _arg2:String, _arg3:String=null, _arg4:Number=NaN):Boolean{
var _local5 = 2;
if (((_arg3) && (!((_arg3 == ""))))){
_local5 = 3;
};
if ((((_local5 == 3)) && (!(isNaN(_arg4))))){
_local5 = 4;
};
switch (_local5){
case 4:
_debug.info((("trackEvent( " + [_arg1, _arg2, _arg3, _arg4].join(", ")) + " )"));
return (_call("_trackEvent", _arg1, _arg2, _arg3, _arg4));
case 3:
_debug.info((("trackEvent( " + [_arg1, _arg2, _arg3].join(", ")) + " )"));
return (_call("_trackEvent", _arg1, _arg2, _arg3));
case 2:
default:
_debug.info((("trackEvent( " + [_arg1, _arg2].join(", ")) + " )"));
return (_call("_trackEvent", _arg1, _arg2));
};
}
public function setCookieTimeout(_arg1:int):void{
_debug.info((("setCookieTimeout( " + _arg1) + " )"));
_call("_setCookieTimeout", _arg1);
}
public function trackPageview(_arg1:String=""):void{
_debug.info((("trackPageview( " + _arg1) + " )"));
_call("_trackPageview", _arg1);
}
private function _checkValidTrackingObject(_arg1:String):Boolean{
return (_proxy.call(_checkValidTrackingObject_js, _arg1));
}
private function _checkGAJS():Boolean{
return (_proxy.call(_checkGAJS_js));
}
public function linkByPost(_arg1:Object, _arg2:Boolean=false):void{
_debug.warning((((("linkByPost( " + _arg1) + ", ") + _arg2) + " ) not implemented"));
}
public function getClientInfo():Boolean{
_debug.info("getClientInfo()");
return (_call("_getClientInfo"));
}
private function _call(_arg1:String, ... _args){
_args.unshift(((((("window." + _jsContainer) + "[\"") + _account) + "\"].") + _arg1));
return (_proxy.call.apply(_proxy, _args));
}
public function hasGAJS():Boolean{
return (_checkGAJS());
}
private function _checkTrackingObject(_arg1:String):Boolean{
var _local2:Boolean = _proxy.hasProperty(_arg1);
var _local3:Boolean = _proxy.hasProperty((_arg1 + "._getAccount"));
return (((_local2) && (_local3)));
}
public function resetSession():void{
_debug.warning("resetSession() not implemented");
}
public function getDetectTitle():Boolean{
_debug.info("getDetectTitle()");
return (_call("_getDetectTitle"));
}
public function setCampNameKey(_arg1:String):void{
_debug.info((("setCampNameKey( " + _arg1) + " )"));
_call("_setCampNameKey", _arg1);
}
public function setDetectFlash(_arg1:Boolean):void{
_debug.info((("setDetectFlash( " + _arg1) + " )"));
_call("_setDetectFlash", _arg1);
}
public function createEventTracker(_arg1:String):EventTracker{
_debug.info((("createEventTracker( " + _arg1) + " )"));
return (new EventTracker(_arg1, this));
}
public function addItem(_arg1:String, _arg2:String, _arg3:String, _arg4:String, _arg5:Number, _arg6:int):void{
_debug.info((("addItem( " + [_arg1, _arg2, _arg3, _arg4, _arg5, _arg6].join(", ")) + " )"));
_call("_addItem", _arg1, _arg2, _arg3, _arg4, _arg5, _arg6);
}
public function clearIgnoredOrganic():void{
_debug.info("clearIgnoredOrganic()");
_call("_clearIgnoreOrganic");
}
public function setVar(_arg1:String):void{
_debug.info((("setVar( " + _arg1) + " )"));
_call("_setVar", _arg1);
}
public function setDomainName(_arg1:String):void{
_debug.info((("setDomainName( " + _arg1) + " )"));
_call("_setDomainName", _arg1);
}
public function hasTrackingAccount(_arg1:String):Boolean{
if (Utils.validateAccount(_arg1)){
return (_checkValidTrackingObject(_arg1));
};
return (_checkTrackingObject(_arg1));
}
public function setCampSourceKey(_arg1:String):void{
_debug.info((("setCampSourceKey( " + _arg1) + " )"));
_call("_setCampSourceKey", _arg1);
}
public function addTrans(_arg1:String, _arg2:String, _arg3:Number, _arg4:Number, _arg5:Number, _arg6:String, _arg7:String, _arg8:String):void{
_debug.info((("addTrans( " + [_arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8].join(", ")) + " )"));
_call("_addTrans", _arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8);
}
public function setCampContentKey(_arg1:String):void{
_debug.info((("setCampContentKey( " + _arg1) + " )"));
_call("_setCampContentKey", _arg1);
}
public function setLocalServerMode():void{
_debug.info("setLocalServerMode()");
_call("_setLocalServerMode");
}
public function getLocalGifPath():String{
_debug.info("getLocalGifPath()");
return (_call("_getLocalGifPath"));
}
public function clearIgnoredRef():void{
_debug.info("clearIgnoredRef()");
_call("_clearIgnoreRef");
}
public function setAllowAnchor(_arg1:Boolean):void{
_debug.info((("setAllowAnchor( " + _arg1) + " )"));
_call("_setAllowAnchor", _arg1);
}
public function setLocalGifPath(_arg1:String):void{
_debug.info((("setLocalGifPath( " + _arg1) + " )"));
_call("_setLocalGifPath", _arg1);
}
public function getVersion():String{
_debug.info("getVersion()");
return (_call("_getVersion"));
}
private function _injectTrackingObject():void{
_proxy.executeBlock(_injectTrackingObject_js);
_hasGATracker = true;
}
public function setCookiePath(_arg1:String):void{
_debug.info((("setCookiePath( " + _arg1) + " )"));
_call("_setCookiePath", _arg1);
}
public function setSampleRate(_arg1:Number):void{
_debug.info((("setSampleRate( " + _arg1) + " )"));
_call("_setSampleRate", _arg1);
}
public function setAllowHash(_arg1:Boolean):void{
_debug.info((("setAllowHash( " + _arg1) + " )"));
_call("_setAllowHash", _arg1);
}
public function addIgnoredOrganic(_arg1:String):void{
_debug.info((("addIgnoredOrganic( " + _arg1) + " )"));
_call("_addIgnoredOrganic", _arg1);
}
public function setCampNOKey(_arg1:String):void{
_debug.info((("setCampNOKey( " + _arg1) + " )"));
_call("_setCampNOKey", _arg1);
}
public function cookiePathCopy(_arg1:String):void{
_debug.info((("cookiePathCopy( " + _arg1) + " )"));
_call("_cookiePathCopy", _arg1);
}
public function setLocalRemoteServerMode():void{
_debug.info("setLocalRemoteServerMode()");
_call("_setLocalRemoteServerMode");
}
public function getServiceMode():ServerOperationMode{
_debug.info("getServiceMode()");
return (_call("_getServiceMode"));
}
public function setDetectTitle(_arg1:Boolean):void{
_debug.info((("setDetectTitle( " + _arg1) + " )"));
_call("_setDetectTitle", _arg1);
}
private function _createTrackingObject(_arg1:String):void{
_proxy.call(_createTrackingObject_js, _arg1);
}
public function setCampaignTrack(_arg1:Boolean):void{
_debug.info((("setCampaignTrack( " + _arg1) + " )"));
_call("_setCampaignTrack", _arg1);
}
public function clearOrganic():void{
_debug.info("clearOrganic()");
_call("_clearOrganic");
}
public function setCampTermKey(_arg1:String):void{
_debug.info((("setCampTermKey( " + _arg1) + " )"));
_call("_setCampTermKey", _arg1);
}
public function getDetectFlash():Boolean{
_debug.info("getDetectFlash()");
return (_call("_getDetectFlash"));
}
public function setCampMediumKey(_arg1:String):void{
_debug.info((("setCampMediumKey( " + _arg1) + " )"));
_call("_setCampMediumKey", _arg1);
}
public function addIgnoredRef(_arg1:String):void{
_debug.info((("addIgnoredRef( " + _arg1) + " )"));
_call("_addIgnoredRef", _arg1);
}
public function setSessionTimeout(_arg1:int):void{
_debug.info((("setSessionTimeout( " + _arg1) + " )"));
_call("_setSessionTimeout", _arg1);
}
public function setRemoteServerMode():void{
_debug.info("setRemoteServerMode()");
_call("_setRemoteServerMode");
}
public function getAccount():String{
_debug.info("getAccount()");
return (_call("_getAccount"));
}
}
}//package com.google.analytics.v4
Section 133
//Configuration (com.google.analytics.v4.Configuration)
package com.google.analytics.v4 {
import com.google.analytics.core.*;
import com.google.analytics.debug.*;
import com.google.analytics.utils.*;
import com.google.analytics.campaign.*;
public class Configuration {
public var serverMode:ServerOperationMode;
public var detectFlash:Boolean;// = true
public var hasSiteOverlay:Boolean;// = false
public var allowLocalTracking:Boolean;// = true
public var secureRemoteGIFpath:String;// = "https://ssl.google-analytics.com/__utm.gif"
private var _version:String;// = "4.3as"
public var allowDomainHash:Boolean;// = true
public var detectClientInfo:Boolean;// = true
public var idleLoop:Number;// = 30
public var isTrackOutboundSubdomains:Boolean;// = false
public var cookiePath:String;// = "/"
public var transactionFieldDelim:String;// = "|"
private var _organic:Organic;
private var _cookieName:String;// = "analytics"
public var campaignKey:CampaignKey;
public var google:String;// = "google"
public var googleCsePath:String;// = "cse"
public var bucketCapacity:Number;// = 10
private var _sampleRate:Number;// = 1
public var remoteGIFpath:String;// = "http://www.google-analytics.com/__utm.gif"
public var googleSearchParam:String;// = "q"
public var allowLinker:Boolean;// = false
public var maxOutboundLinkExamined:Number;// = 1000
private var _debug:DebugConfiguration;
public var allowAnchor:Boolean;// = false
private var _domain:Domain;
private var _trackingLimitPerSession:int;// = 500
public var tokenCliff:int;// = 10
public var sessionTimeout:Number;
public var idleTimeout:Number;// = 60
public var campaignTracking:Boolean;// = true
public var domainName:String;// = ""
public var detectTitle:Boolean;// = true
public var tokenRate:Number;// = 0.2
public var conversionTimeout:Number;
public var localGIFpath:String;// = "/__utm.gif"
public function Configuration(_arg1:DebugConfiguration=null){
_organic = new Organic();
conversionTimeout = Timespan.sixmonths;
sessionTimeout = Timespan.thirtyminutes;
campaignKey = new CampaignKey();
serverMode = ServerOperationMode.remote;
super();
_debug = _arg1;
_domain = new Domain(DomainNameMode.auto, "", _debug);
serverMode = ServerOperationMode.remote;
_initOrganicSources();
}
public function get organic():Organic{
return (_organic);
}
public function get cookieName():String{
return (_cookieName);
}
public function get trackingLimitPerSession():int{
return (_trackingLimitPerSession);
}
private function _initOrganicSources():void{
addOrganicSource(google, googleSearchParam);
addOrganicSource("yahoo", "p");
addOrganicSource("msn", "q");
addOrganicSource("aol", "query");
addOrganicSource("aol", "encquery");
addOrganicSource("lycos", "query");
addOrganicSource("ask", "q");
addOrganicSource("altavista", "q");
addOrganicSource("netscape", "query");
addOrganicSource("cnn", "query");
addOrganicSource("looksmart", "qt");
addOrganicSource("about", "terms");
addOrganicSource("mamma", "query");
addOrganicSource("alltheweb", "q");
addOrganicSource("gigablast", "q");
addOrganicSource("voila", "rdata");
addOrganicSource("virgilio", "qs");
addOrganicSource("live", "q");
addOrganicSource("baidu", "wd");
addOrganicSource("alice", "qs");
addOrganicSource("yandex", "text");
addOrganicSource("najdi", "q");
addOrganicSource("aol", "q");
addOrganicSource("club-internet", "q");
addOrganicSource("mama", "query");
addOrganicSource("seznam", "q");
addOrganicSource("search", "q");
addOrganicSource("wp", "szukaj");
addOrganicSource("onet", "qt");
addOrganicSource("netsprint", "q");
addOrganicSource("google.interia", "q");
addOrganicSource("szukacz", "q");
addOrganicSource("yam", "k");
addOrganicSource("pchome", "q");
addOrganicSource("kvasir", "searchExpr");
addOrganicSource("sesam", "q");
addOrganicSource("ozu", "q");
addOrganicSource("terra", "query");
addOrganicSource("nostrum", "query");
addOrganicSource("mynet", "q");
addOrganicSource("ekolay", "q");
addOrganicSource("search.ilse", "search_for");
}
public function get sampleRate():Number{
return (_sampleRate);
}
public function addOrganicSource(_arg1:String, _arg2:String):void{
var engine = _arg1;
var keyword = _arg2;
try {
_organic.addSource(engine, keyword);
} catch(e:Error) {
if (((_debug) && (_debug.active))){
_debug.warning(e.message);
};
};
}
public function get domain():Domain{
return (_domain);
}
public function set sampleRate(_arg1:Number):void{
if (_arg1 <= 0){
_arg1 = 0.1;
};
if (_arg1 > 1){
_arg1 = 1;
};
_arg1 = Number(_arg1.toFixed(2));
_sampleRate = _arg1;
}
public function get version():String{
return (_version);
}
}
}//package com.google.analytics.v4
Section 134
//GoogleAnalyticsAPI (com.google.analytics.v4.GoogleAnalyticsAPI)
package com.google.analytics.v4 {
import com.google.analytics.core.*;
public interface GoogleAnalyticsAPI {
function setCampSourceKey(_arg1:String):void;
function setDetectTitle(_arg1:Boolean):void;
function setLocalRemoteServerMode():void;
function resetSession():void;
function setLocalServerMode():void;
function setCampContentKey(_arg1:String):void;
function addOrganic(_arg1:String, _arg2:String):void;
function setDetectFlash(_arg1:Boolean):void;
function setAllowLinker(_arg1:Boolean):void;
function trackEvent(_arg1:String, _arg2:String, _arg3:String=null, _arg4:Number=NaN):Boolean;
function setCampTermKey(_arg1:String):void;
function setCampNameKey(_arg1:String):void;
function getLinkerUrl(_arg1:String="", _arg2:Boolean=false):String;
function addItem(_arg1:String, _arg2:String, _arg3:String, _arg4:String, _arg5:Number, _arg6:int):void;
function clearIgnoredRef():void;
function addTrans(_arg1:String, _arg2:String, _arg3:Number, _arg4:Number, _arg5:Number, _arg6:String, _arg7:String, _arg8:String):void;
function getDetectFlash():Boolean;
function setCampaignTrack(_arg1:Boolean):void;
function createEventTracker(_arg1:String):EventTracker;
function setCookieTimeout(_arg1:int):void;
function setAllowAnchor(_arg1:Boolean):void;
function trackTrans():void;
function clearOrganic():void;
function trackPageview(_arg1:String=""):void;
function setLocalGifPath(_arg1:String):void;
function getVersion():String;
function getLocalGifPath():String;
function getServiceMode():ServerOperationMode;
function setVar(_arg1:String):void;
function clearIgnoredOrganic():void;
function setCampMediumKey(_arg1:String):void;
function addIgnoredRef(_arg1:String):void;
function setClientInfo(_arg1:Boolean):void;
function setCookiePath(_arg1:String):void;
function setSampleRate(_arg1:Number):void;
function setSessionTimeout(_arg1:int):void;
function setRemoteServerMode():void;
function setDomainName(_arg1:String):void;
function addIgnoredOrganic(_arg1:String):void;
function setAllowHash(_arg1:Boolean):void;
function getAccount():String;
function linkByPost(_arg1:Object, _arg2:Boolean=false):void;
function link(_arg1:String, _arg2:Boolean=false):void;
function setCampNOKey(_arg1:String):void;
function getClientInfo():Boolean;
function cookiePathCopy(_arg1:String):void;
function getDetectTitle():Boolean;
}
}//package com.google.analytics.v4
Section 135
//Tracker (com.google.analytics.v4.Tracker)
package com.google.analytics.v4 {
import com.google.analytics.core.*;
import com.google.analytics.debug.*;
import flash.net.*;
import com.google.analytics.data.*;
import com.google.analytics.external.*;
import com.google.analytics.utils.*;
import com.google.analytics.ecommerce.*;
import com.google.analytics.campaign.*;
public class Tracker implements GoogleAnalyticsAPI {
private const EVENT_TRACKER_LABEL_KEY_NUM:int = 3;
private const EVENT_TRACKER_VALUE_VALUE_NUM:int = 1;
private const EVENT_TRACKER_PROJECT_ID:int = 5;
private const EVENT_TRACKER_OBJECT_NAME_KEY_NUM:int = 1;
private const EVENT_TRACKER_TYPE_KEY_NUM:int = 2;
private var _adSense:AdSenseGlobals;
private var _eventTracker:X10;
private var _noSessionInformation:Boolean;// = false
private var _browserInfo:BrowserInfo;
private var _debug:DebugConfiguration;
private var _isNewVisitor:Boolean;// = false
private var _buffer:Buffer;
private var _config:Configuration;
private var _x10Module:X10;
private var _campaign:CampaignManager;
private var _formatedReferrer:String;
private var _timeStamp:Number;
private var _info:Environment;
private var _domainHash:Number;
private var _campaignInfo:CampaignInfo;
private var _gifRequest:GIFRequest;
private var _hasInitData:Boolean;// = false
private var _ecom:Ecommerce;
private var _account:String;
public function Tracker(_arg1:String, _arg2:Configuration, _arg3:DebugConfiguration, _arg4:Environment, _arg5:Buffer, _arg6:GIFRequest, _arg7:AdSenseGlobals, _arg8:Ecommerce){
var _local9:String;
super();
_account = _arg1;
_config = _arg2;
_debug = _arg3;
_info = _arg4;
_buffer = _arg5;
_gifRequest = _arg6;
_adSense = _arg7;
_ecom = _arg8;
if (!Utils.validateAccount(_arg1)){
_local9 = (("Account \"" + _arg1) + "\" is not valid.");
_debug.warning(_local9);
throw (new Error(_local9));
};
}
private function _doTracking():Boolean{
if (((((!((_info.protocol == Protocols.file))) && (!((_info.protocol == Protocols.none))))) && (_isNotGoogleSearch()))){
return (true);
};
if (_config.allowLocalTracking){
return (true);
};
return (false);
}
public function addOrganic(_arg1:String, _arg2:String):void{
_debug.info((("addOrganic( " + [_arg1, _arg2].join(", ")) + " )"));
_config.organic.addSource(_arg1, _arg2);
}
public function setAllowLinker(_arg1:Boolean):void{
_config.allowLinker = _arg1;
_debug.info((("setAllowLinker( " + _config.allowLinker) + " )"));
}
public function getLinkerUrl(_arg1:String="", _arg2:Boolean=false):String{
_initData();
_debug.info((((("getLinkerUrl( " + _arg1) + ", ") + _arg2.toString()) + " )"));
return (_buffer.getLinkerUrl(_arg1, _arg2));
}
public function trackEvent(_arg1:String, _arg2:String, _arg3:String=null, _arg4:Number=NaN):Boolean{
_initData();
var _local5:Boolean;
var _local6 = 2;
if (((!((_arg1 == ""))) && (!((_arg2 == ""))))){
_eventTracker.clearKey(EVENT_TRACKER_PROJECT_ID);
_eventTracker.clearValue(EVENT_TRACKER_PROJECT_ID);
_local5 = _eventTracker.setKey(EVENT_TRACKER_PROJECT_ID, EVENT_TRACKER_OBJECT_NAME_KEY_NUM, _arg1);
_local5 = _eventTracker.setKey(EVENT_TRACKER_PROJECT_ID, EVENT_TRACKER_TYPE_KEY_NUM, _arg2);
if (_arg3){
_local5 = _eventTracker.setKey(EVENT_TRACKER_PROJECT_ID, EVENT_TRACKER_LABEL_KEY_NUM, _arg3);
_local6 = 3;
};
if (!isNaN(_arg4)){
_local5 = _eventTracker.setValue(EVENT_TRACKER_PROJECT_ID, EVENT_TRACKER_VALUE_VALUE_NUM, _arg4);
_local6 = 4;
};
if (_local5){
_debug.info(((("valid event tracking call\ncategory: " + _arg1) + "\naction: ") + _arg2), VisualDebugMode.geek);
_sendXEvent(_eventTracker);
};
} else {
_debug.warning(((("event tracking call is not valid, failed!\ncategory: " + _arg1) + "\naction: ") + _arg2), VisualDebugMode.geek);
_local5 = false;
};
switch (_local6){
case 4:
_debug.info((("trackEvent( " + [_arg1, _arg2, _arg3, _arg4].join(", ")) + " )"));
break;
case 3:
_debug.info((("trackEvent( " + [_arg1, _arg2, _arg3].join(", ")) + " )"));
break;
case 2:
default:
_debug.info((("trackEvent( " + [_arg1, _arg2].join(", ")) + " )"));
};
return (_local5);
}
public function trackPageview(_arg1:String=""):void{
_debug.info((("trackPageview( " + _arg1) + " )"));
if (_doTracking()){
_initData();
_trackMetrics(_arg1);
_noSessionInformation = false;
} else {
_debug.warning((("trackPageview( " + _arg1) + " ) failed"));
};
}
public function setCookieTimeout(_arg1:int):void{
_config.conversionTimeout = _arg1;
_debug.info((("setCookieTimeout( " + _config.conversionTimeout) + " )"));
}
public function trackTrans():void{
var _local1:Number;
var _local2:Number;
var _local4:Transaction;
_initData();
var _local3:Array = new Array();
if (_takeSample()){
_local1 = 0;
while (_local1 < _ecom.getTransLength()) {
_local4 = _ecom.getTransFromArray(_local1);
_local3.push(_local4.toGifParams());
_local2 = 0;
while (_local2 < _local4.getItemsLength()) {
_local3.push(_local4.getItemFromArray(_local2).toGifParams());
_local2++;
};
_local1++;
};
_local1 = 0;
while (_local1 < _local3.length) {
_gifRequest.send(_account, _local3[_local1]);
_local1++;
};
};
}
public function setClientInfo(_arg1:Boolean):void{
_config.detectClientInfo = _arg1;
_debug.info((("setClientInfo( " + _config.detectClientInfo) + " )"));
}
public function linkByPost(_arg1:Object, _arg2:Boolean=false):void{
_debug.warning("linkByPost not implemented in AS3 mode");
}
private function _initData():void{
var _local1:String;
var _local2:String;
if (!_hasInitData){
_updateDomainName();
_domainHash = _getDomainHash();
_timeStamp = Math.round((new Date().getTime() / 1000));
if (_debug.verbose){
_local1 = "";
_local1 = (_local1 + "_initData 0");
_local1 = (_local1 + ("\ndomain name: " + _config.domainName));
_local1 = (_local1 + ("\ndomain hash: " + _domainHash));
_local1 = (_local1 + (((("\ntimestamp: " + _timeStamp) + " (") + new Date((_timeStamp * 1000))) + ")"));
_debug.info(_local1, VisualDebugMode.geek);
};
};
if (_doTracking()){
_handleCookie();
};
if (!_hasInitData){
if (_doTracking()){
_formatedReferrer = _formatReferrer();
_browserInfo = new BrowserInfo(_config, _info);
_debug.info(("browserInfo: " + _browserInfo.toURLString()), VisualDebugMode.advanced);
if (_config.campaignTracking){
_campaign = new CampaignManager(_config, _debug, _buffer, _domainHash, _formatedReferrer, _timeStamp);
_campaignInfo = _campaign.getCampaignInformation(_info.locationSearch, _noSessionInformation);
_debug.info(("campaignInfo: " + _campaignInfo.toURLString()), VisualDebugMode.advanced);
_debug.info(("Search: " + _info.locationSearch));
_debug.info(("CampaignTrackig: " + _buffer.utmz.campaignTracking));
};
};
_x10Module = new X10();
_eventTracker = new X10();
_hasInitData = true;
};
if (_config.hasSiteOverlay){
_debug.warning("Site Overlay is not supported");
};
if (_debug.verbose){
_local2 = "";
_local2 = (_local2 + "_initData (misc)");
_local2 = (_local2 + ("\nflash version: " + _info.flashVersion.toString(4)));
_local2 = (_local2 + ("\nprotocol: " + _info.protocol));
_local2 = (_local2 + (("\ndefault domain name (auto): \"" + _info.domainName) + "\""));
_local2 = (_local2 + ("\nlanguage: " + _info.language));
_local2 = (_local2 + ("\ndomain hash: " + _getDomainHash()));
_local2 = (_local2 + ("\nuser-agent: " + _info.userAgent));
_debug.info(_local2, VisualDebugMode.geek);
};
}
public function getDetectTitle():Boolean{
_debug.info("getDetectTitle()");
return (_config.detectTitle);
}
public function resetSession():void{
_debug.info("resetSession()");
_buffer.resetCurrentSession();
}
public function getClientInfo():Boolean{
_debug.info("getClientInfo()");
return (_config.detectClientInfo);
}
private function _sendXEvent(_arg1:X10=null):void{
var _local2:Variables;
var _local3:EventInfo;
var _local4:Variables;
var _local5:Variables;
if (_takeSample()){
_local2 = new Variables();
_local2.URIencode = true;
_local3 = new EventInfo(true, _x10Module, _arg1);
_local4 = _local3.toVariables();
_local5 = _renderMetricsSearchVariables();
_local2.join(_local4, _local5);
_gifRequest.send(_account, _local2, false, true);
};
}
public function setDetectFlash(_arg1:Boolean):void{
_config.detectFlash = _arg1;
_debug.info((("setDetectFlash( " + _config.detectFlash) + " )"));
}
public function setCampNameKey(_arg1:String):void{
_config.campaignKey.UCCN = _arg1;
var _local2 = (("setCampNameKey( " + _config.campaignKey.UCCN) + " )");
if (_debug.mode == VisualDebugMode.geek){
_debug.info((_local2 + " [UCCN]"));
} else {
_debug.info(_local2);
};
}
private function _formatReferrer():String{
var _local2:String;
var _local3:URL;
var _local4:URL;
var _local1:String = _info.referrer;
if ((((_local1 == "")) || ((_local1 == "localhost")))){
_local1 = "-";
} else {
_local2 = _info.domainName;
_local3 = new URL(_local1);
_local4 = new URL(("http://" + _local2));
if (_local3.hostName == _local2){
return ("-");
};
if (_local4.domain == _local3.domain){
if (_local4.subDomain != _local3.subDomain){
_local1 = "0";
};
};
if ((((_local1.charAt(0) == "[")) && (_local1.charAt((_local1.length - 1))))){
_local1 = "-";
};
};
_debug.info(("formated referrer: " + _local1), VisualDebugMode.advanced);
return (_local1);
}
private function _visitCode():Number{
if (_debug.verbose){
_debug.info(("visitCode: " + _buffer.utma.sessionId), VisualDebugMode.geek);
};
return (_buffer.utma.sessionId);
}
public function createEventTracker(_arg1:String):EventTracker{
_debug.info((("createEventTracker( " + _arg1) + " )"));
return (new EventTracker(_arg1, this));
}
public function addItem(_arg1:String, _arg2:String, _arg3:String, _arg4:String, _arg5:Number, _arg6:int):void{
var _local7:Transaction;
_local7 = _ecom.getTransaction(_arg1);
if (_local7 == null){
_local7 = _ecom.addTransaction(_arg1, "", "", "", "", "", "", "");
};
_local7.addItem(_arg2, _arg3, _arg4, _arg5.toString(), _arg6.toString());
if (_debug.active){
_debug.info((("addItem( " + [_arg1, _arg2, _arg3, _arg4, _arg5, _arg6].join(", ")) + " )"));
};
}
public function clearIgnoredOrganic():void{
_debug.info("clearIgnoredOrganic()");
_config.organic.clearIgnoredKeywords();
}
public function setVar(_arg1:String):void{
var _local2:Variables;
if (((!((_arg1 == ""))) && (_isNotGoogleSearch()))){
_initData();
_buffer.utmv.domainHash = _domainHash;
_buffer.utmv.value = encodeURI(_arg1);
if (_debug.verbose){
_debug.info(_buffer.utmv.toString(), VisualDebugMode.geek);
};
_debug.info((("setVar( " + _arg1) + " )"));
if (_takeSample()){
_local2 = new Variables();
_local2.utmt = "var";
_gifRequest.send(_account, _local2);
};
} else {
_debug.warning((("setVar \"" + _arg1) + "\" is ignored"));
};
}
public function setDomainName(_arg1:String):void{
if (_arg1 == "auto"){
_config.domain.mode = DomainNameMode.auto;
} else {
if (_arg1 == "none"){
_config.domain.mode = DomainNameMode.none;
} else {
_config.domain.mode = DomainNameMode.custom;
_config.domain.name = _arg1;
};
};
_updateDomainName();
_debug.info((("setDomainName( " + _config.domainName) + " )"));
}
private function _updateDomainName():void{
var _local1:String;
if (_config.domain.mode == DomainNameMode.auto){
_local1 = _info.domainName;
if (_local1.substring(0, 4) == "www."){
_local1 = _local1.substring(4);
};
_config.domain.name = _local1;
};
_config.domainName = _config.domain.name.toLowerCase();
_debug.info(("domain name: " + _config.domainName), VisualDebugMode.advanced);
}
public function addTrans(_arg1:String, _arg2:String, _arg3:Number, _arg4:Number, _arg5:Number, _arg6:String, _arg7:String, _arg8:String):void{
_ecom.addTransaction(_arg1, _arg2, _arg3.toString(), _arg4.toString(), _arg5.toString(), _arg6, _arg7, _arg8);
if (_debug.active){
_debug.info((("addTrans( " + [_arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8].join(", ")) + " );"));
};
}
private function _renderMetricsSearchVariables(_arg1:String=""):Variables{
var _local4:Variables;
var _local2:Variables = new Variables();
_local2.URIencode = true;
var _local3:DocumentInfo = new DocumentInfo(_config, _info, _formatedReferrer, _arg1, _adSense);
_debug.info(("docInfo: " + _local3.toURLString()), VisualDebugMode.geek);
if (_config.campaignTracking){
_local4 = _campaignInfo.toVariables();
};
var _local5:Variables = _browserInfo.toVariables();
_local2.join(_local3.toVariables(), _local5, _local4);
return (_local2);
}
public function setCampContentKey(_arg1:String):void{
_config.campaignKey.UCCT = _arg1;
var _local2 = (("setCampContentKey( " + _config.campaignKey.UCCT) + " )");
if (_debug.mode == VisualDebugMode.geek){
_debug.info((_local2 + " [UCCT]"));
} else {
_debug.info(_local2);
};
}
private function _handleCookie():void{
var _local1:String;
var _local2:String;
var _local3:Array;
var _local4:String;
if (_config.allowLinker){
};
_buffer.createSO();
if (((_buffer.hasUTMA()) && (!(_buffer.utma.isEmpty())))){
if (((!(_buffer.hasUTMB())) || (!(_buffer.hasUTMC())))){
_buffer.updateUTMA(_timeStamp);
_noSessionInformation = true;
};
if (_debug.verbose){
_debug.info(("from cookie " + _buffer.utma.toString()), VisualDebugMode.geek);
};
} else {
_debug.info("create a new utma", VisualDebugMode.advanced);
_buffer.utma.domainHash = _domainHash;
_buffer.utma.sessionId = _getUniqueSessionId();
_buffer.utma.firstTime = _timeStamp;
_buffer.utma.lastTime = _timeStamp;
_buffer.utma.currentTime = _timeStamp;
_buffer.utma.sessionCount = 1;
if (_debug.verbose){
_debug.info(_buffer.utma.toString(), VisualDebugMode.geek);
};
_noSessionInformation = true;
_isNewVisitor = true;
};
if (((_adSense.gaGlobal) && ((_adSense.dh == String(_domainHash))))){
if (_adSense.sid){
_buffer.utma.currentTime = Number(_adSense.sid);
if (_debug.verbose){
_local1 = "";
_local1 = (_local1 + "AdSense sid found\n");
_local1 = (_local1 + (((("Override currentTime(" + _buffer.utma.currentTime) + ") from AdSense sid(") + Number(_adSense.sid)) + ")"));
_debug.info(_local1, VisualDebugMode.geek);
};
};
if (_isNewVisitor){
if (_adSense.sid){
_buffer.utma.lastTime = Number(_adSense.sid);
if (_debug.verbose){
_local2 = "";
_local2 = (_local2 + "AdSense sid found (new visitor)\n");
_local2 = (_local2 + (((("Override lastTime(" + _buffer.utma.lastTime) + ") from AdSense sid(") + Number(_adSense.sid)) + ")"));
_debug.info(_local2, VisualDebugMode.geek);
};
};
if (_adSense.vid){
_local3 = _adSense.vid.split(".");
_buffer.utma.sessionId = Number(_local3[0]);
_buffer.utma.firstTime = Number(_local3[1]);
if (_debug.verbose){
_local4 = "";
_local4 = (_local4 + "AdSense vid found (new visitor)\n");
_local4 = (_local4 + (((("Override sessionId(" + _buffer.utma.sessionId) + ") from AdSense vid(") + Number(_local3[0])) + ")\n"));
_local4 = (_local4 + (((("Override firstTime(" + _buffer.utma.firstTime) + ") from AdSense vid(") + Number(_local3[1])) + ")"));
_debug.info(_local4, VisualDebugMode.geek);
};
};
if (_debug.verbose){
_debug.info(("AdSense modified : " + _buffer.utma.toString()), VisualDebugMode.geek);
};
};
};
_buffer.utmb.domainHash = _domainHash;
if (isNaN(_buffer.utmb.trackCount)){
_buffer.utmb.trackCount = 0;
};
if (isNaN(_buffer.utmb.token)){
_buffer.utmb.token = _config.tokenCliff;
};
if (isNaN(_buffer.utmb.lastTime)){
_buffer.utmb.lastTime = _buffer.utma.currentTime;
};
_buffer.utmc.domainHash = _domainHash;
if (_debug.verbose){
_debug.info(_buffer.utmb.toString(), VisualDebugMode.advanced);
_debug.info(_buffer.utmc.toString(), VisualDebugMode.advanced);
};
}
public function setLocalServerMode():void{
_config.serverMode = ServerOperationMode.local;
_debug.info("setLocalServerMode()");
}
public function clearIgnoredRef():void{
_debug.info("clearIgnoredRef()");
_config.organic.clearIgnoredReferrals();
}
public function setCampSourceKey(_arg1:String):void{
_config.campaignKey.UCSR = _arg1;
var _local2 = (("setCampSourceKey( " + _config.campaignKey.UCSR) + " )");
if (_debug.mode == VisualDebugMode.geek){
_debug.info((_local2 + " [UCSR]"));
} else {
_debug.info(_local2);
};
}
public function getLocalGifPath():String{
_debug.info("getLocalGifPath()");
return (_config.localGIFpath);
}
public function setLocalGifPath(_arg1:String):void{
_config.localGIFpath = _arg1;
_debug.info((("setLocalGifPath( " + _config.localGIFpath) + " )"));
}
public function getVersion():String{
_debug.info("getVersion()");
return (_config.version);
}
public function setAllowAnchor(_arg1:Boolean):void{
_config.allowAnchor = _arg1;
_debug.info((("setAllowAnchor( " + _config.allowAnchor) + " )"));
}
private function _isNotGoogleSearch():Boolean{
var _local1:String = _config.domainName;
var _local2 = (_local1.indexOf("www.google.") < 0);
var _local3 = (_local1.indexOf(".google.") < 0);
var _local4 = (_local1.indexOf("google.") < 0);
var _local5 = (_local1.indexOf("google.org") > -1);
return (((((((((_local2) || (_local3))) || (_local4))) || (!((_config.cookiePath == "/"))))) || (_local5)));
}
public function setSampleRate(_arg1:Number):void{
if (_arg1 < 0){
_debug.warning("sample rate can not be negative, ignoring value.");
} else {
_config.sampleRate = _arg1;
};
_debug.info((("setSampleRate( " + _config.sampleRate) + " )"));
}
private function _takeSample():Boolean{
if (_debug.verbose){
_debug.info((((("takeSample: (" + (_visitCode() % 10000)) + ") < (") + (_config.sampleRate * 10000)) + ")"), VisualDebugMode.geek);
};
return (((_visitCode() % 10000) < (_config.sampleRate * 10000)));
}
public function setCookiePath(_arg1:String):void{
_config.cookiePath = _arg1;
_debug.info((("setCookiePath( " + _config.cookiePath) + " )"));
}
public function setAllowHash(_arg1:Boolean):void{
_config.allowDomainHash = _arg1;
_debug.info((("setAllowHash( " + _config.allowDomainHash) + " )"));
}
private function _generateUserDataHash():Number{
var _local1 = "";
_local1 = (_local1 + _info.appName);
_local1 = (_local1 + _info.appVersion);
_local1 = (_local1 + _info.language);
_local1 = (_local1 + _info.platform);
_local1 = (_local1 + _info.userAgent.toString());
_local1 = (_local1 + (((_info.screenWidth + "x") + _info.screenHeight) + _info.screenColorDepth));
_local1 = (_local1 + _info.referrer);
return (Utils.generateHash(_local1));
}
public function setCampNOKey(_arg1:String):void{
_config.campaignKey.UCNO = _arg1;
var _local2 = (("setCampNOKey( " + _config.campaignKey.UCNO) + " )");
if (_debug.mode == VisualDebugMode.geek){
_debug.info((_local2 + " [UCNO]"));
} else {
_debug.info(_local2);
};
}
public function addIgnoredOrganic(_arg1:String):void{
_debug.info((("addIgnoredOrganic( " + _arg1) + " )"));
_config.organic.addIgnoredKeyword(_arg1);
}
public function setLocalRemoteServerMode():void{
_config.serverMode = ServerOperationMode.both;
_debug.info("setLocalRemoteServerMode()");
}
public function cookiePathCopy(_arg1:String):void{
_debug.warning((("cookiePathCopy( " + _arg1) + " ) not implemented"));
}
public function setDetectTitle(_arg1:Boolean):void{
_config.detectTitle = _arg1;
_debug.info((("setDetectTitle( " + _config.detectTitle) + " )"));
}
public function setCampTermKey(_arg1:String):void{
_config.campaignKey.UCTR = _arg1;
var _local2 = (("setCampTermKey( " + _config.campaignKey.UCTR) + " )");
if (_debug.mode == VisualDebugMode.geek){
_debug.info((_local2 + " [UCTR]"));
} else {
_debug.info(_local2);
};
}
public function getServiceMode():ServerOperationMode{
_debug.info("getServiceMode()");
return (_config.serverMode);
}
private function _trackMetrics(_arg1:String=""):void{
var _local2:Variables;
var _local3:Variables;
var _local4:Variables;
var _local5:EventInfo;
if (_takeSample()){
_local2 = new Variables();
_local2.URIencode = true;
if (((_x10Module) && (_x10Module.hasData()))){
_local5 = new EventInfo(false, _x10Module);
_local3 = _local5.toVariables();
};
_local4 = _renderMetricsSearchVariables(_arg1);
_local2.join(_local3, _local4);
_gifRequest.send(_account, _local2);
};
}
public function setCampaignTrack(_arg1:Boolean):void{
_config.campaignTracking = _arg1;
_debug.info((("setCampaignTrack( " + _config.campaignTracking) + " )"));
}
public function addIgnoredRef(_arg1:String):void{
_debug.info((("addIgnoredRef( " + _arg1) + " )"));
_config.organic.addIgnoredReferral(_arg1);
}
public function clearOrganic():void{
_debug.info("clearOrganic()");
_config.organic.clearEngines();
}
public function getDetectFlash():Boolean{
_debug.info("getDetectFlash()");
return (_config.detectFlash);
}
public function setCampMediumKey(_arg1:String):void{
_config.campaignKey.UCMD = _arg1;
var _local2 = (("setCampMediumKey( " + _config.campaignKey.UCMD) + " )");
if (_debug.mode == VisualDebugMode.geek){
_debug.info((_local2 + " [UCMD]"));
} else {
_debug.info(_local2);
};
}
private function _getUniqueSessionId():Number{
var _local1:Number = ((Utils.generate32bitRandom() ^ _generateUserDataHash()) * 2147483647);
_debug.info(("Session ID: " + _local1), VisualDebugMode.geek);
return (_local1);
}
private function _getDomainHash():Number{
if (((((!(_config.domainName)) || ((_config.domainName == "")))) || ((_config.domain.mode == DomainNameMode.none)))){
_config.domainName = "";
return (1);
};
_updateDomainName();
if (_config.allowDomainHash){
return (Utils.generateHash(_config.domainName));
};
return (1);
}
public function setSessionTimeout(_arg1:int):void{
_config.sessionTimeout = _arg1;
_debug.info((("setSessionTimeout( " + _config.sessionTimeout) + " )"));
}
public function getAccount():String{
_debug.info("getAccount()");
return (_account);
}
public function link(_arg1:String, _arg2:Boolean=false):void{
var targetUrl = _arg1;
var useHash = _arg2;
_initData();
var out:String = _buffer.getLinkerUrl(targetUrl, useHash);
var request:URLRequest = new URLRequest(out);
_debug.info((("link( " + [targetUrl, useHash].join(",")) + " )"));
try {
navigateToURL(request, "_top");
} catch(e:Error) {
_debug.warning(("An error occured in link() msg: " + e.message));
};
}
public function setRemoteServerMode():void{
_config.serverMode = ServerOperationMode.remote;
_debug.info("setRemoteServerMode()");
}
}
}//package com.google.analytics.v4
Section 136
//AnalyticsTracker (com.google.analytics.AnalyticsTracker)
package com.google.analytics {
import flash.events.*;
import com.google.analytics.v4.*;
import com.google.analytics.debug.*;
public interface AnalyticsTracker extends GoogleAnalyticsAPI, IEventDispatcher {
function set account(_arg1:String):void;
function get config():Configuration;
function get mode():String;
function set config(_arg1:Configuration):void;
function set mode(_arg1:String):void;
function set debug(_arg1:DebugConfiguration):void;
function get visualDebug():Boolean;
function get account():String;
function set visualDebug(_arg1:Boolean):void;
function isReady():Boolean;
function get debug():DebugConfiguration;
}
}//package com.google.analytics
Section 137
//API (com.google.analytics.API)
package com.google.analytics {
import com.google.analytics.utils.*;
public class API {
public static var version:Version = new Version();
version.major = 1;
version.minor = 0;
version.build = 1;
version.revision = "$Rev: 319 $ ".split(" ")[1];
}
}//package com.google.analytics
Section 138
//GATracker (com.google.analytics.GATracker)
package com.google.analytics {
import flash.display.*;
import flash.events.*;
import com.google.analytics.core.*;
import com.google.analytics.v4.*;
import com.google.analytics.debug.*;
import com.google.analytics.external.*;
import com.google.analytics.utils.*;
import com.google.analytics.events.*;
public class GATracker implements AnalyticsTracker {
private var _adSense:AdSenseGlobals;
private var _env:Environment;
private var _visualDebug:Boolean;
private var _idleTimer:IdleTimer;
private var _debug:DebugConfiguration;
private var _buffer:Buffer;
private var _config:Configuration;
private var _mode:String;
private var _display:DisplayObject;
private var _jsproxy:JavascriptProxy;
private var _dom:HTMLDOM;
private var _eventDispatcher:EventDispatcher;
private var _ready:Boolean;// = false
private var _gifRequest:GIFRequest;
private var _ecom:Ecommerce;
private var _account:String;
private var _tracker:GoogleAnalyticsAPI;
public static var version:Version = API.version;
public static var autobuild:Boolean = true;
public function GATracker(_arg1:DisplayObject, _arg2:String, _arg3:String="AS3", _arg4:Boolean=false, _arg5:Configuration=null, _arg6:DebugConfiguration=null){
_display = _arg1;
_eventDispatcher = new EventDispatcher(this);
_tracker = new TrackerCache();
this.account = _arg2;
this.mode = _arg3;
this.visualDebug = _arg4;
if (!_arg6){
this.debug = new DebugConfiguration();
};
if (!_arg5){
this.config = new Configuration(_arg6);
};
if (autobuild){
_factory();
};
}
public function link(_arg1:String, _arg2:Boolean=false):void{
_tracker.link(_arg1, _arg2);
}
public function addOrganic(_arg1:String, _arg2:String):void{
_tracker.addOrganic(_arg1, _arg2);
}
public function setAllowLinker(_arg1:Boolean):void{
_tracker.setAllowLinker(_arg1);
}
public function trackEvent(_arg1:String, _arg2:String, _arg3:String=null, _arg4:Number=NaN):Boolean{
return (_tracker.trackEvent(_arg1, _arg2, _arg3, _arg4));
}
public function getLinkerUrl(_arg1:String="", _arg2:Boolean=false):String{
return (_tracker.getLinkerUrl(_arg1, _arg2));
}
public function setCookieTimeout(_arg1:int):void{
_tracker.setCookieTimeout(_arg1);
}
public function trackTrans():void{
_tracker.trackTrans();
}
public function getClientInfo():Boolean{
return (_tracker.getClientInfo());
}
public function trackPageview(_arg1:String=""):void{
_tracker.trackPageview(_arg1);
}
public function setClientInfo(_arg1:Boolean):void{
_tracker.setClientInfo(_arg1);
}
public function get account():String{
return (_account);
}
public function linkByPost(_arg1:Object, _arg2:Boolean=false):void{
_tracker.linkByPost(_arg1, _arg2);
}
public function getDetectTitle():Boolean{
return (_tracker.getDetectTitle());
}
public function dispatchEvent(_arg1:Event):Boolean{
return (_eventDispatcher.dispatchEvent(_arg1));
}
public function get config():Configuration{
return (_config);
}
public function set mode(_arg1:String):void{
_mode = _arg1;
}
public function removeEventListener(_arg1:String, _arg2:Function, _arg3:Boolean=false):void{
_eventDispatcher.removeEventListener(_arg1, _arg2, _arg3);
}
public function setDetectFlash(_arg1:Boolean):void{
_tracker.setDetectFlash(_arg1);
}
public function resetSession():void{
_tracker.resetSession();
}
public function setCampNameKey(_arg1:String):void{
_tracker.setCampNameKey(_arg1);
}
public function get debug():DebugConfiguration{
return (_debug);
}
public function addItem(_arg1:String, _arg2:String, _arg3:String, _arg4:String, _arg5:Number, _arg6:int):void{
_tracker.addItem(_arg1, _arg2, _arg3, _arg4, _arg5, _arg6);
}
private function _bridgeFactory():GoogleAnalyticsAPI{
debug.info(((("GATracker (Bridge) v" + version) + "\naccount: ") + account));
return (new Bridge(account, _debug, _jsproxy));
}
public function clearIgnoredOrganic():void{
_tracker.clearIgnoredOrganic();
}
public function set account(_arg1:String):void{
_account = _arg1;
}
public function setVar(_arg1:String):void{
_tracker.setVar(_arg1);
}
public function build():void{
if (!isReady()){
_factory();
};
}
public function addEventListener(_arg1:String, _arg2:Function, _arg3:Boolean=false, _arg4:int=0, _arg5:Boolean=false):void{
_eventDispatcher.addEventListener(_arg1, _arg2, _arg3, _arg4, _arg5);
}
public function setDomainName(_arg1:String):void{
_tracker.setDomainName(_arg1);
}
public function createEventTracker(_arg1:String):EventTracker{
return (_tracker.createEventTracker(_arg1));
}
public function setCampSourceKey(_arg1:String):void{
_tracker.setCampSourceKey(_arg1);
}
public function set config(_arg1:Configuration):void{
_config = _arg1;
}
public function addTrans(_arg1:String, _arg2:String, _arg3:Number, _arg4:Number, _arg5:Number, _arg6:String, _arg7:String, _arg8:String):void{
_tracker.addTrans(_arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8);
}
public function setCampContentKey(_arg1:String):void{
_tracker.setCampContentKey(_arg1);
}
public function willTrigger(_arg1:String):Boolean{
return (_eventDispatcher.willTrigger(_arg1));
}
public function setLocalServerMode():void{
_tracker.setLocalServerMode();
}
public function isReady():Boolean{
return (_ready);
}
public function getLocalGifPath():String{
return (_tracker.getLocalGifPath());
}
public function setAllowAnchor(_arg1:Boolean):void{
_tracker.setAllowAnchor(_arg1);
}
public function clearIgnoredRef():void{
_tracker.clearIgnoredRef();
}
public function get mode():String{
return (_mode);
}
public function set debug(_arg1:DebugConfiguration):void{
_debug = _arg1;
}
public function setLocalGifPath(_arg1:String):void{
_tracker.setLocalGifPath(_arg1);
}
public function getVersion():String{
return (_tracker.getVersion());
}
public function setSampleRate(_arg1:Number):void{
_tracker.setSampleRate(_arg1);
}
public function setCookiePath(_arg1:String):void{
_tracker.setCookiePath(_arg1);
}
public function setAllowHash(_arg1:Boolean):void{
_tracker.setAllowHash(_arg1);
}
public function addIgnoredOrganic(_arg1:String):void{
_tracker.addIgnoredOrganic(_arg1);
}
public function setLocalRemoteServerMode():void{
_tracker.setLocalRemoteServerMode();
}
public function cookiePathCopy(_arg1:String):void{
_tracker.cookiePathCopy(_arg1);
}
private function _factory():void{
var _local1:GoogleAnalyticsAPI;
_jsproxy = new JavascriptProxy(debug);
if (visualDebug){
debug.layout = new Layout(debug, _display);
debug.active = visualDebug;
};
var _local2:TrackerCache = (_tracker as TrackerCache);
switch (mode){
case TrackerMode.BRIDGE:
_local1 = _bridgeFactory();
break;
case TrackerMode.AS3:
default:
_local1 = _trackerFactory();
};
if (!_local2.isEmpty()){
_local2.tracker = _local1;
_local2.flush();
};
_tracker = _local1;
_ready = true;
dispatchEvent(new AnalyticsEvent(AnalyticsEvent.READY, this));
}
public function setCampTermKey(_arg1:String):void{
_tracker.setCampTermKey(_arg1);
}
private function _trackerFactory():GoogleAnalyticsAPI{
debug.info(((("GATracker (AS3) v" + version) + "\naccount: ") + account));
_adSense = new AdSenseGlobals(debug);
_dom = new HTMLDOM(debug);
_dom.cacheProperties();
_env = new Environment("", "", "", debug, _dom);
_buffer = new Buffer(config, debug, false);
_gifRequest = new GIFRequest(config, debug, _buffer, _env);
_idleTimer = new IdleTimer(config, debug, _display, _buffer);
_ecom = new Ecommerce(_debug);
_env.url = _display.stage.loaderInfo.url;
return (new Tracker(account, config, debug, _env, _buffer, _gifRequest, _adSense, _ecom));
}
public function setCampNOKey(_arg1:String):void{
_tracker.setCampNOKey(_arg1);
}
public function setDetectTitle(_arg1:Boolean):void{
_tracker.setDetectTitle(_arg1);
}
public function clearOrganic():void{
_tracker.clearOrganic();
}
public function setCampaignTrack(_arg1:Boolean):void{
_tracker.setCampaignTrack(_arg1);
}
public function addIgnoredRef(_arg1:String):void{
_tracker.addIgnoredRef(_arg1);
}
public function getServiceMode():ServerOperationMode{
return (_tracker.getServiceMode());
}
public function set visualDebug(_arg1:Boolean):void{
_visualDebug = _arg1;
}
public function setCampMediumKey(_arg1:String):void{
_tracker.setCampMediumKey(_arg1);
}
public function getDetectFlash():Boolean{
return (_tracker.getDetectFlash());
}
public function get visualDebug():Boolean{
return (_visualDebug);
}
public function hasEventListener(_arg1:String):Boolean{
return (_eventDispatcher.hasEventListener(_arg1));
}
public function getAccount():String{
return (_tracker.getAccount());
}
public function setSessionTimeout(_arg1:int):void{
_tracker.setSessionTimeout(_arg1);
}
public function setRemoteServerMode():void{
_tracker.setRemoteServerMode();
}
}
var _local1:* = ServerOperationMode;
return (_local1);
}//package com.google.analytics
Section 139
//KongregateEvent (com.kongregate.as3.client.events.KongregateEvent)
package com.kongregate.as3.client.events {
import flash.events.*;
public class KongregateEvent extends Event {
public static const COMPLETE:String = "component_api_available";
public function KongregateEvent(_arg1:String){
super(_arg1);
}
}
}//package com.kongregate.as3.client.events
Section 140
//AbstractShadowService (com.kongregate.as3.client.services.AbstractShadowService)
package com.kongregate.as3.client.services {
import flash.events.*;
public class AbstractShadowService extends EventDispatcher {
protected function alert(_arg1:String, _arg2:String, _arg3="", _arg4:String=""):void{
trace(((((((("Kongregate API: " + _arg1) + ".") + _arg2) + "(") + _arg3) + ") ") + _arg4));
}
}
}//package com.kongregate.as3.client.services
Section 141
//HighScoreServiceShadow (com.kongregate.as3.client.services.HighScoreServiceShadow)
package com.kongregate.as3.client.services {
public class HighScoreServiceShadow extends AbstractShadowService implements IHighScoreServices {
private var mode:String;
public function HighScoreServiceShadow(){
mode = "";
}
public function submit(_arg1:Number, _arg2:String=null):void{
alert("IHighScoreServices", "submit", arguments);
}
public function connect():Boolean{
alert("IKongregateServices", "connect");
return (true);
}
public function requestList(_arg1:Function):void{
alert("IHighScoreServices", "requestList", "", (("[Mode: " + mode) + "]"));
_arg1({success:false});
}
public function setMode(_arg1:String):void{
alert("IHighScoreServices", "setMode", arguments);
this.mode = _arg1;
}
}
}//package com.kongregate.as3.client.services
Section 142
//IHighScoreServices (com.kongregate.as3.client.services.IHighScoreServices)
package com.kongregate.as3.client.services {
public interface IHighScoreServices {
function setMode(_arg1:String):void;
function submit(_arg1:Number, _arg2:String=null):void;
function requestList(_arg1:Function):void;
}
}//package com.kongregate.as3.client.services
Section 143
//IKongregateServices (com.kongregate.as3.client.services.IKongregateServices)
package com.kongregate.as3.client.services {
import flash.events.*;
public interface IKongregateServices extends IEventDispatcher {
function getPlayerInfo(_arg1:Function):void;
function connect(_arg1:Number=-1):Boolean;
}
}//package com.kongregate.as3.client.services
Section 144
//IStatServices (com.kongregate.as3.client.services.IStatServices)
package com.kongregate.as3.client.services {
public interface IStatServices {
function submitArray(_arg1:Array):void;
function submit(_arg1:String, _arg2:Number):void;
}
}//package com.kongregate.as3.client.services
Section 145
//IUserServices (com.kongregate.as3.client.services.IUserServices)
package com.kongregate.as3.client.services {
public interface IUserServices {
function getName():String;
function getPlayerInfo(_arg1:Function):void;
}
}//package com.kongregate.as3.client.services
Section 146
//KongregateServiceShadow (com.kongregate.as3.client.services.KongregateServiceShadow)
package com.kongregate.as3.client.services {
public class KongregateServiceShadow extends AbstractShadowService implements IKongregateServices {
public function getName():String{
alert("IKongregateServices", "getName");
return ("Guest");
}
public function connect(_arg1:Number=-1):Boolean{
alert("IKongregateServices", "connect", arguments);
return (true);
}
public function getPlayerInfo(_arg1:Function):void{
alert("IKongregateServices", "getPlayerInfo");
_arg1(new Object());
}
}
}//package com.kongregate.as3.client.services
Section 147
//StatServiceShadow (com.kongregate.as3.client.services.StatServiceShadow)
package com.kongregate.as3.client.services {
public class StatServiceShadow extends AbstractShadowService implements IStatServices {
public function submitArray(_arg1:Array):void{
alert("IStatServices", "submitArray", arguments);
}
public function submit(_arg1:String, _arg2:Number):void{
alert("IStatServices", "submitStat", arguments);
}
}
}//package com.kongregate.as3.client.services
Section 148
//UserServiceShadow (com.kongregate.as3.client.services.UserServiceShadow)
package com.kongregate.as3.client.services {
public class UserServiceShadow extends AbstractShadowService implements IUserServices {
public function getName():String{
alert("UserService", "getName");
return ("Guest");
}
public function getPlayerInfo(_arg1:Function):void{
alert("UserService", "getPlayerInfo");
_arg1({isGuest:true, name:"Guest", points:0, level:0, isMode:false, isAdmin:false, isDeveloper:false, avatarPath:"", chatAvatarPath:""});
}
}
}//package com.kongregate.as3.client.services
Section 149
//IAPIBootstrap (com.kongregate.as3.client.IAPIBootstrap)
package com.kongregate.as3.client {
import flash.events.*;
import flash.display.*;
public interface IAPIBootstrap {
function init(_arg1:Event=null, _arg2:Stage=null):void;
function hideLog():void;
function showLog(_arg1:int=0):void;
}
}//package com.kongregate.as3.client
Section 150
//KongregateAPI (com.kongregate.as3.client.KongregateAPI)
package com.kongregate.as3.client {
import flash.events.*;
import com.kongregate.as3.client.services.*;
import flash.display.*;
import flash.system.*;
import flash.utils.*;
import com.kongregate.as3.client.events.*;
import flash.errors.*;
import flash.net.*;
public class KongregateAPI extends Sprite {
private const VERSION:Number = 1;
private var loader:Loader;
private var loadedDomain:ApplicationDomain;
private static const CLASS_USER:String = "com.kongregate.as3.client.services.UserServices";
private static const CLASS_STATS:String = "com.kongregate.as3.client.services.StatServices";
private static const CLASS_SERVICES:String = "com.kongregate.as3.client.services.KongregateServices";
private static const CLASS_SCORES:String = "com.kongregate.as3.client.services.HighScoreServices";
private static const DEBUG_API_URL:String = "//Linuxpc/kongregate/public/flash/API_AS3.swf";
private static var _connected:Boolean;
private static var kUser:IUserServices;
private static var _loaded:Boolean;
private static var kServices:IKongregateServices;
private static var kScores:IHighScoreServices;
private static var mInstance:KongregateAPI;
private static var kStats:IStatServices;
private static var kAPI:IAPIBootstrap;
public function KongregateAPI(){
if (mInstance != null){
throw (new Error("Warning: KongregateAPI has been added to stage more than once or accessed improperly. Use getInstance() or a stage reference to access."));
};
mInstance = this;
this.addEventListener(Event.ADDED_TO_STAGE, init, false, 0, true);
}
public function get loaded():Boolean{
return (_loaded);
}
public function get connected():Boolean{
return (_connected);
}
private function alertConnected(_arg1:TimerEvent=null):void{
var _local2:KongregateEvent;
var _local3:Boolean;
_local2 = new KongregateEvent(KongregateEvent.COMPLETE);
_local3 = this.dispatchEvent(_local2);
}
private function init(_arg1:Event):void{
var _local2:Object;
var _local3:String;
var _local4:URLRequest;
var _local5:LoaderContext;
this.removeEventListener(Event.ADDED_TO_STAGE, init);
_loaded = false;
_connected = false;
_local2 = LoaderInfo(root.loaderInfo).parameters;
_local3 = _local2.api_path;
if (_local3 == null){
trace("Alert: Kongregate API could not be loaded, due to local testing. API will load when the game is uploaded.");
createShadowServices();
return;
};
Security.allowDomain("*.kongregate.com");
Security.allowDomain("kongregatetrunk.com");
_local4 = new URLRequest(_local3);
_local5 = new LoaderContext(false);
_local5.applicationDomain = ApplicationDomain.currentDomain;
_local5.securityDomain = SecurityDomain.currentDomain;
loader = new Loader();
loader.contentLoaderInfo.addEventListener(Event.COMPLETE, loadComplete);
loader.addEventListener(IOErrorEvent.IO_ERROR, ioErrorHandler);
loader.load(_local4, _local5);
}
public function get api():IAPIBootstrap{
return (kAPI);
}
private function loadComplete(_arg1:Event):void{
getServices();
}
public function get scores():IHighScoreServices{
return (kScores);
}
private function ioErrorHandler(_arg1:IOErrorEvent):void{
throw (new IOError(("API file not found. " + _arg1)));
}
public function get services():IKongregateServices{
return (kServices);
}
public function get stats():IStatServices{
return (kStats);
}
private function createShadowServices():void{
var _local1:Timer;
trace(">>> Kongregate Shadow Services instantiated for local development..");
kServices = new KongregateServiceShadow();
kScores = new HighScoreServiceShadow();
kStats = new StatServiceShadow();
kUser = new UserServiceShadow();
_local1 = new Timer(200, 1);
_local1.addEventListener(TimerEvent.TIMER_COMPLETE, alertConnected);
_local1.start();
_connected = true;
}
public function get user():IUserServices{
return (kUser);
}
private function getServices():void{
var _local1:ApplicationDomain;
var _local2:*;
var _local3:*;
var _local4:*;
var _local5:*;
_local1 = ApplicationDomain.currentDomain;
kAPI = IAPIBootstrap(loader.getChildAt(0));
this.addChild(loader);
_local2 = _local1.getDefinition(CLASS_SERVICES);
trace(_local2);
kServices = _local2.getInstance();
_local3 = _local1.getDefinition(CLASS_SCORES);
kScores = _local3.getInstance();
_local4 = _local1.getDefinition(CLASS_STATS);
kStats = _local4.getInstance();
_local5 = _local1.getDefinition(CLASS_USER);
kUser = _local5.getInstance();
kServices.connect(VERSION);
_loaded = true;
_connected = true;
alertConnected();
}
public static function getInstance():KongregateAPI{
if (!mInstance){
throw (new IllegalOperationError("You must add the Kongregate API component to the stage before attempting to access it."));
};
return (mInstance);
}
}
}//package com.kongregate.as3.client
Section 151
//Level_01 (main.game.levels.Level_01)
package main.game.levels {
import main.game.*;
import flash.geom.*;
public class Level_01 {
public var start_point:Point;
public var finish_point:Point;
private var robot_init:Robot_init;
public var map_block_array:Array;
public var robot_array:Array;
public function Level_01(){
robot_array = new Array();
super();
map_block_array = new Array(new Point(2, 12), new Point(4, 12), new Point(2, 11), new Point(4, 11), new Point(0, 10), new Point(1, 10), new Point(2, 10), new Point(4, 10), new Point(5, 10), new Point(6, 10), new Point(0, 9), new Point(6, 9), new Point(0, 8), new Point(6, 8), new Point(0, 7), new Point(3, 7), new Point(6, 7), new Point(0, 6), new Point(6, 6), new Point(0, 5), new Point(6, 5), new Point(0, 4), new Point(6, 4), new Point(0, 3), new Point(1, 3), new Point(5, 3), new Point(6, 3), new Point(1, 2), new Point(2, 2), new Point(4, 2), new Point(5, 2), new Point(2, 1), new Point(4, 1), new Point(2, 0), new Point(4, 0));
start_point = new Point(3, 1);
finish_point = new Point(3, 11);
robot_init = new Robot_init();
robot_init.name = "Robot_0";
robot_init.tip = "robot_easy";
robot_init.go_array = new Array(new Point(4, 8), new Point(2, 8), new Point(2, 6), new Point(4, 6));
robot_array.push(robot_init);
}
}
}//package main.game.levels
Section 152
//Level_02 (main.game.levels.Level_02)
package main.game.levels {
import main.game.*;
import flash.geom.*;
public class Level_02 {
public var start_point:Point;
public var finish_point:Point;
private var robot_init:Robot_init;
public var map_block_array:Array;
public var robot_array:Array;
public function Level_02(){
robot_array = new Array();
super();
map_block_array = new Array(new Point(10, 8), new Point(12, 8), new Point(0, 7), new Point(1, 7), new Point(2, 7), new Point(3, 7), new Point(4, 7), new Point(5, 7), new Point(6, 7), new Point(7, 7), new Point(8, 7), new Point(9, 7), new Point(10, 7), new Point(12, 7), new Point(0, 6), new Point(10, 6), new Point(12, 6), new Point(0, 5), new Point(2, 5), new Point(8, 5), new Point(12, 5), new Point(0, 4), new Point(10, 4), new Point(11, 4), new Point(12, 4), new Point(0, 3), new Point(1, 3), new Point(2, 3), new Point(3, 3), new Point(4, 3), new Point(6, 3), new Point(7, 3), new Point(8, 3), new Point(9, 3), new Point(10, 3), new Point(4, 2), new Point(6, 2), new Point(4, 1), new Point(6, 1), new Point(4, 0), new Point(6, 0));
start_point = new Point(5, 1);
finish_point = new Point(11, 7);
robot_init = new Robot_init();
robot_init.name = "Robot_0";
robot_init.tip = "robot_easy";
robot_init.go_array = new Array(new Point(1, 6), new Point(3, 6), new Point(3, 4), new Point(1, 4));
robot_array.push(robot_init);
robot_init = new Robot_init();
robot_init.name = "Robot_1";
robot_init.tip = "robot_easy";
robot_init.go_array = new Array(new Point(7, 6), new Point(9, 6), new Point(9, 4), new Point(7, 4));
robot_array.push(robot_init);
}
}
}//package main.game.levels
Section 153
//Level_03 (main.game.levels.Level_03)
package main.game.levels {
import main.game.*;
import flash.geom.*;
public class Level_03 {
public var start_point:Point;
public var finish_point:Point;
private var robot_init:Robot_init;
public var map_block_array:Array;
public var robot_array:Array;
public function Level_03(){
robot_array = new Array();
super();
map_block_array = new Array(new Point(4, 12), new Point(6, 12), new Point(4, 11), new Point(6, 11), new Point(0, 10), new Point(1, 10), new Point(2, 10), new Point(3, 10), new Point(4, 10), new Point(6, 10), new Point(0, 9), new Point(6, 9), new Point(0, 8), new Point(2, 8), new Point(3, 8), new Point(4, 8), new Point(5, 8), new Point(6, 8), new Point(0, 7), new Point(2, 7), new Point(3, 7), new Point(4, 7), new Point(5, 7), new Point(0, 6), new Point(5, 6), new Point(0, 5), new Point(1, 5), new Point(2, 5), new Point(3, 5), new Point(5, 5), new Point(3, 4), new Point(5, 4), new Point(3, 3), new Point(5, 3), new Point(3, 2), new Point(5, 2), new Point(3, 1), new Point(5, 1), new Point(3, 0), new Point(5, 0));
start_point = new Point(4, 1);
finish_point = new Point(5, 11);
robot_init = new Robot_init();
robot_init.name = "Robot_0";
robot_init.tip = "robot_easy";
robot_init.go_array = new Array(new Point(4, 5), new Point(4, 5));
robot_array.push(robot_init);
robot_init = new Robot_init();
robot_init.name = "Robot_1";
robot_init.tip = "robot_easy";
robot_init.go_array = new Array(new Point(2, 6), new Point(2, 6));
robot_array.push(robot_init);
robot_init = new Robot_init();
robot_init.name = "Robot_2";
robot_init.tip = "robot_easy";
robot_init.go_array = new Array(new Point(1, 8), new Point(1, 8));
robot_array.push(robot_init);
robot_init = new Robot_init();
robot_init.name = "Robot_3";
robot_init.tip = "robot_easy";
robot_init.go_array = new Array(new Point(3, 9), new Point(3, 9));
robot_array.push(robot_init);
}
}
}//package main.game.levels
Section 154
//Level_04 (main.game.levels.Level_04)
package main.game.levels {
import main.game.*;
import flash.geom.*;
public class Level_04 {
public var start_point:Point;
public var finish_point:Point;
private var robot_init:Robot_init;
public var map_block_array:Array;
public var robot_array:Array;
public function Level_04(){
robot_array = new Array();
super();
map_block_array = new Array(new Point(10, 14), new Point(12, 14), new Point(10, 13), new Point(12, 13), new Point(10, 12), new Point(12, 12), new Point(0, 11), new Point(1, 11), new Point(2, 11), new Point(3, 11), new Point(4, 11), new Point(5, 11), new Point(6, 11), new Point(7, 11), new Point(8, 11), new Point(9, 11), new Point(10, 11), new Point(12, 11), new Point(13, 11), new Point(0, 10), new Point(8, 10), new Point(13, 10), new Point(0, 9), new Point(13, 9), new Point(0, 8), new Point(8, 8), new Point(13, 8), new Point(0, 7), new Point(8, 7), new Point(13, 7), new Point(0, 6), new Point(2, 6), new Point(3, 6), new Point(4, 6), new Point(5, 6), new Point(6, 6), new Point(7, 6), new Point(8, 6), new Point(9, 6), new Point(10, 6), new Point(11, 6), new Point(12, 6), new Point(13, 6), new Point(0, 5), new Point(5, 5), new Point(8, 5), new Point(0, 4), new Point(1, 4), new Point(8, 4), new Point(0, 3), new Point(5, 3), new Point(8, 3), new Point(0, 2), new Point(1, 2), new Point(2, 2), new Point(3, 2), new Point(5, 2), new Point(6, 2), new Point(7, 2), new Point(8, 2), new Point(3, 1), new Point(5, 1), new Point(3, 0), new Point(5, 0));
start_point = new Point(4, 1);
finish_point = new Point(11, 13);
robot_init = new Robot_init();
robot_init.name = "Robot_0";
robot_init.tip = "robot_normal";
robot_init.go_array = new Array(new Point(6, 4), new Point(6, 4));
robot_array.push(robot_init);
robot_init = new Robot_init();
robot_init.name = "Robot_1";
robot_init.tip = "robot_easy";
robot_init.go_array = new Array(new Point(6, 7), new Point(6, 8));
robot_array.push(robot_init);
robot_init = new Robot_init();
robot_init.name = "Robot_2";
robot_init.tip = "robot_easy";
robot_init.go_array = new Array(new Point(4, 10), new Point(4, 9));
robot_array.push(robot_init);
robot_init = new Robot_init();
robot_init.name = "Robot_3";
robot_init.tip = "robot_normal";
robot_init.go_array = new Array(new Point(12, 9), new Point(8, 9));
robot_array.push(robot_init);
}
}
}//package main.game.levels
Section 155
//Level_05 (main.game.levels.Level_05)
package main.game.levels {
import main.game.*;
import flash.geom.*;
public class Level_05 {
public var start_point:Point;
public var finish_point:Point;
private var robot_init:Robot_init;
public var map_block_array:Array;
public var robot_array:Array;
public function Level_05(){
robot_array = new Array();
super();
map_block_array = new Array(new Point(3, 10), new Point(5, 10), new Point(3, 9), new Point(5, 9), new Point(0, 8), new Point(1, 8), new Point(2, 8), new Point(3, 8), new Point(5, 8), new Point(6, 8), new Point(7, 8), new Point(8, 8), new Point(0, 7), new Point(2, 7), new Point(6, 7), new Point(8, 7), new Point(0, 6), new Point(8, 6), new Point(0, 5), new Point(8, 5), new Point(0, 4), new Point(8, 4), new Point(0, 3), new Point(2, 3), new Point(6, 3), new Point(8, 3), new Point(0, 2), new Point(1, 2), new Point(2, 2), new Point(3, 2), new Point(5, 2), new Point(6, 2), new Point(7, 2), new Point(8, 2), new Point(3, 1), new Point(5, 1), new Point(3, 0), new Point(5, 0));
start_point = new Point(4, 1);
finish_point = new Point(4, 9);
robot_init = new Robot_init();
robot_init.name = "Robot_0";
robot_init.tip = "robot_normal";
robot_init.go_array = new Array(new Point(1, 3), new Point(1, 3));
robot_array.push(robot_init);
robot_init = new Robot_init();
robot_init.name = "Robot_1";
robot_init.tip = "robot_normal";
robot_init.go_array = new Array(new Point(7, 3), new Point(7, 3));
robot_array.push(robot_init);
robot_init = new Robot_init();
robot_init.name = "Robot_2";
robot_init.tip = "robot_easy";
robot_init.go_array = new Array(new Point(2, 6), new Point(6, 6));
robot_array.push(robot_init);
robot_init = new Robot_init();
robot_init.name = "Robot_3";
robot_init.tip = "robot_easy";
robot_init.go_array = new Array(new Point(6, 5), new Point(2, 5));
robot_array.push(robot_init);
}
}
}//package main.game.levels
Section 156
//Level_06 (main.game.levels.Level_06)
package main.game.levels {
import main.game.*;
import flash.geom.*;
public class Level_06 {
public var start_point:Point;
public var finish_point:Point;
private var robot_init:Robot_init;
public var map_block_array:Array;
public var robot_array:Array;
public function Level_06(){
robot_array = new Array();
super();
map_block_array = new Array(new Point(4, 12), new Point(6, 12), new Point(4, 11), new Point(6, 11), new Point(1, 10), new Point(2, 10), new Point(3, 10), new Point(4, 10), new Point(6, 10), new Point(7, 10), new Point(8, 10), new Point(9, 10), new Point(0, 9), new Point(1, 9), new Point(4, 9), new Point(6, 9), new Point(9, 9), new Point(10, 9), new Point(0, 8), new Point(4, 8), new Point(6, 8), new Point(10, 8), new Point(0, 7), new Point(10, 7), new Point(0, 6), new Point(10, 6), new Point(0, 5), new Point(3, 5), new Point(4, 5), new Point(5, 5), new Point(6, 5), new Point(7, 5), new Point(10, 5), new Point(0, 4), new Point(5, 4), new Point(10, 4), new Point(0, 3), new Point(1, 3), new Point(9, 3), new Point(10, 3), new Point(1, 2), new Point(2, 2), new Point(3, 2), new Point(4, 2), new Point(6, 2), new Point(7, 2), new Point(8, 2), new Point(9, 2), new Point(4, 1), new Point(6, 1), new Point(4, 0), new Point(6, 0));
start_point = new Point(5, 1);
finish_point = new Point(5, 11);
robot_init = new Robot_init();
robot_init.name = "Robot_0";
robot_init.tip = "robot_normal";
robot_init.go_array = new Array(new Point(7, 7), new Point(9, 7));
robot_array.push(robot_init);
robot_init = new Robot_init();
robot_init.name = "Robot_1";
robot_init.tip = "robot_normal";
robot_init.go_array = new Array(new Point(3, 7), new Point(1, 7));
robot_array.push(robot_init);
robot_init = new Robot_init();
robot_init.name = "Robot_2";
robot_init.tip = "robot_hard";
robot_init.go_array = new Array(new Point(5, 9), new Point(5, 6));
robot_array.push(robot_init);
}
}
}//package main.game.levels
Section 157
//Level_07 (main.game.levels.Level_07)
package main.game.levels {
import main.game.*;
import flash.geom.*;
public class Level_07 {
public var start_point:Point;
public var finish_point:Point;
private var robot_init:Robot_init;
public var map_block_array:Array;
public var robot_array:Array;
public function Level_07(){
robot_array = new Array();
super();
map_block_array = new Array(new Point(6, 13), new Point(8, 13), new Point(6, 12), new Point(8, 12), new Point(3, 11), new Point(4, 11), new Point(5, 11), new Point(6, 11), new Point(8, 11), new Point(9, 11), new Point(10, 11), new Point(11, 11), new Point(3, 10), new Point(5, 10), new Point(9, 10), new Point(11, 10), new Point(3, 9), new Point(11, 9), new Point(3, 8), new Point(5, 8), new Point(7, 8), new Point(9, 8), new Point(11, 8), new Point(3, 7), new Point(11, 7), new Point(0, 6), new Point(1, 6), new Point(2, 6), new Point(3, 6), new Point(5, 6), new Point(7, 6), new Point(9, 6), new Point(11, 6), new Point(12, 6), new Point(13, 6), new Point(14, 6), new Point(0, 5), new Point(14, 5), new Point(0, 4), new Point(1, 4), new Point(2, 4), new Point(3, 4), new Point(11, 4), new Point(12, 4), new Point(13, 4), new Point(14, 4), new Point(3, 3), new Point(4, 3), new Point(10, 3), new Point(11, 3), new Point(4, 2), new Point(5, 2), new Point(6, 2), new Point(8, 2), new Point(9, 2), new Point(10, 2), new Point(6, 1), new Point(8, 1), new Point(6, 0), new Point(8, 0));
start_point = new Point(7, 1);
finish_point = new Point(7, 12);
robot_init = new Robot_init();
robot_init.name = "Robot_0";
robot_init.tip = "robot_easy";
robot_init.go_array = new Array(new Point(13, 5), new Point(11, 5));
robot_array.push(robot_init);
robot_init = new Robot_init();
robot_init.name = "Robot_1";
robot_init.tip = "robot_easy";
robot_init.go_array = new Array(new Point(1, 5), new Point(3, 5));
robot_array.push(robot_init);
robot_init = new Robot_init();
robot_init.name = "Robot_2";
robot_init.tip = "robot_normal";
robot_init.go_array = new Array(new Point(10, 9), new Point(8, 9), new Point(8, 7), new Point(10, 7));
robot_array.push(robot_init);
robot_init = new Robot_init();
robot_init.name = "Robot_3";
robot_init.tip = "robot_normal";
robot_init.go_array = new Array(new Point(6, 9), new Point(4, 9), new Point(4, 7), new Point(6, 7));
robot_array.push(robot_init);
}
}
}//package main.game.levels
Section 158
//Level_08 (main.game.levels.Level_08)
package main.game.levels {
import main.game.*;
import flash.geom.*;
public class Level_08 {
public var start_point:Point;
public var finish_point:Point;
private var robot_init:Robot_init;
public var map_block_array:Array;
public var robot_array:Array;
public function Level_08(){
robot_array = new Array();
super();
map_block_array = new Array(new Point(4, 16), new Point(6, 16), new Point(4, 15), new Point(6, 15), new Point(1, 14), new Point(2, 14), new Point(3, 14), new Point(4, 14), new Point(6, 14), new Point(7, 14), new Point(8, 14), new Point(9, 14), new Point(1, 13), new Point(9, 13), new Point(1, 12), new Point(5, 12), new Point(9, 12), new Point(0, 11), new Point(1, 11), new Point(9, 11), new Point(10, 11), new Point(0, 10), new Point(3, 10), new Point(7, 10), new Point(10, 10), new Point(0, 9), new Point(1, 9), new Point(9, 9), new Point(10, 9), new Point(1, 8), new Point(9, 8), new Point(0, 7), new Point(1, 7), new Point(9, 7), new Point(10, 7), new Point(0, 6), new Point(3, 6), new Point(7, 6), new Point(10, 6), new Point(0, 5), new Point(1, 5), new Point(9, 5), new Point(10, 5), new Point(1, 4), new Point(9, 4), new Point(1, 3), new Point(9, 3), new Point(1, 2), new Point(2, 2), new Point(4, 2), new Point(6, 2), new Point(8, 2), new Point(9, 2), new Point(2, 1), new Point(3, 1), new Point(4, 1), new Point(6, 1), new Point(7, 1), new Point(8, 1), new Point(4, 0), new Point(6, 0));
start_point = new Point(5, 1);
finish_point = new Point(5, 15);
robot_init = new Robot_init();
robot_init.name = "Robot_0";
robot_init.tip = "robot_easy";
robot_init.go_array = new Array(new Point(2, 7), new Point(4, 7), new Point(4, 5), new Point(2, 5));
robot_array.push(robot_init);
robot_init = new Robot_init();
robot_init.name = "Robot_1";
robot_init.tip = "robot_hard";
robot_init.go_array = new Array(new Point(8, 7), new Point(8, 5), new Point(6, 5), new Point(6, 7));
robot_array.push(robot_init);
robot_init = new Robot_init();
robot_init.name = "Robot_2";
robot_init.tip = "robot_easy";
robot_init.go_array = new Array(new Point(8, 11), new Point(6, 11), new Point(6, 9), new Point(8, 9));
robot_array.push(robot_init);
robot_init = new Robot_init();
robot_init.name = "Robot_3";
robot_init.tip = "robot_hard";
robot_init.go_array = new Array(new Point(2, 11), new Point(2, 9), new Point(4, 9), new Point(4, 11));
robot_array.push(robot_init);
robot_init = new Robot_init();
robot_init.name = "Robot_4";
robot_init.tip = "robot_normal";
robot_init.go_array = new Array(new Point(3, 2), new Point(3, 2));
robot_array.push(robot_init);
robot_init = new Robot_init();
robot_init.name = "Robot_5";
robot_init.tip = "robot_normal";
robot_init.go_array = new Array(new Point(7, 2), new Point(7, 2));
robot_array.push(robot_init);
}
}
}//package main.game.levels
Section 159
//Level_09 (main.game.levels.Level_09)
package main.game.levels {
import main.game.*;
import flash.geom.*;
public class Level_09 {
public var start_point:Point;
public var finish_point:Point;
private var robot_init:Robot_init;
public var map_block_array:Array;
public var robot_array:Array;
public function Level_09(){
robot_array = new Array();
super();
map_block_array = new Array(new Point(1, 13), new Point(3, 13), new Point(1, 12), new Point(3, 12), new Point(0, 11), new Point(1, 11), new Point(3, 11), new Point(4, 11), new Point(5, 11), new Point(6, 11), new Point(7, 11), new Point(8, 11), new Point(0, 10), new Point(8, 10), new Point(0, 9), new Point(8, 9), new Point(0, 8), new Point(1, 8), new Point(2, 8), new Point(3, 8), new Point(4, 8), new Point(5, 8), new Point(8, 8), new Point(5, 7), new Point(8, 7), new Point(5, 6), new Point(8, 6), new Point(0, 5), new Point(1, 5), new Point(2, 5), new Point(3, 5), new Point(4, 5), new Point(5, 5), new Point(8, 5), new Point(0, 4), new Point(8, 4), new Point(0, 3), new Point(8, 3), new Point(0, 2), new Point(2, 2), new Point(3, 2), new Point(4, 2), new Point(5, 2), new Point(6, 2), new Point(7, 2), new Point(8, 2), new Point(0, 1), new Point(2, 1), new Point(0, 0), new Point(2, 0));
start_point = new Point(1, 1);
finish_point = new Point(2, 12);
robot_init = new Robot_init();
robot_init.name = "Robot_0";
robot_init.tip = "robot_easy";
robot_init.go_array = new Array(new Point(4, 4), new Point(4, 4));
robot_array.push(robot_init);
robot_init = new Robot_init();
robot_init.name = "Robot_1";
robot_init.tip = "robot_easy";
robot_init.go_array = new Array(new Point(4, 3), new Point(4, 3));
robot_array.push(robot_init);
robot_init = new Robot_init();
robot_init.name = "Robot_2";
robot_init.tip = "robot_normal";
robot_init.go_array = new Array(new Point(6, 7), new Point(6, 7));
robot_array.push(robot_init);
robot_init = new Robot_init();
robot_init.name = "Robot_3";
robot_init.tip = "robot_normal";
robot_init.go_array = new Array(new Point(7, 7), new Point(7, 7));
robot_array.push(robot_init);
robot_init = new Robot_init();
robot_init.name = "Robot_4";
robot_init.tip = "robot_hard";
robot_init.go_array = new Array(new Point(3, 10), new Point(3, 10));
robot_array.push(robot_init);
robot_init = new Robot_init();
robot_init.name = "Robot_5";
robot_init.tip = "robot_hard";
robot_init.go_array = new Array(new Point(3, 9), new Point(3, 9));
robot_array.push(robot_init);
}
}
}//package main.game.levels
Section 160
//Level_10 (main.game.levels.Level_10)
package main.game.levels {
import main.game.*;
import flash.geom.*;
public class Level_10 {
public var start_point:Point;
public var finish_point:Point;
private var robot_init:Robot_init;
public var map_block_array:Array;
public var robot_array:Array;
public function Level_10(){
robot_array = new Array();
super();
map_block_array = new Array(new Point(5, 15), new Point(7, 15), new Point(5, 14), new Point(7, 14), new Point(5, 13), new Point(7, 13), new Point(8, 13), new Point(9, 13), new Point(10, 13), new Point(5, 12), new Point(10, 12), new Point(5, 11), new Point(7, 11), new Point(10, 11), new Point(2, 10), new Point(3, 10), new Point(4, 10), new Point(5, 10), new Point(10, 10), new Point(2, 9), new Point(10, 9), new Point(1, 8), new Point(2, 8), new Point(3, 8), new Point(10, 8), new Point(1, 7), new Point(8, 7), new Point(9, 7), new Point(10, 7), new Point(1, 6), new Point(8, 6), new Point(0, 5), new Point(1, 5), new Point(6, 5), new Point(7, 5), new Point(8, 5), new Point(0, 4), new Point(6, 4), new Point(0, 3), new Point(4, 3), new Point(5, 3), new Point(6, 3), new Point(0, 2), new Point(2, 2), new Point(3, 2), new Point(4, 2), new Point(0, 1), new Point(2, 1), new Point(0, 0), new Point(2, 0));
start_point = new Point(1, 1);
finish_point = new Point(6, 14);
robot_init = new Robot_init();
robot_init.name = "Robot_0";
robot_init.tip = "robot_hard";
robot_init.go_array = new Array(new Point(8, 12), new Point(6, 12));
robot_array.push(robot_init);
robot_init = new Robot_init();
robot_init.name = "Robot_1";
robot_init.tip = "robot_normal";
robot_init.go_array = new Array(new Point(9, 8), new Point(9, 8));
robot_array.push(robot_init);
robot_init = new Robot_init();
robot_init.name = "Robot_2";
robot_init.tip = "robot_normal";
robot_init.go_array = new Array(new Point(7, 6), new Point(7, 6));
robot_array.push(robot_init);
robot_init = new Robot_init();
robot_init.name = "Robot_3";
robot_init.tip = "robot_normal";
robot_init.go_array = new Array(new Point(5, 4), new Point(5, 4));
robot_array.push(robot_init);
robot_init = new Robot_init();
robot_init.name = "Robot_4";
robot_init.tip = "robot_hard";
robot_init.go_array = new Array(new Point(3, 9), new Point(3, 9));
robot_array.push(robot_init);
}
}
}//package main.game.levels
Section 161
//Level_11 (main.game.levels.Level_11)
package main.game.levels {
import main.game.*;
import flash.geom.*;
public class Level_11 {
public var start_point:Point;
public var finish_point:Point;
private var robot_init:Robot_init;
public var map_block_array:Array;
public var robot_array:Array;
public function Level_11(){
robot_array = new Array();
super();
map_block_array = new Array(new Point(4, 11), new Point(6, 11), new Point(4, 10), new Point(6, 10), new Point(0, 9), new Point(1, 9), new Point(2, 9), new Point(3, 9), new Point(4, 9), new Point(6, 9), new Point(7, 9), new Point(8, 9), new Point(9, 9), new Point(10, 9), new Point(0, 8), new Point(10, 8), new Point(0, 7), new Point(10, 7), new Point(0, 6), new Point(10, 6), new Point(0, 5), new Point(5, 5), new Point(10, 5), new Point(0, 4), new Point(10, 4), new Point(0, 3), new Point(10, 3), new Point(0, 2), new Point(1, 2), new Point(4, 2), new Point(6, 2), new Point(9, 2), new Point(10, 2), new Point(1, 1), new Point(2, 1), new Point(3, 1), new Point(4, 1), new Point(6, 1), new Point(7, 1), new Point(8, 1), new Point(9, 1), new Point(4, 0), new Point(6, 0));
start_point = new Point(5, 1);
finish_point = new Point(5, 10);
robot_init = new Robot_init();
robot_init.name = "Robot_0";
robot_init.tip = "robot_normal";
robot_init.go_array = new Array(new Point(2, 2), new Point(2, 2));
robot_array.push(robot_init);
robot_init = new Robot_init();
robot_init.name = "Robot_1";
robot_init.tip = "robot_normal";
robot_init.go_array = new Array(new Point(3, 2), new Point(3, 2));
robot_array.push(robot_init);
robot_init = new Robot_init();
robot_init.name = "Robot_2";
robot_init.tip = "robot_normal";
robot_init.go_array = new Array(new Point(7, 2), new Point(7, 2));
robot_array.push(robot_init);
robot_init = new Robot_init();
robot_init.name = "Robot_3";
robot_init.tip = "robot_normal";
robot_init.go_array = new Array(new Point(8, 2), new Point(8, 2));
robot_array.push(robot_init);
robot_init = new Robot_init();
robot_init.name = "Robot_4";
robot_init.tip = "robot_hard";
robot_init.go_array = new Array(new Point(3, 6), new Point(3, 7));
robot_array.push(robot_init);
robot_init = new Robot_init();
robot_init.name = "Robot_5";
robot_init.tip = "robot_hard";
robot_init.go_array = new Array(new Point(7, 6), new Point(7, 7));
robot_array.push(robot_init);
}
}
}//package main.game.levels
Section 162
//Level_12 (main.game.levels.Level_12)
package main.game.levels {
import main.game.*;
import flash.geom.*;
public class Level_12 {
public var start_point:Point;
public var finish_point:Point;
private var robot_init:Robot_init;
public var map_block_array:Array;
public var robot_array:Array;
public function Level_12(){
robot_array = new Array();
super();
map_block_array = new Array(new Point(8, 16), new Point(10, 16), new Point(8, 15), new Point(10, 15), new Point(6, 14), new Point(7, 14), new Point(8, 14), new Point(10, 14), new Point(11, 14), new Point(12, 14), new Point(6, 13), new Point(12, 13), new Point(0, 12), new Point(1, 12), new Point(2, 12), new Point(3, 12), new Point(4, 12), new Point(5, 12), new Point(6, 12), new Point(7, 12), new Point(8, 12), new Point(10, 12), new Point(11, 12), new Point(12, 12), new Point(0, 11), new Point(6, 11), new Point(10, 11), new Point(0, 10), new Point(3, 10), new Point(9, 10), new Point(10, 10), new Point(11, 10), new Point(12, 10), new Point(0, 9), new Point(1, 9), new Point(3, 9), new Point(4, 9), new Point(5, 9), new Point(6, 9), new Point(7, 9), new Point(8, 9), new Point(9, 9), new Point(10, 9), new Point(12, 9), new Point(0, 8), new Point(7, 8), new Point(8, 8), new Point(10, 8), new Point(12, 8), new Point(0, 7), new Point(8, 7), new Point(9, 7), new Point(10, 7), new Point(12, 7), new Point(0, 6), new Point(2, 6), new Point(9, 6), new Point(10, 6), new Point(12, 6), new Point(0, 5), new Point(12, 5), new Point(0, 4), new Point(9, 4), new Point(10, 4), new Point(11, 4), new Point(12, 4), new Point(0, 3), new Point(8, 3), new Point(9, 3), new Point(0, 2), new Point(2, 2), new Point(3, 2), new Point(4, 2), new Point(6, 2), new Point(7, 2), new Point(8, 2), new Point(0, 1), new Point(1, 1), new Point(2, 1), new Point(3, 1), new Point(4, 1), new Point(6, 1), new Point(4, 0), new Point(6, 0));
start_point = new Point(5, 1);
finish_point = new Point(9, 15);
robot_init = new Robot_init();
robot_init.name = "Robot_0";
robot_init.tip = "robot_hard";
robot_init.go_array = new Array(new Point(1, 2), new Point(1, 2));
robot_array.push(robot_init);
robot_init = new Robot_init();
robot_init.name = "Robot_1";
robot_init.tip = "robot_normal";
robot_init.go_array = new Array(new Point(2, 9), new Point(2, 8));
robot_array.push(robot_init);
robot_init = new Robot_init();
robot_init.name = "Robot_2";
robot_init.tip = "robot_hard";
robot_init.go_array = new Array(new Point(11, 9), new Point(11, 5), new Point(6, 5));
robot_array.push(robot_init);
robot_init = new Robot_init();
robot_init.name = "Robot_3";
robot_init.tip = "robot_normal";
robot_init.go_array = new Array(new Point(7, 13), new Point(7, 13));
robot_array.push(robot_init);
robot_init = new Robot_init();
robot_init.name = "Robot_4";
robot_init.tip = "robot_normal";
robot_init.go_array = new Array(new Point(11, 13), new Point(11, 13));
robot_array.push(robot_init);
}
}
}//package main.game.levels
Section 163
//Level_13 (main.game.levels.Level_13)
package main.game.levels {
import main.game.*;
import flash.geom.*;
public class Level_13 {
public var start_point:Point;
public var finish_point:Point;
private var robot_init:Robot_init;
public var map_block_array:Array;
public var robot_array:Array;
public function Level_13(){
robot_array = new Array();
super();
map_block_array = new Array(new Point(4, 12), new Point(6, 12), new Point(4, 11), new Point(6, 11), new Point(0, 10), new Point(1, 10), new Point(2, 10), new Point(3, 10), new Point(4, 10), new Point(6, 10), new Point(7, 10), new Point(8, 10), new Point(9, 10), new Point(10, 10), new Point(0, 9), new Point(10, 9), new Point(0, 8), new Point(10, 8), new Point(0, 7), new Point(10, 7), new Point(0, 6), new Point(10, 6), new Point(0, 5), new Point(4, 5), new Point(5, 5), new Point(6, 5), new Point(10, 5), new Point(0, 4), new Point(5, 4), new Point(10, 4), new Point(0, 3), new Point(10, 3), new Point(0, 2), new Point(1, 2), new Point(2, 2), new Point(3, 2), new Point(4, 2), new Point(6, 2), new Point(7, 2), new Point(8, 2), new Point(9, 2), new Point(10, 2), new Point(4, 1), new Point(6, 1), new Point(4, 0), new Point(6, 0));
start_point = new Point(5, 1);
finish_point = new Point(5, 11);
robot_init = new Robot_init();
robot_init.name = "Robot_0";
robot_init.tip = "robot_hard";
robot_init.go_array = new Array(new Point(5, 6), new Point(5, 6));
robot_array.push(robot_init);
robot_init = new Robot_init();
robot_init.name = "Robot_1";
robot_init.tip = "robot_normal";
robot_init.go_array = new Array(new Point(1, 8), new Point(1, 6));
robot_array.push(robot_init);
robot_init = new Robot_init();
robot_init.name = "Robot_2";
robot_init.tip = "robot_normal";
robot_init.go_array = new Array(new Point(3, 8), new Point(3, 6));
robot_array.push(robot_init);
robot_init = new Robot_init();
robot_init.name = "Robot_3";
robot_init.tip = "robot_normal";
robot_init.go_array = new Array(new Point(7, 8), new Point(7, 6));
robot_array.push(robot_init);
robot_init = new Robot_init();
robot_init.name = "Robot_4";
robot_init.tip = "robot_normal";
robot_init.go_array = new Array(new Point(9, 8), new Point(9, 6));
robot_array.push(robot_init);
}
}
}//package main.game.levels
Section 164
//Level_14 (main.game.levels.Level_14)
package main.game.levels {
import main.game.*;
import flash.geom.*;
public class Level_14 {
public var start_point:Point;
public var finish_point:Point;
private var robot_init:Robot_init;
public var map_block_array:Array;
public var robot_array:Array;
public function Level_14(){
robot_array = new Array();
super();
map_block_array = new Array(new Point(2, 16), new Point(3, 16), new Point(4, 16), new Point(5, 16), new Point(6, 16), new Point(7, 16), new Point(2, 15), new Point(7, 15), new Point(9, 15), new Point(10, 15), new Point(11, 15), new Point(12, 15), new Point(13, 15), new Point(14, 15), new Point(15, 15), new Point(0, 14), new Point(2, 14), new Point(3, 14), new Point(4, 14), new Point(5, 14), new Point(7, 14), new Point(9, 14), new Point(15, 14), new Point(0, 13), new Point(2, 13), new Point(5, 13), new Point(7, 13), new Point(9, 13), new Point(11, 13), new Point(12, 13), new Point(13, 13), new Point(14, 13), new Point(15, 13), new Point(0, 12), new Point(2, 12), new Point(5, 12), new Point(7, 12), new Point(9, 12), new Point(11, 12), new Point(14, 12), new Point(15, 12), new Point(16, 12), new Point(0, 11), new Point(2, 11), new Point(4, 11), new Point(5, 11), new Point(7, 11), new Point(8, 11), new Point(9, 11), new Point(11, 11), new Point(12, 11), new Point(14, 11), new Point(16, 11), new Point(0, 10), new Point(2, 10), new Point(4, 10), new Point(12, 10), new Point(14, 10), new Point(16, 10), new Point(0, 9), new Point(2, 9), new Point(3, 9), new Point(4, 9), new Point(12, 9), new Point(13, 9), new Point(14, 9), new Point(16, 9), new Point(0, 8), new Point(16, 8), new Point(0, 7), new Point(1, 7), new Point(2, 7), new Point(3, 7), new Point(4, 7), new Point(12, 7), new Point(13, 7), new Point(14, 7), new Point(15, 7), new Point(16, 7), new Point(4, 6), new Point(5, 6), new Point(6, 6), new Point(7, 6), new Point(9, 6), new Point(10, 6), new Point(11, 6), new Point(12, 6), new Point(7, 5), new Point(9, 5), new Point(7, 4), new Point(9, 4), new Point(7, 3), new Point(9, 3), new Point(7, 2), new Point(9, 2), new Point(7, 1), new Point(9, 1), new Point(7, 0), new Point(9, 0));
start_point = new Point(8, 1);
finish_point = new Point(1, 13);
robot_init = new Robot_init();
robot_init.name = "Robot_0";
robot_init.tip = "robot_normal";
robot_init.go_array = new Array(new Point(1, 11), new Point(1, 8), new Point(7, 8));
robot_array.push(robot_init);
robot_init = new Robot_init();
robot_init.name = "Robot_1";
robot_init.tip = "robot_normal";
robot_init.go_array = new Array(new Point(15, 11), new Point(15, 8), new Point(9, 8));
robot_array.push(robot_init);
robot_init = new Robot_init();
robot_init.name = "Robot_2";
robot_init.tip = "robot_hard";
robot_init.go_array = new Array(new Point(3, 15), new Point(6, 15), new Point(6, 9));
robot_array.push(robot_init);
robot_init = new Robot_init();
robot_init.name = "Robot_3";
robot_init.tip = "robot_hard";
robot_init.go_array = new Array(new Point(14, 14), new Point(10, 14), new Point(10, 9));
robot_array.push(robot_init);
}
}
}//package main.game.levels
Section 165
//Level_15 (main.game.levels.Level_15)
package main.game.levels {
import main.game.*;
import flash.geom.*;
public class Level_15 {
public var start_point:Point;
public var finish_point:Point;
private var robot_init:Robot_init;
public var map_block_array:Array;
public var robot_array:Array;
public function Level_15(){
robot_array = new Array();
super();
map_block_array = new Array(new Point(2, 13), new Point(4, 13), new Point(2, 12), new Point(4, 12), new Point(2, 11), new Point(4, 11), new Point(5, 11), new Point(6, 11), new Point(7, 11), new Point(8, 11), new Point(9, 11), new Point(2, 10), new Point(9, 10), new Point(2, 9), new Point(3, 9), new Point(4, 9), new Point(5, 9), new Point(9, 9), new Point(5, 8), new Point(9, 8), new Point(5, 7), new Point(9, 7), new Point(0, 6), new Point(1, 6), new Point(2, 6), new Point(3, 6), new Point(4, 6), new Point(5, 6), new Point(9, 6), new Point(0, 5), new Point(9, 5), new Point(0, 4), new Point(9, 4), new Point(0, 3), new Point(9, 3), new Point(0, 2), new Point(2, 2), new Point(3, 2), new Point(4, 2), new Point(5, 2), new Point(6, 2), new Point(7, 2), new Point(8, 2), new Point(9, 2), new Point(0, 1), new Point(2, 1), new Point(0, 0), new Point(2, 0));
start_point = new Point(1, 1);
finish_point = new Point(3, 12);
robot_init = new Robot_init();
robot_init.name = "Robot_0";
robot_init.tip = "robot_normal";
robot_init.go_array = new Array(new Point(4, 3), new Point(4, 3));
robot_array.push(robot_init);
robot_init = new Robot_init();
robot_init.name = "Robot_1";
robot_init.tip = "robot_normal";
robot_init.go_array = new Array(new Point(4, 4), new Point(4, 4));
robot_array.push(robot_init);
robot_init = new Robot_init();
robot_init.name = "Robot_2";
robot_init.tip = "robot_normal";
robot_init.go_array = new Array(new Point(4, 5), new Point(4, 5));
robot_array.push(robot_init);
robot_init = new Robot_init();
robot_init.name = "Robot_3";
robot_init.tip = "robot_normal";
robot_init.go_array = new Array(new Point(7, 8), new Point(7, 8));
robot_array.push(robot_init);
robot_init = new Robot_init();
robot_init.name = "Robot_4";
robot_init.tip = "robot_hard";
robot_init.go_array = new Array(new Point(6, 8), new Point(6, 8));
robot_array.push(robot_init);
robot_init = new Robot_init();
robot_init.name = "Robot_5";
robot_init.tip = "robot_hard";
robot_init.go_array = new Array(new Point(8, 8), new Point(8, 8));
robot_array.push(robot_init);
}
}
}//package main.game.levels
Section 166
//Level_16 (main.game.levels.Level_16)
package main.game.levels {
import main.game.*;
import flash.geom.*;
public class Level_16 {
public var start_point:Point;
public var finish_point:Point;
private var robot_init:Robot_init;
public var map_block_array:Array;
public var robot_array:Array;
public function Level_16(){
robot_array = new Array();
super();
map_block_array = new Array(new Point(0, 14), new Point(2, 14), new Point(0, 13), new Point(2, 13), new Point(0, 12), new Point(2, 12), new Point(3, 12), new Point(4, 12), new Point(0, 11), new Point(4, 11), new Point(0, 10), new Point(4, 10), new Point(5, 10), new Point(6, 10), new Point(0, 9), new Point(6, 9), new Point(0, 8), new Point(1, 8), new Point(2, 8), new Point(6, 8), new Point(7, 8), new Point(8, 8), new Point(2, 7), new Point(8, 7), new Point(2, 6), new Point(3, 6), new Point(4, 6), new Point(8, 6), new Point(9, 6), new Point(4, 5), new Point(9, 5), new Point(10, 5), new Point(4, 4), new Point(5, 4), new Point(6, 4), new Point(10, 4), new Point(6, 3), new Point(7, 3), new Point(10, 3), new Point(7, 2), new Point(8, 2), new Point(10, 2), new Point(8, 1), new Point(10, 1), new Point(8, 0), new Point(10, 0));
start_point = new Point(9, 1);
finish_point = new Point(1, 13);
robot_init = new Robot_init();
robot_init.name = "Robot_0";
robot_init.tip = "robot_hard";
robot_init.go_array = new Array(new Point(5, 5), new Point(5, 5));
robot_array.push(robot_init);
robot_init = new Robot_init();
robot_init.name = "Robot_1";
robot_init.tip = "robot_hard";
robot_init.go_array = new Array(new Point(5, 9), new Point(5, 9));
robot_array.push(robot_init);
robot_init = new Robot_init();
robot_init.name = "Robot_2";
robot_init.tip = "robot_hard";
robot_init.go_array = new Array(new Point(3, 11), new Point(3, 11));
robot_array.push(robot_init);
robot_init = new Robot_init();
robot_init.name = "Robot_3";
robot_init.tip = "robot_hard";
robot_init.go_array = new Array(new Point(1, 9), new Point(1, 9));
robot_array.push(robot_init);
robot_init = new Robot_init();
robot_init.name = "Robot_4";
robot_init.tip = "robot_normal";
robot_init.go_array = new Array(new Point(3, 7), new Point(3, 7));
robot_array.push(robot_init);
robot_init = new Robot_init();
robot_init.name = "Robot_5";
robot_init.tip = "robot_normal";
robot_init.go_array = new Array(new Point(7, 7), new Point(7, 7));
robot_array.push(robot_init);
}
}
}//package main.game.levels
Section 167
//Level_17 (main.game.levels.Level_17)
package main.game.levels {
import main.game.*;
import flash.geom.*;
public class Level_17 {
public var start_point:Point;
public var finish_point:Point;
private var robot_init:Robot_init;
public var map_block_array:Array;
public var robot_array:Array;
public function Level_17(){
robot_array = new Array();
super();
map_block_array = new Array(new Point(1, 9), new Point(3, 9), new Point(1, 8), new Point(3, 8), new Point(0, 7), new Point(1, 7), new Point(3, 7), new Point(4, 7), new Point(0, 6), new Point(4, 6), new Point(0, 5), new Point(4, 5), new Point(0, 4), new Point(4, 4), new Point(0, 3), new Point(4, 3), new Point(0, 2), new Point(1, 2), new Point(3, 2), new Point(4, 2), new Point(1, 1), new Point(3, 1), new Point(1, 0), new Point(3, 0));
start_point = new Point(2, 1);
finish_point = new Point(2, 8);
robot_init = new Robot_init();
robot_init.name = "Robot_0";
robot_init.tip = "robot_hard";
robot_init.go_array = new Array(new Point(3, 6), new Point(3, 3));
robot_array.push(robot_init);
robot_init = new Robot_init();
robot_init.name = "Robot_1";
robot_init.tip = "robot_hard";
robot_init.go_array = new Array(new Point(2, 6), new Point(2, 3));
robot_array.push(robot_init);
robot_init = new Robot_init();
robot_init.name = "Robot_2";
robot_init.tip = "robot_hard";
robot_init.go_array = new Array(new Point(1, 6), new Point(1, 3));
robot_array.push(robot_init);
}
}
}//package main.game.levels
Section 168
//Level_18 (main.game.levels.Level_18)
package main.game.levels {
import main.game.*;
import flash.geom.*;
public class Level_18 {
public var start_point:Point;
public var finish_point:Point;
private var robot_init:Robot_init;
public var map_block_array:Array;
public var robot_array:Array;
public function Level_18(){
robot_array = new Array();
super();
map_block_array = new Array(new Point(0, 6), new Point(1, 6), new Point(2, 6), new Point(3, 6), new Point(4, 6), new Point(0, 5), new Point(4, 5), new Point(0, 4), new Point(4, 4), new Point(0, 3), new Point(4, 3), new Point(0, 2), new Point(1, 2), new Point(3, 2), new Point(4, 2), new Point(1, 1), new Point(3, 1), new Point(1, 0), new Point(3, 0));
start_point = new Point(2, 1);
finish_point = new Point(4, 13);
}
}
}//package main.game.levels
Section 169
//BoomDrag (main.game.BoomDrag)
package main.game {
import flash.display.*;
public class BoomDrag {
public var fase:String;// = "go"
private var step:int;// = 1
private var final_step:Number;
private var start_x:Number;
private var start_y:Number;
private var mc:DisplayObject;
public function BoomDrag(_arg1:DisplayObject, _arg2:int=10){
final_step = _arg2;
mc = _arg1;
start_x = mc.x;
start_y = mc.y;
}
public function play():void{
mc.x = (start_x + (Math.random() * 10));
mc.y = (start_y + (Math.random() * 10));
step++;
if (step > final_step){
fase = "end";
mc.x = start_x;
mc.y = start_y;
mc = null;
};
}
}
}//package main.game
Section 170
//Boss (main.game.Boss)
package main.game {
import alternativa.engine3d.core.*;
import alternativa.engine3d.primitives.*;
import main.*;
public class Boss extends Mesh {
public var deaded:Boolean;// = false
private var boom_array:Array;
public var destroy:Boolean;// = false
private var robot_head:Box;
public function Boss(){
boom_array = new Array();
super();
robot_head = new Box(Stat.TILE_LENGTH, Stat.TILE_LENGTH, Stat.TILE_LENGTH, 1, 1, 1, false, true);
this.x = (2 * Stat.TILE_LENGTH);
this.y = (4 * Stat.TILE_LENGTH);
this.z = (Stat.TILE_LENGTH / 2);
robot_head.name = "boss";
robot_head.cloneMaterialToAllSurfaces(new BoxMaterial("Boss"));
addChild(robot_head);
}
public function dead():void{
var _local1:Sprite3D;
var _local2:int;
removeChild(robot_head);
_local2 = 0;
while (_local2 < 40) {
_local1 = new Sprite3D("boom");
_local1.mobility = 1005;
_local1.z = (Math.random() * 5);
_local1.x = (Math.random() * 5);
_local1.y = (Math.random() * 5);
_local1.material = new SpriteMaterial("Boom");
addChild(_local1);
boom_array.push(new Oskolok_move(_local1));
_local2++;
};
}
public function boom_move():void{
var _local1:Object3D;
var _local2:Oskolok_move;
var _local3:String;
for (_local3 in boom_array) {
_local2 = boom_array[_local3];
_local1 = _local2.mesh;
_local2.vector_x = (_local2.vector_x * 1.1);
_local2.vector_y = (_local2.vector_y * 1.1);
_local2.vector_z = (_local2.vector_z * 1.1);
_local1.x = (_local1.x + _local2.vector_x);
_local1.y = (_local1.y + _local2.vector_y);
_local1.z = (_local1.z + _local2.vector_z);
_local1.rotationX = (_local1.rotationX + (Math.random() / 4));
_local1.rotationY = (_local1.rotationY + (Math.random() / 4));
_local1.rotationZ = (_local1.rotationZ + (Math.random() / 4));
_local1.scaleX = (_local1.scaleY = (_local1.scaleZ = (_local1.scaleZ - 0.06)));
};
if (_local1.scaleX < 0.2){
this.destroy = true;
};
}
}
}//package main.game
Section 171
//BoxMaterial (main.game.BoxMaterial)
package main.game {
import alternativa.types.*;
import alternativa.engine3d.materials.*;
import flash.display.*;
public class BoxMaterial extends TextureMaterial {
public function BoxMaterial(_arg1:String, _arg2:int=0){
var _local3:BitmapData;
var _local4:Bitmap;
var _local5:Number = -1;
if (_arg1 == "DoorFinal"){
_local3 = new Gate(350, 350);
} else {
if (_arg1 == "Wall_1"){
if (_arg2 == 10){
_local3 = new WallTexture11(350, 350);
} else {
if (_arg2 == 20){
_local3 = new WallTexture20(350, 350);
} else {
if (_arg2 == 30){
_local3 = new WallTexture30(350, 350);
} else {
if (_arg2 == 40){
_local3 = new WallTexture40(350, 350);
} else {
if (_arg2 == 50){
_local3 = new WallTexture11(350, 350);
} else {
if (_arg2 == 60){
_local3 = new WallTexture20(350, 350);
} else {
if (_arg2 == 70){
_local3 = new WallTexture30(350, 350);
} else {
if (_arg2 == 80){
_local3 = new WallTexture40(350, 350);
} else {
if (_arg2 == 90){
_local3 = new WallTexture11(350, 350);
} else {
if (_arg2 == 100){
_local3 = new WallTexture20(350, 350);
} else {
if (_arg2 == 110){
_local3 = new WallTexture30(350, 350);
} else {
if (_arg2 == 120){
_local3 = new WallTexture40(350, 350);
} else {
if (_arg2 == 130){
_local3 = new WallTexture11(350, 350);
} else {
if (_arg2 == 140){
_local3 = new WallTexture20(350, 350);
} else {
if (_arg2 == 150){
_local3 = new WallTexture30(350, 350);
} else {
if (_arg2 == 160){
_local3 = new WallTexture40(350, 350);
} else {
if (_arg2 == 170){
_local3 = new WallTexture11(350, 350);
} else {
if (_arg2 == 180){
_local3 = new WallTexture40(350, 350);
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
} else {
if (_arg1 == "Wall_2"){
if (_arg2 == 10){
_local3 = new WallTexture12(350, 350);
} else {
if (_arg2 == 20){
_local3 = new WallTexture21(350, 350);
} else {
if (_arg2 == 30){
_local3 = new WallTexture31(350, 350);
} else {
if (_arg2 == 40){
_local3 = new WallTexture41(350, 350);
} else {
if (_arg2 == 50){
_local3 = new WallTexture12(350, 350);
} else {
if (_arg2 == 60){
_local3 = new WallTexture23(350, 350);
} else {
if (_arg2 == 70){
_local3 = new WallTexture33(350, 350);
} else {
if (_arg2 == 80){
_local3 = new WallTexture43(350, 350);
} else {
if (_arg2 == 90){
_local3 = new WallTexture12(350, 350);
} else {
if (_arg2 == 100){
_local3 = new WallTexture21(350, 350);
} else {
if (_arg2 == 110){
_local3 = new WallTexture31(350, 350);
} else {
if (_arg2 == 120){
_local3 = new WallTexture41(350, 350);
} else {
if (_arg2 == 130){
_local3 = new WallTexture12(350, 350);
} else {
if (_arg2 == 140){
_local3 = new WallTexture23(350, 350);
} else {
if (_arg2 == 150){
_local3 = new WallTexture33(350, 350);
} else {
if (_arg2 == 160){
_local3 = new WallTexture43(350, 350);
} else {
if (_arg2 == 170){
_local3 = new WallTexture12(350, 350);
} else {
if (_arg2 == 180){
_local3 = new WallTexture41(350, 350);
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
} else {
if (_arg1 == "Wall_3"){
if (_arg2 == 10){
_local3 = new WallTexture13(350, 350);
} else {
if (_arg2 == 20){
_local3 = new WallTexture22(350, 350);
} else {
if (_arg2 == 30){
_local3 = new WallTexture32(350, 350);
} else {
if (_arg2 == 40){
_local3 = new WallTexture42(350, 350);
} else {
if (_arg2 == 50){
_local3 = new WallTexture13(350, 350);
} else {
if (_arg2 == 60){
_local3 = new WallTexture24(350, 350);
} else {
if (_arg2 == 70){
_local3 = new WallTexture34(350, 350);
} else {
if (_arg2 == 80){
_local3 = new WallTexture44(350, 350);
} else {
if (_arg2 == 90){
_local3 = new WallTexture13(350, 350);
} else {
if (_arg2 == 100){
_local3 = new WallTexture22(350, 350);
} else {
if (_arg2 == 110){
_local3 = new WallTexture32(350, 350);
} else {
if (_arg2 == 120){
_local3 = new WallTexture42(350, 350);
} else {
if (_arg2 == 130){
_local3 = new WallTexture13(350, 350);
} else {
if (_arg2 == 140){
_local3 = new WallTexture24(350, 350);
} else {
if (_arg2 == 150){
_local3 = new WallTexture34(350, 350);
} else {
if (_arg2 == 160){
_local3 = new WallTexture44(350, 350);
} else {
if (_arg2 == 170){
_local3 = new WallTexture13(350, 350);
} else {
if (_arg2 == 180){
_local3 = new WallTexture44(350, 350);
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
} else {
if (_arg1 == "Door"){
if (_arg2 == 10){
_local3 = new Gate10(350, 350);
} else {
if (_arg2 == 20){
_local3 = new Gate20(350, 350);
} else {
if (_arg2 == 30){
_local3 = new Gate30(350, 350);
} else {
if (_arg2 == 40){
_local3 = new Gate40(350, 350);
} else {
if (_arg2 == 50){
_local3 = new Gate10(350, 350);
} else {
if (_arg2 == 60){
_local3 = new Gate20(350, 350);
} else {
if (_arg2 == 70){
_local3 = new Gate30(350, 350);
} else {
if (_arg2 == 80){
_local3 = new Gate40(350, 350);
} else {
if (_arg2 == 90){
_local3 = new Gate10(350, 350);
} else {
if (_arg2 == 100){
_local3 = new Gate20(350, 350);
} else {
if (_arg2 == 110){
_local3 = new Gate30(350, 350);
} else {
if (_arg2 == 120){
_local3 = new Gate40(350, 350);
} else {
if (_arg2 == 130){
_local3 = new Gate10(350, 350);
} else {
if (_arg2 == 140){
_local3 = new Gate20(350, 350);
} else {
if (_arg2 == 150){
_local3 = new Gate30(350, 350);
} else {
if (_arg2 == 160){
_local3 = new Gate40(350, 350);
} else {
if (_arg2 == 170){
_local3 = new Gate10(350, 350);
} else {
if (_arg2 == 180){
_local3 = new Gate40(350, 350);
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
} else {
if (_arg1 == "DoorClose"){
_local3 = new Gate(350, 350);
} else {
if (_arg1 == "Boss"){
_local3 = new BossMap(350, 350);
} else {
if (_arg1 == "Sky04"){
_local3 = new Sky04(0x0200, 0x0200);
} else {
if (_arg1 == "Floor"){
_local3 = new Floor(350, 350);
} else {
if (_arg1 == "Metall1"){
_local3 = new Metall1(0x0200, 0x0200);
_local5 = -1;
} else {
if (_arg1 == "Metall2"){
_local3 = new Metall2(200, 200);
_local5 = -1;
} else {
if (_arg1 == "Metall4"){
_local3 = new Metall4(0x0200, 0x0200);
_local5 = -1;
} else {
if (_arg1 == "Metall5"){
_local3 = new Metall5(0x0200, 0x0200);
_local5 = -1;
} else {
if (_arg1 == "Metall1Red"){
_local3 = new Metall1Red(0x0200, 0x0200);
_local5 = -1;
} else {
if (_arg1 == "Metall2Red"){
_local3 = new Metall2Red(200, 200);
_local5 = -1;
} else {
if (_arg1 == "Metall4Red"){
_local3 = new Metall4Red(0x0200, 0x0200);
_local5 = -1;
} else {
if (_arg1 == "Metall5Red"){
_local3 = new Metall5Red(0x0200, 0x0200);
_local5 = -1;
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
super(new Texture(_local3, _arg1), 1, true, false, "normal", _local5, 0, 8);
}
}
}//package main.game
Section 172
//Door (main.game.Door)
package main.game {
import alternativa.engine3d.core.*;
import alternativa.engine3d.primitives.*;
import main.*;
public class Door extends Mesh {
public var flag_down:Boolean;// = false
public var flag_up:Boolean;// = true
public function Door(_arg1:int){
var _local2:Box;
super();
this.name = "Door";
this.mobility = 2;
_local2 = new Box(Stat.TILE_LENGTH, 40, Stat.TILE_LENGTH, 1, 1, 1, false, true);
_local2.mobility = 2;
_local2.cloneMaterialToAllSurfaces(new BoxMaterial("Door", _arg1));
addChild(_local2);
}
public function moved():void{
if (!flag_down){
this.z = (this.z - 5);
flag_up = false;
if (this.z < ((-(Stat.TILE_LENGTH) / 2) + 10)){
flag_down = true;
};
};
}
public function moved_up():void{
if (!flag_up){
this.z = (this.z + 5);
flag_down = false;
if (this.z > (Stat.TILE_LENGTH / 2)){
this.z = (Stat.TILE_LENGTH / 2);
flag_up = true;
};
};
}
}
}//package main.game
Section 173
//Fire_robot (main.game.Fire_robot)
package main.game {
import alternativa.engine3d.core.*;
public class Fire_robot extends Object3D {
public var radius:Number;// = 100
public var angle:Number;
public var upspeed:Number;// = 1
public var damage:Number;// = 5
public function Fire_robot(_arg1:String, _arg2:Number){
var _local3:Sprite3D;
super();
name = "fire";
if (_arg1 == "robot_easy"){
_local3 = new Sprite3D("fire");
_local3.scaleX = (_local3.scaleY = (_local3.scaleZ = 0.1));
radius = (radius * 0.01);
damage = (_arg2 * 2);
} else {
if (_arg1 == "robot_normal"){
_local3 = new Sprite3D("fire");
_local3.scaleX = (_local3.scaleY = (_local3.scaleZ = 0.2));
radius = (radius * 0.01);
damage = (_arg2 * 3);
} else {
_local3 = new Sprite3D("fire");
_local3.scaleX = (_local3.scaleY = (_local3.scaleZ = 0.3));
radius = (radius * 0.01);
damage = (_arg2 * 5);
};
};
_local3.mobility = 1005;
_local3.material = new SpriteMaterial("Fire");
addChild(_local3);
}
}
}//package main.game
Section 174
//Game (main.game.Game)
package main.game {
import flash.events.*;
import com.kongregate.as3.client.*;
import alternativa.engine3d.core.*;
import alternativa.types.*;
import alternativa.engine3d.physics.*;
import alternativa.engine3d.display.*;
import flash.geom.*;
import flash.display.*;
import alternativa.engine3d.controllers.*;
import alternativa.engine3d.primitives.*;
import flash.system.*;
import alternativa.utils.*;
import main.*;
import com.gamezhero.api.as3.*;
public class Game extends Sprite {
private var blood:Blood;
private var panel:PanelClip;
private var fire_array:Array;
private var shop:ShopClip;
private var camera:Camera3D;
private var camera_fov_limit:Number;// = 1.57
private var robot_kol:Number;
private var gun:MovieClip;
private var pricel:Pricel;
private var last_strelka:MovieClip;
private var flag2:Boolean;
private var level_scores:Array;
private var flag1:Boolean;
private var reload_flag:Boolean;// = false
private var herou_stat:Herou_stat;// = null
private var pauseClip:PauseClip;
private var robot:Robot;
private var level:int;// = 10
private var temp_rotation:Number;// = 1
private var scene:Scene3D;
private var block_gun:Sprite;
private var controller:WalkController;
private var soundManager:SoundManager;
private var boomdrag:BoomDrag;
private var roomClearClip:ClearRoomClip;
private var view:View;
private var papa:Shooter2;
private var herou:Box;
private var submiter:MovieClip;
private var gameover:SubmitClip;
private var camera_fov_step:Number;// = 0.05
public var kongregate:KongregateAPI;
private var level_diff:Number;
private var room:Room;
private var end:EndClip;
private var last_camera:Point;
private var win_flag:Boolean;// = false
private var bloodlife:Bloodlife;
private var reload_mc:MovieClip;
private var keyRotation:Object;
private static const ROTAT:Number = -1.64;
private static const FOV:Number = 1.6;
public function Game(_arg1:Shooter2, _arg2:int=1){
submiter = new MovieClip();
last_strelka = new MovieClip();
fire_array = new Array();
last_camera = new Point();
super();
papa = _arg1;
level_scores = new Array();
level_diff = Number(_arg2);
addEventListener(Event.ADDED_TO_STAGE, init_game);
kongregate = new KongregateAPI();
this.addChild(kongregate);
}
private function pause():void{
pauseClip = new PauseClip();
pauseClip.x = Stat.MAIN_WIDTH_CENTER;
pauseClip.y = ((Stat.MAIN_HEIGTH - Stat.INFO_HEIGTH) / 2);
addChild(pauseClip);
pauseClip.btn_menu.addEventListener(MouseEvent.MOUSE_DOWN, game_end);
pauseClip.btn_menu.addEventListener(MouseEvent.MOUSE_OVER, menu_over);
pauseClip.btn_menu.addEventListener(MouseEvent.MOUSE_OUT, menu_out);
pauseClip.btn_other.addEventListener(MouseEvent.MOUSE_DOWN, game_other);
pauseClip.btn_other.addEventListener(MouseEvent.MOUSE_OVER, menu_over);
pauseClip.btn_other.addEventListener(MouseEvent.MOUSE_OUT, menu_out);
pauseClip.btn_ok.addEventListener(MouseEvent.MOUSE_DOWN, pause_end);
pauseClip.btn_ok.addEventListener(MouseEvent.MOUSE_OVER, menu_over);
pauseClip.btn_ok.addEventListener(MouseEvent.MOUSE_OUT, menu_out);
}
private function new_shop_level(_arg1:MouseEvent=null):void{
removeChild(shop);
addEventListener(Event.ENTER_FRAME, onEnterFramed);
stage.addEventListener(KeyboardEvent.KEY_UP, key_up);
stage.addEventListener(KeyboardEvent.KEY_DOWN, key_down);
shop.btn_ok.removeEventListener(MouseEvent.MOUSE_DOWN, new_level);
shop.btn_ok.removeEventListener(MouseEvent.MOUSE_OVER, menu_over);
shop.btn_ok.removeEventListener(MouseEvent.MOUSE_OUT, menu_out);
next_level();
controller.coords = new Point3D(((room.start_point.x * Stat.TILE_LENGTH) - last_camera.x), ((room.start_point.y * Stat.TILE_LENGTH) - last_camera.y), camera.z);
}
private function mainMenuAction():void{
trace("YORE CODE AFTER MAIN MENU ACTION");
try {
this.removeChild(this.submiter);
} catch(e:Error) {
};
this.end_level();
}
private function game_end(_arg1:Event):void{
end_level();
}
private function init():void{
soundManager = new SoundManager();
keyRotation = new Object();
keyRotation.rotat = false;
var _local1:Sprite = new Sprite();
_local1.graphics.beginFill(0xCCCCCC);
_local1.graphics.drawRect(0, 0, 550, 400);
_local1.graphics.endFill();
_local1.cacheAsBitmap = true;
addChild(_local1);
scene = new Scene3D();
scene.splitAnalysis = false;
scene.splitBalance = 0;
scene.root = new Object3D();
camera = new Camera3D();
camera.fov = FOV;
scene.root.addChild(camera);
addChild((view = new View(camera)));
view.width = Stat.MAIN_WIDTH;
view.height = (Stat.MAIN_HEIGTH - Stat.INFO_HEIGTH);
block_gun = new Sprite();
gun = new WeaponGun();
gun.gotoAndStop("stop");
block_gun.x = Stat.MAIN_WIDTH_CENTER;
block_gun.y = (Stat.MAIN_HEIGTH - Stat.INFO_HEIGTH);
gun.cacheAsBitmap = true;
addChild(block_gun);
block_gun.addChild(gun);
pricel = new Pricel();
pricel.x = Stat.MAIN_WIDTH_CENTER;
pricel.y = ((Stat.MAIN_HEIGTH - Stat.INFO_HEIGTH) / 2);
addChild(pricel);
pricel.cacheAsBitmap = true;
panel = new PanelClip();
panel.x = (Stat.MAIN_WIDTH / 2);
panel.y = (Stat.MAIN_HEIGTH / 2);
addChild(panel);
panel.damage_mc.gotoAndStop(1);
panel.step_mc.gotoAndStop(1);
panel.boom_mc.gotoAndStop(1);
panel.reload_mc.gotoAndStop(1);
panel.endload_mc.gotoAndStop(1);
panel.txt_qulity.text = (("QUALITY " + stage.quality) + "(N)");
room = new Room(level, level_diff);
robot_kol = room.robot_array.length;
scene.root.addChild(room);
blood = new Blood();
blood.x = 0;
blood.y = 0;
blood.gotoAndStop(1);
addChild(blood);
bloodlife = new Bloodlife();
bloodlife.x = 0;
bloodlife.y = 0;
bloodlife.gotoAndStop(1);
addChild(bloodlife);
if (herou_stat == null){
herou_stat = new Herou_stat();
};
herou_stat.life = herou_stat.full_life;
herou_stat.bullets = herou_stat.full_bullets;
panel_weapon_text();
panel_life_text();
init_controll();
var _local2:Set = new Set();
_local2.add(herou);
controller.collider.collisionSet = _local2;
controller.lookAt(room.door_open.coords);
controller.enabled = true;
removeEventListener(Event.ADDED_TO_STAGE, init);
addEventListener(Event.ENTER_FRAME, onEnterFramed);
stage.addEventListener(KeyboardEvent.KEY_UP, key_up);
stage.addEventListener(KeyboardEvent.KEY_DOWN, key_down);
camera.rotationX = ROTAT;
}
private function pause_end(_arg1:Event):void{
pauseClip.btn_menu.removeEventListener(MouseEvent.MOUSE_DOWN, game_end);
pauseClip.btn_menu.removeEventListener(MouseEvent.MOUSE_OVER, menu_over);
pauseClip.btn_menu.removeEventListener(MouseEvent.MOUSE_OUT, menu_out);
pauseClip.btn_other.removeEventListener(MouseEvent.MOUSE_DOWN, game_other);
pauseClip.btn_other.removeEventListener(MouseEvent.MOUSE_OVER, menu_over);
pauseClip.btn_other.removeEventListener(MouseEvent.MOUSE_OUT, menu_out);
pauseClip.btn_ok.addEventListener(MouseEvent.MOUSE_DOWN, pause_end);
pauseClip.btn_ok.addEventListener(MouseEvent.MOUSE_OVER, menu_over);
pauseClip.btn_ok.addEventListener(MouseEvent.MOUSE_OUT, menu_out);
removeChild(pauseClip);
pauseClip = null;
this.addEventListener(Event.ENTER_FRAME, onEnterFramed);
stage.addEventListener(KeyboardEvent.KEY_DOWN, key_down);
controller.enabled = true;
}
private function panel_life_text():void{
panel.txt_life.text = String(Math.round(herou_stat.life));
}
private function end_level(_arg1:Boolean=false):void{
var _end = _arg1;
try {
removeEventListener(Event.ENTER_FRAME, onEnterFramed);
keyRotation.rotat = false;
herou_stat.fire = false;
gun.gotoAndStop("stop");
} catch(e:Error) {
};
boomdrag = null;
soundManager.free_stop();
soundManager.song_stop();
try {
room.clear();
} catch(e:Error) {
};
try {
scene.root.removeChild(camera);
scene.root.removeChild(room);
scene.root.removeChild(herou);
removeChild(view);
} catch(e:Error) {
};
controller = null;
fire_array = new Array();
try {
block_gun.removeChild(gun);
} catch(e:Error) {
};
gun = null;
try {
removeChild(block_gun);
} catch(e:Error) {
};
block_gun = null;
try {
removeChild(pricel);
} catch(e:Error) {
};
pricel = null;
try {
panel.step_mc.gotoAndStop(1);
} catch(e:Error) {
};
try {
removeChild(panel);
} catch(e:Error) {
};
panel = null;
try {
removeChild(blood);
} catch(e:Error) {
};
blood = null;
removeEventListener(Event.ENTER_FRAME, onEnterFramed);
stage.removeEventListener(KeyboardEvent.KEY_UP, key_up);
stage.removeEventListener(KeyboardEvent.KEY_DOWN, key_down);
if (_end){
end = new EndClip();
end.x = Stat.MAIN_WIDTH_CENTER;
end.y = ((Stat.MAIN_HEIGTH - Stat.INFO_HEIGTH) / 2);
end.btn_restart.addEventListener(MouseEvent.MOUSE_DOWN, endMenu);
end.btn_restart.addEventListener(MouseEvent.MOUSE_OVER, menu_over);
end.btn_restart.addEventListener(MouseEvent.MOUSE_OUT, menu_out);
addChild(end);
submitUp();
soundManager.song_end_play();
} else {
papa.menu_restart();
};
}
private function buy_uzi(_arg1:MouseEvent=null):void{
herou_stat.points = (herou_stat.points - 1200);
herou_stat.weapon.uzi = true;
shop.btn_buy_uzi_ammo.addEventListener(MouseEvent.MOUSE_DOWN, buy_uzi_ammo);
shop.btn_buy_uzi_ammo.addEventListener(MouseEvent.MOUSE_OVER, menu_over);
shop.btn_buy_uzi_ammo.addEventListener(MouseEvent.MOUSE_OUT, menu_out);
shop.btn_buy_uzi_ammo.alpha = 1;
shop_render();
}
private function new_level(_arg1:MouseEvent=null):void{
removeChild(roomClearClip);
addEventListener(Event.ENTER_FRAME, onEnterFramed);
stage.addEventListener(KeyboardEvent.KEY_UP, key_up);
stage.addEventListener(KeyboardEvent.KEY_DOWN, key_down);
roomClearClip.btn_ok.removeEventListener(MouseEvent.MOUSE_DOWN, new_level);
roomClearClip.btn_ok.removeEventListener(MouseEvent.MOUSE_OVER, menu_over);
roomClearClip.btn_ok.removeEventListener(MouseEvent.MOUSE_OUT, menu_out);
roomClearClip.btn_shop.removeEventListener(MouseEvent.MOUSE_DOWN, shop_tur);
roomClearClip.btn_shop.removeEventListener(MouseEvent.MOUSE_OVER, menu_over);
roomClearClip.btn_shop.removeEventListener(MouseEvent.MOUSE_OUT, menu_out);
next_level();
controller.coords = new Point3D(((room.start_point.x * Stat.TILE_LENGTH) - last_camera.x), ((room.start_point.y * Stat.TILE_LENGTH) - last_camera.y), camera.z);
}
private function onEnterFramed(_arg1:Event):void{
if (boomdrag.fase == "go"){
boomdrag.play();
};
herou_stat.life = (herou_stat.life + 0.05);
if (herou_stat.life > herou_stat.full_life){
herou_stat.life = herou_stat.full_life;
};
blood_see();
if (camera_fov_limit > (camera.fov + 0.02)){
camera_fov_step = 0.1;
} else {
if (camera_fov_limit < (camera.fov - 0.02)){
camera_fov_step = -0.1;
} else {
camera_fov_step = 0;
};
};
panel_life_text();
camera.fov = (camera.fov + camera_fov_step);
controller.processInput();
key_rotation();
herou.coords = camera.coords;
herou_fire();
if ((((controller.currentSpeed > 180)) && (herou_stat.live))){
if (panel.step_mc.ready){
panel.step_mc.gotoAndPlay(2);
};
} else {
panel.step_mc.gotoAndStop(1);
};
place_unit_controll();
robot_life();
if (room.map_level == 180){
boss_life();
};
fire_move();
scene.calculate();
if (!room.door_open.flag_down){
room.door_open.moved();
};
if ((((((room.finish_point.x == herou_stat.place_unit.x)) && (((room.finish_point.y - 1) == herou_stat.place_unit.y)))) || (((room.finish_point.y - 2) == herou_stat.place_unit.y)))){
if (robot_kol < 1){
room.door_open_final.moved();
};
} else {
room.door_open_final.moved_up();
};
flag1 = true;
flag1 = ((flag1) && ((room.finish_point.x == herou_stat.place_unit.x)));
flag1 = ((flag1) && ((room.finish_point.y == herou_stat.place_unit.y)));
flag2 = true;
flag2 = ((flag2) && ((room.finish_point.x == herou_stat.place_unit.x)));
flag2 = ((flag2) && (((room.finish_point.y + 1) == herou_stat.place_unit.y)));
if (((((flag1) || (flag2))) && (room.door_open_final.flag_up))){
last_camera.x = ((room.finish_point.x * Stat.TILE_LENGTH) - camera.x);
last_camera.y = ((room.finish_point.y * Stat.TILE_LENGTH) - camera.y);
room.map_level = (room.map_level + 10);
if (kongregate.connected){
if (room.map_level == 50){
kongregate.stats.submit("1/4 of labyrinth", 1);
};
if (room.map_level == 100){
kongregate.stats.submit("1/2 of labyrinth", 1);
};
};
level_scores[room.map_level] = 0;
herou_stat.life = herou_stat.full_life;
panel_life_text();
blood_see();
room_clear();
};
}
private function next_level():void{
herou_stat.weapon.load_ammo(herou_stat);
camera.rotationX = ROTAT;
room.clear();
room.level_create();
room.wall_create();
room.door_create();
room.robot_create();
if (room.map_level == 180){
room.boss_create();
};
panel_weapon_text();
herou_stat.life = herou_stat.full_life;
robot_kol = room.robot_array.length;
}
private function fire_move():void{
var _local1:Fire_robot;
var _local4:Number;
var _local5:Number;
var _local7:String;
var _local2:EllipsoidCollider = new EllipsoidCollider(scene, Stat.FIRE_RADIUS, Stat.FIRE_RADIUS, Stat.FIRE_RADIUS);
_local2.offsetThreshold = 0.01;
var _local3:Collision = new Collision();
var _local6:Point3D = new Point3D();
_local6.z = 0;
for (_local7 in fire_array) {
_local1 = fire_array[_local7];
_local1.upspeed = (_local1.upspeed * 1.02);
_local4 = ((Stat.ROBOT_FIRE_SPEED * Math.cos(_local1.angle)) * _local1.upspeed);
_local5 = ((Stat.ROBOT_FIRE_SPEED * Math.sin(_local1.angle)) * _local1.upspeed);
_local6.x = _local4;
_local6.y = _local5;
_local2.radiusX = (_local2.radiusY = (_local2.radiusZ = _local1.radius));
if (_local2.getCollision(_local1.coords, _local6, _local3)){
if (_local3.face.mesh.name == "herou"){
herou_damage(_local1.damage);
};
_local1.x = (_local1.x + _local4);
_local1.y = (_local1.y + _local5);
room.removeChild(_local1);
delete fire_array[_local7];
} else {
_local1.x = (_local1.x + _local4);
_local1.y = (_local1.y + _local5);
};
};
}
private function shop_tur(_arg1:MouseEvent=null):void{
removeChild(roomClearClip);
roomClearClip.btn_ok.removeEventListener(MouseEvent.MOUSE_DOWN, new_level);
roomClearClip.btn_ok.removeEventListener(MouseEvent.MOUSE_OVER, menu_over);
roomClearClip.btn_ok.removeEventListener(MouseEvent.MOUSE_OUT, menu_out);
roomClearClip.btn_shop.removeEventListener(MouseEvent.MOUSE_DOWN, shop_tur);
roomClearClip.btn_shop.removeEventListener(MouseEvent.MOUSE_OVER, menu_over);
roomClearClip.btn_shop.removeEventListener(MouseEvent.MOUSE_OUT, menu_out);
shop = new ShopClip();
shop.x = Stat.MAIN_WIDTH_CENTER;
shop.y = ((Stat.MAIN_HEIGTH - Stat.INFO_HEIGTH) / 2);
addChild(shop);
shop.btn_ok.addEventListener(MouseEvent.MOUSE_DOWN, new_shop_level);
shop.btn_ok.addEventListener(MouseEvent.MOUSE_OVER, menu_over);
shop.btn_ok.addEventListener(MouseEvent.MOUSE_OUT, menu_out);
shop.btn_buy_uzi.addEventListener(MouseEvent.MOUSE_DOWN, buy_uzi);
shop.btn_buy_uzi.addEventListener(MouseEvent.MOUSE_OVER, menu_over);
shop.btn_buy_uzi.addEventListener(MouseEvent.MOUSE_OUT, menu_out);
shop.btn_buy_rifle.addEventListener(MouseEvent.MOUSE_DOWN, buy_rifle);
shop.btn_buy_rifle.addEventListener(MouseEvent.MOUSE_OVER, menu_over);
shop.btn_buy_rifle.addEventListener(MouseEvent.MOUSE_OUT, menu_out);
shop.btn_buy_machine.addEventListener(MouseEvent.MOUSE_DOWN, buy_machine);
shop.btn_buy_machine.addEventListener(MouseEvent.MOUSE_OVER, menu_over);
shop.btn_buy_machine.addEventListener(MouseEvent.MOUSE_OUT, menu_out);
shop.btn_buy_machine_ammo.addEventListener(MouseEvent.MOUSE_DOWN, buy_machine_ammo);
shop.btn_buy_machine_ammo.addEventListener(MouseEvent.MOUSE_OVER, menu_over);
shop.btn_buy_machine_ammo.addEventListener(MouseEvent.MOUSE_OUT, menu_out);
shop.btn_buy_rifle_ammo.addEventListener(MouseEvent.MOUSE_DOWN, buy_rifle_ammo);
shop.btn_buy_rifle_ammo.addEventListener(MouseEvent.MOUSE_OVER, menu_over);
shop.btn_buy_rifle_ammo.addEventListener(MouseEvent.MOUSE_OUT, menu_out);
shop.btn_buy_uzi_ammo.addEventListener(MouseEvent.MOUSE_DOWN, buy_uzi_ammo);
shop.btn_buy_uzi_ammo.addEventListener(MouseEvent.MOUSE_OVER, menu_over);
shop.btn_buy_uzi_ammo.addEventListener(MouseEvent.MOUSE_OUT, menu_out);
shop_render();
}
private function herou_fire():void{
var _local1:Object;
var _local2:Robot;
var _local3:Boss;
if (((herou_stat.fire) && ((reload_flag == false)))){
if (gun.ready){
if (herou_stat.bullets > 0){
herou_stat.bullets--;
panel_weapon_text();
gun.gotoAndPlay("go");
_local1 = view.getObjectUnderPoint(Stat.PRICEL);
if (_local1 != null){
if (ObjectUtils.getClassName(_local1) == "Face"){
_local1 = Face(_local1);
if (_local1.mesh.name == "enemy"){
_local2 = Robot(_local1.mesh.parent);
_local2.damage(herou_stat.damage);
if (_local2.life < 0){
if (!_local2.deaded){
_local2.dead();
};
_local2.deaded = true;
panel.boom_mc.gotoAndPlay(2);
};
} else {
if (_local1.mesh.name == "boss"){
_local3 = Boss(_local1.mesh.parent);
if (!_local3.deaded){
_local3.dead();
};
_local3.deaded = true;
panel.boom_mc.gotoAndPlay(2);
};
};
};
};
} else {
if ((((herou_stat.ammo > 0)) && ((reload_flag == false)))){
herou_stat.bullets = herou_stat.full_bullets;
if (herou_stat.weapon_tip != "gun"){
herou_stat.ammo--;
};
gun.gotoAndPlay("reload");
panel_weapon_text();
};
};
};
};
}
private function buy_rifle_ammo(_arg1:MouseEvent=null):void{
if (herou_stat.weapon.rifle_ammo < 9){
herou_stat.points = (herou_stat.points - 150);
herou_stat.weapon.rifle_ammo++;
shop_render();
};
}
private function errorAction():void{
trace("YORE CODE AFTER ERROR ACTION");
this.removeChild(this.submiter);
this.end_level();
}
private function buy_uzi_ammo(_arg1:MouseEvent=null):void{
if (herou_stat.weapon.uzi_ammo < 9){
herou_stat.points = (herou_stat.points - 50);
herou_stat.weapon.uzi_ammo++;
shop_render();
};
}
private function key_rotation():void{
if (camera.rotationX > (ROTAT + 0.2)){
camera.rotationX = (ROTAT + 0.2);
} else {
if (camera.rotationX < (ROTAT - 0.2)){
camera.rotationX = (ROTAT - 0.2);
};
};
if (keyRotation.rotat){
temp_rotation++;
if (temp_rotation > 40){
temp_rotation = 40;
};
controller.yawSpeed = (1.5 + (temp_rotation / 60));
};
if (!keyRotation.rotat){
temp_rotation = 1;
controller.yawSpeed = 1.5;
};
}
private function submitAction():void{
trace("YORE CODE AFTER SUBMIT ACTION");
try {
this.removeChild(this.submiter);
} catch(e:Error) {
};
this.end_level();
}
private function herou_damage(_arg1:Number):void{
if (herou_stat.live){
blood.gotoAndPlay("go");
panel.damage_mc.gotoAndPlay("go");
herou_stat.life = (herou_stat.life - _arg1);
if (level_scores[room.map_level] == undefined){
level_scores[room.map_level] = 0;
};
level_scores[room.map_level] = (level_scores[room.map_level] + _arg1);
blood_see();
if (boomdrag.fase == "end"){
boomdrag = new BoomDrag(this);
};
if (herou_stat.life < 1){
herou_stat.life = 0;
herou_stat.live = false;
blood.gotoAndPlay("end");
controller.enabled = false;
gun.gotoAndStop("dead");
camera.rotationX = -(MathUtils.DEG60);
camera.z = 1;
stage.removeEventListener(KeyboardEvent.KEY_UP, key_up);
stage.removeEventListener(KeyboardEvent.KEY_DOWN, key_down);
removeEventListener(Event.ENTER_FRAME, onEnterFramed);
gameover = new SubmitClip();
gameover.x = Stat.MAIN_WIDTH_CENTER;
gameover.y = ((Stat.MAIN_HEIGTH - Stat.INFO_HEIGTH) / 2);
gameover.btn_restart.gotoAndStop(1);
gameover.z1.mouseChildren = false;
gameover.z1.mouseEnabled = false;
gameover.btn_restart.addEventListener(MouseEvent.MOUSE_DOWN, game_restart);
gameover.btn_restart.addEventListener(MouseEvent.MOUSE_OVER, menu_over);
gameover.btn_restart.addEventListener(MouseEvent.MOUSE_OUT, menu_out);
gameover.btn_submit.addEventListener(MouseEvent.MOUSE_DOWN, submitUp2);
gameover.btn_submit.addEventListener(MouseEvent.MOUSE_OVER, menu_over);
gameover.btn_submit.addEventListener(MouseEvent.MOUSE_OUT, menu_out);
gameover.btn_other.addEventListener(MouseEvent.MOUSE_DOWN, game_other);
gameover.btn_other.addEventListener(MouseEvent.MOUSE_OVER, menu_over);
gameover.btn_other.addEventListener(MouseEvent.MOUSE_OUT, menu_out);
gameover.btn_mainmenu.addEventListener(MouseEvent.MOUSE_DOWN, mainMenuUp);
gameover.btn_mainmenu.addEventListener(MouseEvent.MOUSE_OVER, menu_over);
gameover.btn_mainmenu.addEventListener(MouseEvent.MOUSE_OUT, menu_out);
addChild(gameover);
};
};
}
private function mainMenuUp(_arg1:Event):void{
this.end_level();
}
private function key_up(_arg1:KeyboardEvent):void{
if (_arg1.keyCode == KeyboardUtils.LEFT){
keyRotation.rotat = false;
} else {
if (_arg1.keyCode == KeyboardUtils.RIGHT){
keyRotation.rotat = false;
};
};
if (_arg1.keyCode == KeyboardUtils.SPACE){
herou_stat.fire = false;
gun.gotoAndStop("stop");
};
}
private function menu_out(_arg1:MouseEvent=null):void{
_arg1.currentTarget.gotoAndStop(1);
}
private function key_down(_arg1:KeyboardEvent):void{
if (_arg1.keyCode == KeyboardUtils.NUMBER_1){
if ((((herou_stat.weapon.gun == true)) && (!((herou_stat.weapon_tip == "gun"))))){
block_gun.removeChild(gun);
gun.gotoAndStop("stop");
gun = new WeaponGun();
gun.cacheAsBitmap = true;
block_gun.addChild(gun);
gun.gotoAndPlay("start");
herou_stat.weapon.weapon_change(herou_stat, "gun");
panel_weapon_text();
panel.weapon.gotoAndStop(1);
};
} else {
if (_arg1.keyCode == KeyboardUtils.NUMBER_2){
if ((((herou_stat.weapon.uzi == true)) && (!((herou_stat.weapon_tip == "uzi"))))){
block_gun.removeChild(gun);
gun.gotoAndStop("stop");
gun = new WeaponUzi();
gun.cacheAsBitmap = true;
block_gun.addChild(gun);
gun.gotoAndPlay("start");
herou_stat.weapon.weapon_change(herou_stat, "uzi");
panel_weapon_text();
panel.weapon.gotoAndStop(2);
};
} else {
if (_arg1.keyCode == KeyboardUtils.NUMBER_3){
if ((((herou_stat.weapon.rifle == true)) && (!((herou_stat.weapon_tip == "rifle"))))){
block_gun.removeChild(gun);
gun.gotoAndStop("stop");
gun = new WeaponRifle();
gun.cacheAsBitmap = true;
block_gun.addChild(gun);
gun.gotoAndPlay("start");
herou_stat.weapon.weapon_change(herou_stat, "rifle");
panel_weapon_text();
panel.weapon.gotoAndStop(3);
};
} else {
if (_arg1.keyCode == KeyboardUtils.NUMBER_4){
if ((((herou_stat.weapon.machine == true)) && (!((herou_stat.weapon_tip == "machine"))))){
block_gun.removeChild(gun);
gun.gotoAndStop("stop");
gun = new WeaponMachine();
gun.cacheAsBitmap = true;
block_gun.addChild(gun);
gun.gotoAndPlay("start");
herou_stat.weapon.weapon_change(herou_stat, "machine");
panel_weapon_text();
panel.weapon.gotoAndStop(4);
};
};
};
};
};
if (_arg1.keyCode == KeyboardUtils.LEFT){
keyRotation.rotat = true;
} else {
if (_arg1.keyCode == KeyboardUtils.RIGHT){
keyRotation.rotat = true;
};
};
if (_arg1.keyCode == KeyboardUtils.SPACE){
herou_stat.fire = true;
};
if (_arg1.keyCode == KeyboardUtils.N){
if (stage.quality == "HIGH"){
stage.quality = "MEDIUM";
} else {
if (stage.quality == "MEDIUM"){
stage.quality = "lOW";
} else {
stage.quality = "HIGH";
};
};
panel.txt_qulity.text = ("QUALITY " + stage.quality);
} else {
if (_arg1.keyCode == KeyboardUtils.M){
if (soundManager.volume == 0){
soundManager.volume = 1;
soundManager.song_start();
} else {
soundManager.volume = 0;
soundManager.song_stop();
};
} else {
if (_arg1.keyCode == KeyboardUtils.P){
removeEventListener(Event.ENTER_FRAME, onEnterFramed);
stage.removeEventListener(KeyboardEvent.KEY_DOWN, key_down);
controller.enabled = false;
pause();
};
};
};
if (_arg1.keyCode == KeyboardUtils.R){
if (herou_stat.ammo > 0){
herou_stat.bullets = herou_stat.full_bullets;
if (herou_stat.weapon_tip != "gun"){
herou_stat.ammo--;
};
gun.gotoAndPlay("reload");
panel_weapon_text();
};
};
}
private function game_other(_arg1:Event):void{
GamezheroApi.linkMoreGames();
}
private function boss_life():void{
if (room.boss != null){
if (room.boss.deaded){
room.boss.boom_move();
if (room.boss.destroy){
if (kongregate.connected){
kongregate.stats.submit("Free the colony on Mars", 1);
};
win_flag = true;
end_level(true);
};
};
};
}
private function blood_see():void{
if (herou_stat.life < (herou_stat.full_life * 0.25)){
soundManager.song_play("hard");
soundManager.free_play();
camera_fov_limit = 2.9;
bloodlife.gotoAndStop(4);
panel.face.gotoAndStop(3);
} else {
if (herou_stat.life < (herou_stat.full_life * 0.5)){
soundManager.song_play("hard");
soundManager.free_stop();
camera_fov_limit = 1.6;
bloodlife.gotoAndStop(3);
panel.face.gotoAndStop(2);
} else {
if (herou_stat.life < (herou_stat.full_life * 0.75)){
soundManager.song_play("easy");
soundManager.free_stop();
camera_fov_limit = 1.6;
bloodlife.gotoAndStop(2);
panel.face.gotoAndStop(2);
} else {
bloodlife.gotoAndStop(0);
camera_fov_limit = 1.6;
soundManager.song_play("easy");
soundManager.free_stop();
panel.face.gotoAndStop(1);
};
};
};
}
private function buy_machine(_arg1:MouseEvent=null):void{
herou_stat.points = (herou_stat.points - 8000);
herou_stat.weapon.machine = true;
shop.btn_buy_machine_ammo.addEventListener(MouseEvent.MOUSE_DOWN, buy_machine_ammo);
shop.btn_buy_machine_ammo.addEventListener(MouseEvent.MOUSE_OVER, menu_over);
shop.btn_buy_machine_ammo.addEventListener(MouseEvent.MOUSE_OUT, menu_out);
shop.btn_buy_machine_ammo.alpha = 1;
shop_render();
}
private function robot_life():void{
var _local1:Robot;
var _local2:String;
for (_local2 in room.robot_array) {
_local1 = Robot(room.robot_array[_local2]);
if (_local1.deaded){
_local1.boom_move();
if (_local1.destroy){
delete room.robot_array[_local2];
room.removeChild(_local1);
robot_kol--;
};
} else {
if (_local1.reds){
_local1.red_kol++;
};
if (_local1.red_kol > 3){
_local1.grey();
};
_local1.place_robot.x = Math.floor(((_local1.coords.x + (Stat.TILE_LENGTH / 2)) / Stat.TILE_LENGTH));
_local1.place_robot.y = Math.floor(((_local1.coords.y + (Stat.TILE_LENGTH / 2)) / Stat.TILE_LENGTH));
if (_local1.see(herou_stat.place_unit, _local1.place_robot)){
if (((_local1.rotated(camera.coords)) && (_local1.rotated_hand(true)))){
if (_local1.fire(true)){
robot_fire(_local1);
};
};
} else {
_local1.rotated_hand(false);
_local1.fire(false);
if (_local1.rotated(_local1.go_coords)){
_local1.moved();
};
};
};
};
}
private function menu_over(_arg1:MouseEvent=null):void{
_arg1.currentTarget.gotoAndStop(2);
}
private function panel_weapon_text():void{
var _local1:String = String(herou_stat.ammo);
if (herou_stat.weapon_tip == "gun"){
_local1 = "-";
};
panel.txt_weapon1.text = String(herou_stat.bullets);
panel.txt_weapon2.text = String(herou_stat.full_bullets);
panel.txt_weapon3.text = _local1;
}
private function submitUp2(_arg1:Event=null):void{
gameover.z1.play();
gameover.btn_restart.removeEventListener(MouseEvent.MOUSE_DOWN, game_restart);
gameover.btn_restart.removeEventListener(MouseEvent.MOUSE_OVER, menu_over);
gameover.btn_restart.removeEventListener(MouseEvent.MOUSE_OUT, menu_out);
gameover.btn_submit.removeEventListener(MouseEvent.MOUSE_DOWN, submitUp2);
gameover.btn_submit.removeEventListener(MouseEvent.MOUSE_OVER, menu_over);
gameover.btn_submit.removeEventListener(MouseEvent.MOUSE_OUT, menu_out);
gameover.btn_other.removeEventListener(MouseEvent.MOUSE_DOWN, game_other);
gameover.btn_other.removeEventListener(MouseEvent.MOUSE_OVER, menu_over);
gameover.btn_other.removeEventListener(MouseEvent.MOUSE_OUT, menu_out);
gameover.btn_mainmenu.removeEventListener(MouseEvent.MOUSE_DOWN, mainMenuUp);
gameover.btn_mainmenu.removeEventListener(MouseEvent.MOUSE_OVER, menu_over);
gameover.btn_mainmenu.removeEventListener(MouseEvent.MOUSE_OUT, menu_out);
submitUp();
}
private function init_game(_arg1:Event):void{
boomdrag = new BoomDrag(this, 0);
init();
}
private function game_restart(_arg1:MouseEvent=null):void{
level_scores[room.map_level] = 0;
gameover.btn_restart.removeEventListener(MouseEvent.MOUSE_DOWN, game_restart);
gameover.btn_restart.removeEventListener(MouseEvent.MOUSE_OVER, menu_over);
gameover.btn_restart.removeEventListener(MouseEvent.MOUSE_OUT, menu_out);
controller.coords = new Point3D((room.start_point.x * Stat.TILE_LENGTH), (room.start_point.y * Stat.TILE_LENGTH), 60);
herou_stat.place_unit = room.start_point;
herou.coords = camera.coords;
herou_stat.live = true;
blood.gotoAndStop(1);
controller.enabled = true;
gun.gotoAndStop("stop");
stage.addEventListener(KeyboardEvent.KEY_UP, key_up);
stage.addEventListener(KeyboardEvent.KEY_DOWN, key_down);
addEventListener(Event.ENTER_FRAME, onEnterFramed);
next_level();
removeChild(gameover);
}
private function buy_rifle(_arg1:MouseEvent=null):void{
herou_stat.points = (herou_stat.points - 4500);
herou_stat.weapon.rifle = true;
shop.btn_buy_rifle_ammo.addEventListener(MouseEvent.MOUSE_DOWN, buy_rifle_ammo);
shop.btn_buy_rifle_ammo.addEventListener(MouseEvent.MOUSE_OVER, menu_over);
shop.btn_buy_rifle_ammo.addEventListener(MouseEvent.MOUSE_OUT, menu_out);
shop.btn_buy_rifle_ammo.alpha = 1;
shop_render();
}
private function place_unit_controll():void{
herou_stat.place_unit.x = Math.floor(((controller.coords.x + (Stat.TILE_LENGTH / 2)) / Stat.TILE_LENGTH));
herou_stat.place_unit.y = Math.floor(((controller.coords.y + (Stat.TILE_LENGTH / 2)) / Stat.TILE_LENGTH));
}
private function submitUp(_arg1:Event=null):void{
var _local4:*;
var _local7:Number;
this.addChild(this.submiter);
soundManager.song_stop();
soundManager.free_stop();
var _local2:Number = (((room.map_level * 1000) + (Math.round((Math.random() * 10)) * 100)) + (Math.round((Math.random() * 10)) * 10));
_local2 = 0;
var _local3:uint;
for (_local4 in level_scores) {
_local7 = ((1000 + (100 * _local3)) - level_scores[_local4]);
if (_local7 < 0){
_local7 = 0;
};
_local2 = (_local2 + _local7);
_local3++;
};
if (win_flag == false){
_local7 = ((1000 + (100 * (_local3 - 1))) - level_scores[_local4]);
_local2 = (_local2 - _local7);
};
_local2 = (_local2 * level_diff);
if (_local2 < 0){
_local2 = 0;
};
_local2 = (_local2 * level_diff);
var _local5 = "154154157158223156153214208089146153160215172149147165170147207167172168216214166159195212216159149162151151151";
var _local6:Object = {border:{width:4, color:0xFFFFFF, alpha:100}, background:{topColor:0x999999, bottomColor:0x666666, topAlpha:100, bottomAlpha:100, cornerRadius:10}, language:"ENG"};
GamezheroApi.score(this.submiter, _local5, _local2, 120, 50, submitAction, mainMenuAction, errorAction, _local6);
}
private function endMenu(_arg1:MouseEvent=null):void{
soundManager.song_stop();
end.btn_restart.removeEventListener(MouseEvent.MOUSE_DOWN, endMenu);
end.btn_restart.removeEventListener(MouseEvent.MOUSE_OVER, menu_over);
end.btn_restart.removeEventListener(MouseEvent.MOUSE_OUT, menu_out);
removeChild(end);
end = null;
papa.menu_restart();
}
private function buy_machine_ammo(_arg1:MouseEvent=null):void{
if (herou_stat.weapon.machine_ammo < 9){
herou_stat.points = (herou_stat.points - 300);
herou_stat.weapon.machine_ammo++;
shop_render();
};
}
private function room_clear():void{
herou_stat.weapon.save_ammo(herou_stat);
var _local1:Number = ((room.map_level * 10) + (Math.round((Math.random() * 10)) * 10));
var _local2:Number = (room.robot_array.length * 150);
var _local3:Number = (_local1 + _local2);
herou_stat.points = (herou_stat.points + _local3);
removeEventListener(Event.ENTER_FRAME, onEnterFramed);
stage.removeEventListener(KeyboardEvent.KEY_UP, key_up);
stage.removeEventListener(KeyboardEvent.KEY_DOWN, key_down);
roomClearClip = new ClearRoomClip();
roomClearClip.x = Stat.MAIN_WIDTH_CENTER;
roomClearClip.y = ((Stat.MAIN_HEIGTH - Stat.INFO_HEIGTH) / 2);
roomClearClip.level_bonus.text = ("+" + _local1);
roomClearClip.kill_robots_bonus.text = ("+" + _local2);
roomClearClip.total_bonus.text = ("+" + _local3);
addChild(roomClearClip);
roomClearClip.btn_ok.addEventListener(MouseEvent.MOUSE_DOWN, new_level);
roomClearClip.btn_ok.addEventListener(MouseEvent.MOUSE_OVER, menu_over);
roomClearClip.btn_ok.addEventListener(MouseEvent.MOUSE_OUT, menu_out);
roomClearClip.btn_shop.addEventListener(MouseEvent.MOUSE_DOWN, shop_tur);
roomClearClip.btn_shop.addEventListener(MouseEvent.MOUSE_OVER, menu_over);
roomClearClip.btn_shop.addEventListener(MouseEvent.MOUSE_OUT, menu_out);
}
private function robot_fire(_arg1:Robot):void{
var _local2:Fire_robot = new Fire_robot(_arg1.tip, level_diff);
var _local3:Point3D = new Point3D();
_local3.x = _arg1.fire_right.x;
_local3.y = _arg1.fire_right.y;
_local3.z = _arg1.fire_right.z;
var _local4:Point3D = _arg1.coords;
var _local5:Point3D = new Point3D(0, 0, 1);
var _local6:Matrix3D = Matrix3D.axisAngleToMatrix(_local5, _arg1.rotationZ);
_local3.transform(_local6);
_local3.x = (_local3.x + _local4.x);
_local3.y = (_local3.y + _local4.y);
_local3.z = (_local3.z + _local4.z);
room.addChild(_local2);
_local2.coords = _local3;
_local2.angle = Math.atan2((camera.y - _local2.y), (camera.x - _local2.x));
fire_array.push(_local2);
_local2 = new Fire_robot(_arg1.tip, level_diff);
_local3.x = _arg1.fire_left.x;
_local3.y = _arg1.fire_left.y;
_local3.z = _arg1.fire_left.z;
_local3.transform(_local6);
_local3.x = (_local3.x + _local4.x);
_local3.y = (_local3.y + _local4.y);
_local3.z = (_local3.z + _local4.z);
room.addChild(_local2);
_local2.coords = _local3;
_local2.angle = Math.atan2((camera.y - _local2.y), (camera.x - _local2.x));
fire_array.push(_local2);
}
private function init_controll():void{
controller = new WalkController(stage);
controller.setDefaultBindings();
controller.pitchSpeed = 0.15;
controller.unbindKey(KeyboardUtils.SPACE);
controller.object = camera;
controller.checkCollisions = true;
controller.mouseEnabled = false;
controller.speed = 200;
controller.jumpSpeed = 600;
controller.gravity = 1000;
controller.objectZPosition = 0.95;
controller.maxGroundAngle = MathUtils.toRadian(30);
controller.speedMultiplier = 1.5;
controller.coords = new Point3D((room.start_point.x * Stat.TILE_LENGTH), (room.start_point.y * Stat.TILE_LENGTH), 60);
controller.collider.offsetThreshold = 0.01;
controller.collider.radiusX = (Stat.HEROU_WIDTH / 2);
controller.collider.radiusY = (Stat.HEROU_LENGTH / 2);
controller.collider.radiusZ = (Stat.HEROU_HEIGTH / 2);
herou_stat.place_unit = room.start_point;
herou = new Box(Stat.HEROU_WIDTH, Stat.HEROU_LENGTH, Stat.HEROU_HEIGTH, 1, 1, 1, true);
herou.name = "herou";
herou.mobility = 10007;
herou.coords = camera.coords;
scene.root.addChild(herou);
}
private function shop_render():void{
shop.txt_points.text = String(herou_stat.points);
shop.txt_ammo_uzi.text = (String(herou_stat.weapon.uzi_ammo) + "/9");
shop.txt_ammo_rifle.text = (String(herou_stat.weapon.rifle_ammo) + "/9");
shop.txt_ammo_machine.text = (String(herou_stat.weapon.machine_ammo) + "/9");
if (herou_stat.weapon.uzi){
shop.weapon_uzi.gotoAndStop(2);
shop.btn_buy_uzi.enabled = false;
shop.btn_buy_uzi.alpha = 0.3;
};
if (herou_stat.weapon.rifle){
shop.weapon_rifle.gotoAndStop(2);
};
if (herou_stat.weapon.machine){
shop.weapon_machine.gotoAndStop(2);
};
if (herou_stat.points < 8000){
shop.btn_buy_machine.alpha = 0.3;
shop.btn_buy_machine.removeEventListener(MouseEvent.MOUSE_DOWN, buy_machine);
shop.btn_buy_machine.removeEventListener(MouseEvent.MOUSE_OVER, menu_over);
shop.btn_buy_machine.removeEventListener(MouseEvent.MOUSE_OUT, menu_out);
};
if (herou_stat.points < 4500){
shop.btn_buy_rifle.alpha = 0.3;
shop.btn_buy_rifle.removeEventListener(MouseEvent.MOUSE_DOWN, buy_rifle);
shop.btn_buy_rifle.removeEventListener(MouseEvent.MOUSE_OVER, menu_over);
shop.btn_buy_rifle.removeEventListener(MouseEvent.MOUSE_OUT, menu_out);
};
if (herou_stat.points < 1200){
shop.btn_buy_uzi.alpha = 0.3;
shop.btn_buy_uzi.removeEventListener(MouseEvent.MOUSE_DOWN, buy_uzi);
shop.btn_buy_uzi.removeEventListener(MouseEvent.MOUSE_OVER, menu_over);
shop.btn_buy_uzi.removeEventListener(MouseEvent.MOUSE_OUT, menu_out);
};
if ((((herou_stat.points < 300)) || (!(herou_stat.weapon.machine)))){
shop.btn_buy_machine_ammo.alpha = 0.3;
shop.btn_buy_machine_ammo.removeEventListener(MouseEvent.MOUSE_DOWN, buy_machine_ammo);
shop.btn_buy_machine_ammo.removeEventListener(MouseEvent.MOUSE_OVER, menu_over);
shop.btn_buy_machine_ammo.removeEventListener(MouseEvent.MOUSE_OUT, menu_out);
};
if ((((herou_stat.points < 150)) || (!(herou_stat.weapon.rifle)))){
shop.btn_buy_rifle_ammo.alpha = 0.3;
shop.btn_buy_rifle_ammo.removeEventListener(MouseEvent.MOUSE_DOWN, buy_rifle_ammo);
shop.btn_buy_rifle_ammo.removeEventListener(MouseEvent.MOUSE_OVER, menu_over);
shop.btn_buy_rifle_ammo.removeEventListener(MouseEvent.MOUSE_OUT, menu_out);
};
if ((((herou_stat.points < 50)) || (!(herou_stat.weapon.uzi)))){
shop.btn_buy_uzi_ammo.alpha = 0.3;
shop.btn_buy_uzi_ammo.removeEventListener(MouseEvent.MOUSE_DOWN, buy_uzi_ammo);
shop.btn_buy_uzi_ammo.removeEventListener(MouseEvent.MOUSE_OVER, menu_over);
shop.btn_buy_uzi_ammo.removeEventListener(MouseEvent.MOUSE_OUT, menu_out);
};
}
}
}//package main.game
Section 175
//Herou_stat (main.game.Herou_stat)
package main.game {
import flash.geom.*;
public class Herou_stat {
public var full_bullets:Number;// = 10
public var life:Number;// = 100
public var ammo:Number;// = 9
public var points:Number;// = 0
public var weapon:Weapon;
public var live:Boolean;// = true
public var damage:Number;// = 6
public var bullets:Number;// = 10
public var full_life:Number;// = 100
public var fire:Boolean;// = false
public var weapon_tip:String;// = "gun"
public var place_unit:Point;
public function Herou_stat(){
place_unit = new Point();
weapon = new Weapon();
super();
}
}
}//package main.game
Section 176
//Oskolok_move (main.game.Oskolok_move)
package main.game {
import alternativa.engine3d.core.*;
public class Oskolok_move {
public var vector_x:Number;
public var mesh:Object3D;
public var vector_y:Number;
public var vector_z:Number;
public function Oskolok_move(_arg1:Object3D){
mesh = _arg1;
vector_x = (((Math.random() * 2) - 1) * ((Math.random() * 2) + 4));
vector_y = (((Math.random() * 2) - 1) * ((Math.random() * 2) + 4));
vector_z = (((Math.random() * 1.2) - 0.2) * ((Math.random() * 2) + 4));
}
}
}//package main.game
Section 177
//Robot (main.game.Robot)
package main.game {
import alternativa.engine3d.core.*;
import alternativa.types.*;
import flash.geom.*;
import alternativa.engine3d.primitives.*;
import alternativa.utils.*;
import main.*;
public class Robot extends Mesh {
private var speed_x:Boolean;// = true
private var speed_y:Boolean;// = true
public var deaded:Boolean;// = false
private var boom_array:Array;
public var reds:Boolean;// = false
private var robot_head:Box;
public var tip:String;
private var robot_hender_left:Plane;
public var place_robot:Point;
private var robot_hender_right:Plane;
private var robot_hend_left:Box;
private var robot_hend_right:Box;
private var see_eys:Number;// = 5
public var go_coords:Point3D;
private var robot_body:RobotBody;
private var robot_legs:RobotLegs;
public var red_kol:Number;// = 0
private var robot_eys:Plane;
public var fire_right:Point3D;
private var step_goto:Number;// = 1
public var fire_left:Point3D;
public var destroy:Boolean;// = false
public var life:Number;
public var goto_array:Array;
public function Robot(_arg1:String, _arg2:Number){
var _local3:Box;
var _local4:Plane;
boom_array = new Array();
place_robot = new Point();
goto_array = new Array();
super();
tip = _arg1;
if (tip == null){
tip = "robot_easy";
};
fire_right = new Point3D((Stat.ROBOT_HEND_X + 40), Stat.ROBOT_HEND_RIGHT_Y, Stat.ROBOT_HEND_Z);
fire_left = new Point3D((Stat.ROBOT_HEND_X + 40), Stat.ROBOT_HEND_LEFT_Y, Stat.ROBOT_HEND_Z);
robot_body = new RobotBody();
robot_body.mobility = 1002;
robot_body.name = "enemy";
robot_legs = new RobotLegs();
robot_legs.mobility = 1001;
robot_legs.name = "enemy";
if (tip == "robot_easy"){
life = (_arg2 * 50);
robot_head = new Box(20, 25, 20, 1, 1, 1, false, false);
robot_head.z = 61;
robot_eys = new Plane(3, 6);
_local4 = new Plane(3, 6);
_local4.y = 12;
_local4.mobility = 1003;
_local4.cloneMaterialToAllSurfaces(Stat.MATERIALxFF0000_0);
robot_eys.addChild(_local4);
robot_eys.z = 60;
robot_eys.x = 10.1;
robot_eys.y = -6;
robot_eys.rotationY = MathUtils.DEG90;
robot_hend_right = new Box(70, 10, 20);
robot_hend_right.y = Stat.ROBOT_HEND_RIGHT_Y;
robot_hend_left = new Box(70, 10, 20);
robot_hend_left.y = Stat.ROBOT_HEND_LEFT_Y;
robot_hend_left.x = Stat.ROBOT_HEND_X;
robot_hend_right.x = Stat.ROBOT_HEND_X;
robot_hender_right = new Plane(14, 6);
robot_hender_right.rotationY = MathUtils.DEG90;
robot_hender_right.x = 35.1;
robot_hender_right.y = 0;
robot_hender_right.z = 0;
robot_hender_left = new Plane(14, 6);
robot_hender_left.rotationY = MathUtils.DEG90;
robot_hender_left.x = 35.1;
robot_hender_left.y = 0;
robot_hender_left.z = 0;
robot_hender_right.name = "enemy_hender";
robot_hender_right.mobility = 1004;
robot_hender_left.name = "enemy_hender";
robot_hender_left.mobility = 1004;
robot_hend_right.addChild(robot_hender_right);
robot_hend_left.addChild(robot_hender_left);
robot_hender_right.cloneMaterialToAllSurfaces(Stat.MATERIALx111111_0);
robot_hender_left.cloneMaterialToAllSurfaces(Stat.MATERIALx111111_0);
} else {
if (tip == "robot_normal"){
life = (50 + (_arg2 * 100));
robot_head = new Box(20, 20, 10);
robot_head.mobility = 1003;
robot_head.z = 62.1;
_local3 = new Box(5, 5, 6);
_local3.z = -8;
_local3.mobility = 1004;
_local3.cloneMaterialToAllSurfaces(new BoxMaterial("Metall2"));
robot_head.addChild(_local3);
robot_eys = new Plane(2, 15);
robot_eys.z = 63;
robot_eys.x = 10.1;
robot_eys.y = 0;
robot_eys.rotationY = MathUtils.DEG90;
robot_hend_right = new Box(70, 20, 20);
robot_hend_left = new Box(70, 20, 20);
robot_hend_right.y = (Stat.ROBOT_HEND_RIGHT_Y + 8);
robot_hend_left.y = (Stat.ROBOT_HEND_LEFT_Y - 8);
robot_hend_right.rotationX = MathUtils.DEG45;
robot_hend_left.rotationX = MathUtils.DEG45;
robot_hend_left.x = Stat.ROBOT_HEND_X;
robot_hend_right.x = Stat.ROBOT_HEND_X;
robot_hender_right = new Plane(14, 14);
robot_hender_right.rotationY = MathUtils.DEG90;
robot_hender_right.x = 35.1;
robot_hender_right.y = 0;
robot_hender_right.z = 0;
robot_hender_left = new Plane(14, 14);
robot_hender_left.rotationY = MathUtils.DEG90;
robot_hender_left.x = 35.1;
robot_hender_left.y = 0;
robot_hender_left.z = 0;
robot_hender_right.name = "enemy_hender";
robot_hender_right.mobility = 1004;
robot_hender_left.name = "enemy_hender";
robot_hender_left.mobility = 1004;
robot_hend_right.addChild(robot_hender_right);
robot_hend_left.addChild(robot_hender_left);
robot_hender_right.cloneMaterialToAllSurfaces(Stat.MATERIALx111111_0);
robot_hender_left.cloneMaterialToAllSurfaces(Stat.MATERIALx111111_0);
} else {
life = (100 + (_arg2 * 150));
robot_head = new Box(20, 20, 20);
robot_head.rotationX = MathUtils.DEG45;
robot_head.z = 63;
robot_eys = new Plane(12, 12);
robot_eys.z = 63;
robot_eys.x = 10.1;
robot_eys.rotationY = MathUtils.DEG90;
robot_hend_right = new Box(40, 30, 30);
robot_hend_right.y = 55.1;
robot_hend_right.x = (Stat.ROBOT_HEND_X - 20);
_local3 = new Box(20, 20, 20);
_local3.x = 30.1;
_local3.mobility = 1004;
_local3.cloneMaterialToAllSurfaces(Stat.MATERIALx111111_0);
robot_hend_right.addChild(_local3);
robot_hend_left = new Box(40, 30, 30);
robot_hend_left.y = -55.1;
robot_hend_left.x = (Stat.ROBOT_HEND_X - 20);
_local3 = new Box(20, 20, 20);
_local3.x = 30.1;
_local3.mobility = 1004;
_local3.cloneMaterialToAllSurfaces(Stat.MATERIALx111111_0);
robot_hend_left.addChild(_local3);
};
};
robot_eys.cloneMaterialToAllSurfaces(Stat.MATERIALxFF0000_0);
robot_hend_right.cloneMaterialToAllSurfaces(new BoxMaterial("Metall5"));
robot_hend_left.cloneMaterialToAllSurfaces(new BoxMaterial("Metall5"));
robot_legs.cloneMaterialToAllSurfaces(new BoxMaterial("Metall2"));
robot_head.cloneMaterialToAllSurfaces(new BoxMaterial("Metall1"));
robot_body.cloneMaterialToAllSurfaces(new BoxMaterial("Metall4"));
robot_head.name = "enemy";
robot_head.mobility = 1003;
robot_eys.name = "enemy";
robot_eys.mobility = 1004;
robot_hend_right.name = "enemy";
robot_hend_right.mobility = 1003;
robot_hend_right.z = Stat.ROBOT_HEND_Z;
robot_hend_left.name = "enemy";
robot_hend_left.mobility = 1003;
robot_hend_left.z = Stat.ROBOT_HEND_Z;
addChild(robot_body);
addChild(robot_legs);
addChild(robot_head);
addChild(robot_eys);
addChild(robot_hend_right);
addChild(robot_hend_left);
}
public function rotated_hand(_arg1:Boolean):Boolean{
if (_arg1){
if (robot_hend_left.rotationY < Stat.ROBOT_UP_HANDS_RADIAN){
robot_hend_left.rotationY = (robot_hend_left.rotationY + Stat.ROBOT_ROTATE_HANDS_RADIAN);
robot_hend_right.rotationY = (robot_hend_right.rotationY + Stat.ROBOT_ROTATE_HANDS_RADIAN);
} else {
return (true);
};
} else {
if (robot_hend_left.rotationY > Stat.ROBOT_DOWN_HANDS_RADIAN){
robot_hend_left.rotationY = (robot_hend_left.rotationY - Stat.ROBOT_ROTATE_HANDS_RADIAN);
robot_hend_right.rotationY = (robot_hend_right.rotationY - Stat.ROBOT_ROTATE_HANDS_RADIAN);
};
};
return (false);
}
private function red():void{
this.reds = true;
robot_legs.cloneMaterialToAllSurfaces(new BoxMaterial("Metall2Red"));
robot_head.cloneMaterialToAllSurfaces(new BoxMaterial("Metall1Red"));
robot_body.cloneMaterialToAllSurfaces(new BoxMaterial("Metall4Red"));
}
public function boom_move():void{
var _local1:Object3D;
var _local2:Oskolok_move;
var _local3:String;
for (_local3 in boom_array) {
_local2 = boom_array[_local3];
_local1 = _local2.mesh;
_local2.vector_x = (_local2.vector_x * 1.1);
_local2.vector_y = (_local2.vector_y * 1.1);
_local2.vector_z = (_local2.vector_z * 1.1);
_local1.x = (_local1.x + _local2.vector_x);
_local1.y = (_local1.y + _local2.vector_y);
_local1.z = (_local1.z + _local2.vector_z);
_local1.rotationX = (_local1.rotationX + (Math.random() / 4));
_local1.rotationY = (_local1.rotationY + (Math.random() / 4));
_local1.rotationZ = (_local1.rotationZ + (Math.random() / 4));
_local1.scaleX = (_local1.scaleY = (_local1.scaleZ = (_local1.scaleZ - 0.06)));
};
if (_local1.scaleX < 0.2){
this.destroy = true;
};
}
public function moved():void{
var _local1:Number = Math.atan2((this.go_coords.y - this.y), (this.go_coords.x - this.x));
var _local2:Number = (Stat.ROBOT_MOVE_SPEED * Math.cos(_local1));
var _local3:Number = (Stat.ROBOT_MOVE_SPEED * Math.sin(_local1));
if (this.speed_x){
this.x = (this.x + _local2);
};
if (this.speed_y){
this.y = (this.y + _local3);
};
if (Math.abs((go_coords.x - this.x)) < Stat.ROBOT_MOVE_SPEED){
this.speed_x = false;
this.x = this.go_coords.x;
};
if (Math.abs((go_coords.y - this.y)) < Stat.ROBOT_MOVE_SPEED){
this.speed_y = false;
this.y = this.go_coords.y;
};
if (((!(this.speed_x)) && (!(this.speed_y)))){
this.step_goto++;
if (this.step_goto >= this.goto_array.length){
this.step_goto = 0;
};
this.go_coords.x = this.goto_array[this.step_goto].x;
this.go_coords.y = this.goto_array[this.step_goto].y;
this.speed_x = true;
this.speed_y = true;
};
}
public function fire(_arg1:Boolean):Boolean{
if (_arg1){
if (robot_hend_left.x >= 0){
robot_hend_left.x = -10;
robot_hend_right.x = -10;
return (true);
};
robot_hend_left.x = (robot_hend_left.x + 0.5);
robot_hend_right.x = (robot_hend_right.x + 0.5);
return (false);
//unresolved jump
};
if (robot_hend_left.x < 0){
robot_hend_left.x = (robot_hend_left.x + 0.5);
robot_hend_right.x = (robot_hend_right.x + 0.5);
return (true);
};
return (false);
}
public function see(_arg1:Point, _arg2:Point):Boolean{
var _local3:Boolean;
_local3 = ((_local3) && ((Math.abs((_arg1.x - _arg2.x)) < this.see_eys)));
_local3 = ((_local3) && ((Math.abs((_arg1.y - _arg2.y)) < this.see_eys)));
return (_local3);
}
public function grey():void{
this.reds = false;
this.red_kol = 0;
robot_legs.cloneMaterialToAllSurfaces(new BoxMaterial("Metall2"));
robot_head.cloneMaterialToAllSurfaces(new BoxMaterial("Metall1"));
robot_body.cloneMaterialToAllSurfaces(new BoxMaterial("Metall4"));
}
public function damage(_arg1:Number):void{
this.see_eys = Stat.ROBOT_SEE_DANGER;
this.life = (this.life - _arg1);
this.red();
}
public function rotated(_arg1:Point3D):Boolean{
var _local2:Number;
_local2 = Math.atan2((_arg1.y - this.coords.y), (_arg1.x - this.coords.x));
if (MathUtils.equals(_local2, this.rotationZ, Stat.ROBOT_ROTATE_RADIAN)){
return (true);
};
if ((((_local2 > MathUtils.DEG90)) && ((this.rotationZ < -(MathUtils.DEG90))))){
this.rotationZ = (this.rotationZ - Stat.ROBOT_ROTATE_RADIAN);
if (this.rotationZ < -(MathUtils.DEG180)){
this.rotationZ = (this.rotationZ + MathUtils.DEG360);
};
} else {
if ((((this.rotationZ > MathUtils.DEG90)) && ((_local2 < -(MathUtils.DEG90))))){
this.rotationZ = (this.rotationZ + Stat.ROBOT_ROTATE_RADIAN);
if (this.rotationZ > MathUtils.DEG180){
this.rotationZ = (this.rotationZ - MathUtils.DEG360);
};
} else {
if (_local2 < this.rotationZ){
this.rotationZ = (this.rotationZ - Stat.ROBOT_ROTATE_RADIAN);
} else {
this.rotationZ = (this.rotationZ + Stat.ROBOT_ROTATE_RADIAN);
};
};
};
return (false);
}
public function dead():void{
var _local1:Sprite3D;
var _local2:int;
removeChild(robot_eys);
robot_eys = null;
boom_array.push(new Oskolok_move(robot_body));
boom_array.push(new Oskolok_move(robot_legs));
boom_array.push(new Oskolok_move(robot_head));
boom_array.push(new Oskolok_move(robot_hend_right));
boom_array.push(new Oskolok_move(robot_hend_left));
_local2 = 0;
while (_local2 < 30) {
_local1 = new Sprite3D("boom");
_local1.mobility = 1005;
_local1.z = (Math.random() * 5);
_local1.x = (Math.random() * 5);
_local1.y = (Math.random() * 5);
_local1.material = new SpriteMaterial("Boom");
addChild(_local1);
boom_array.push(new Oskolok_move(_local1));
_local2++;
};
}
}
}//package main.game
Section 178
//Robot_init (main.game.Robot_init)
package main.game {
import flash.geom.*;
public class Robot_init {
public var go_array:Array;
public var go_point:Point;
public var tip:String;
public var name:String;
public var this_point:Point;
public function Robot_init(){
go_array = new Array();
super();
}
}
}//package main.game
Section 179
//RobotBody (main.game.RobotBody)
package main.game {
import alternativa.engine3d.core.*;
import flash.geom.*;
public class RobotBody extends Mesh {
public function RobotBody(){
createVertex(-40, -30, 0, "Vertex10");
createVertex(-40, 30, 0, "Vertex11");
createVertex(40, 30, 0, "Vertex12");
createVertex(40, -30, 0, "Vertex13");
createVertex(-10, -30, 20, "Vertex20");
createVertex(-10, 30, 20, "Vertex21");
createVertex(10, 30, 20, "Vertex22");
createVertex(10, -30, 20, "Vertex23");
var _local1:Number = 0.5;
createFace(["Vertex10", "Vertex11", "Vertex12", "Vertex13"], "Face00");
setUVsToFace(new Point(0, 0), new Point(_local1, 0), new Point(_local1, _local1), "Face00");
createFace(["Vertex10", "Vertex20", "Vertex21", "Vertex11"], "Face10");
setUVsToFace(new Point(0, 0), new Point(_local1, 0), new Point(_local1, _local1), "Face10");
createFace(["Vertex11", "Vertex21", "Vertex22", "Vertex12"], "Face20");
setUVsToFace(new Point(0, 0), new Point(_local1, 0), new Point(_local1, _local1), "Face20");
createFace(["Vertex12", "Vertex22", "Vertex23", "Vertex13"], "Face30");
setUVsToFace(new Point(0, 0), new Point(_local1, 0), new Point(_local1, _local1), "Face30");
createFace(["Vertex13", "Vertex23", "Vertex20", "Vertex10"], "Face40");
setUVsToFace(new Point(0, 0), new Point(_local1, 0), new Point(_local1, _local1), "Face40");
createSurface(["Face00", "Face10", "Face20", "Face30", "Face40"], "body");
}
}
}//package main.game
Section 180
//RobotLegs (main.game.RobotLegs)
package main.game {
import alternativa.engine3d.core.*;
import flash.geom.*;
public class RobotLegs extends Mesh {
public function RobotLegs(){
createVertex(-10, -30, 20, "Vertex20");
createVertex(-10, 30, 20, "Vertex21");
createVertex(10, 30, 20, "Vertex22");
createVertex(10, -30, 20, "Vertex23");
createVertex(-20, -40, 50, "Vertex30");
createVertex(-20, 40, 50, "Vertex31");
createVertex(20, 40, 50, "Vertex32");
createVertex(20, -40, 50, "Vertex33");
var _local1:Number = 1;
var _local2:Number = 1;
createFace(["Vertex20", "Vertex30", "Vertex31", "Vertex21"], "Face60");
setUVsToFace(new Point(0, 0), new Point(_local1, 0), new Point(_local1, _local1), "Face60");
createFace(["Vertex21", "Vertex31", "Vertex32", "Vertex22"], "Face70");
setUVsToFace(new Point(0, 0), new Point(_local1, 0), new Point(_local1, _local1), "Face70");
createFace(["Vertex22", "Vertex32", "Vertex33", "Vertex23"], "Face80");
setUVsToFace(new Point(0, 0), new Point(_local1, 0), new Point(_local1, _local1), "Face80");
createFace(["Vertex23", "Vertex33", "Vertex30", "Vertex20"], "Face90");
setUVsToFace(new Point(0, 0), new Point(_local1, 0), new Point(_local1, _local1), "Face90");
createFace(["Vertex33", "Vertex32", "Vertex31", "Vertex30"], "Face100");
setUVsToFace(new Point(0, 0), new Point(_local1, 0), new Point(_local1, _local1), "Face100");
createSurface(["Face60", "Face70", "Face80", "Face90", "Face100"], "legs");
}
}
}//package main.game
Section 181
//Room (main.game.Room)
package main.game {
import alternativa.engine3d.core.*;
import alternativa.types.*;
import flash.geom.*;
import alternativa.engine3d.primitives.*;
import main.*;
import main.game.levels.*;
public class Room extends Mesh {
private var map_block_array:Array;
private var door_point:Point;
private var level:Object;
public var tile_kol_width:Number;// = 20
public var finish_point:Point;
public var robot_array:Array;
private var plane:Plane;
public var tile_kol_heigth:Number;// = 25
private var robot_init_array:Array;
private var sky:GeoSphere;
private var wall_array:Array;
public var door_final:Door;
private var door_close:Door;
public var map_level:int;// = 10
public var boss:Boss;
private var level_diff:Number;
public var door_open_final:Door;
public var start_point:Point;
public var door_open:Door;
private var wall_material:BoxMaterial;
public function Room(_arg1:int=10, _arg2:Number=1){
wall_array = new Array();
robot_init_array = new Array();
robot_array = new Array();
super();
level_diff = _arg2;
map_level = _arg1;
level_create();
pool_create();
wall_create();
door_create();
robot_create();
}
public function clear():void{
var _local1:String;
for (_local1 in wall_array) {
this.removeChild(wall_array[_local1]);
};
for (_local1 in robot_array) {
this.removeChild(robot_array[_local1]);
};
this.removeChild(door_close);
this.removeChild(door_open);
this.removeChild(door_open_final);
this.removeChild(door_final);
}
public function boss_create():void{
boss = new Boss();
boss.name = "boss";
boss.mobility = 5;
this.addChild(boss);
}
public function wall_create():void{
var _local1:Number;
var _local2:Box;
var _local3:String;
wall_array = new Array();
for (_local3 in map_block_array) {
_local2 = new Box(Stat.TILE_LENGTH, Stat.TILE_LENGTH, Stat.TILE_LENGTH, 1, 1, 1, false, true);
_local2.mobility = 0;
_local1 = Math.floor((Math.random() * 3));
if (_local1 == 0){
_local2.cloneMaterialToAllSurfaces(new BoxMaterial("Wall_3", map_level));
} else {
if (_local1 == 1){
_local2.cloneMaterialToAllSurfaces(new BoxMaterial("Wall_2", map_level));
} else {
_local2.cloneMaterialToAllSurfaces(new BoxMaterial("Wall_1", map_level));
};
};
_local2.x = (map_block_array[_local3].x * Stat.TILE_LENGTH);
_local2.y = (map_block_array[_local3].y * Stat.TILE_LENGTH);
_local2.z = (Stat.TILE_LENGTH / 2);
_local2.name = "wall";
this.addChild(_local2);
wall_array.push(_local2);
};
}
private function pool_create():void{
var _local1:Object;
plane = new Plane((Stat.TILE_LENGTH * tile_kol_width), (Stat.TILE_LENGTH * tile_kol_heigth), 1, 1, false, false, true);
for (_local1 in plane.faces) {
plane.setUVsToFace(new Point(0, 0), new Point((tile_kol_width * 2), 0), new Point((tile_kol_width * 2), (tile_kol_heigth * 2)), plane.getFaceById(_local1));
};
plane.cloneMaterialToAllSurfaces(new BoxMaterial("Floor"));
plane.x = (((Stat.TILE_LENGTH * tile_kol_width) / 2) - (Stat.TILE_LENGTH / 2));
plane.y = (((Stat.TILE_LENGTH * tile_kol_heigth) / 2) - (Stat.TILE_LENGTH / 2));
plane.z = 0;
plane.name = "pol";
plane.mobility = 0;
this.addChild(plane);
sky = new GeoSphere(3000, 2, true);
sky.cloneMaterialToAllSurfaces(new BoxMaterial("Sky04"));
sky.x = (((Stat.TILE_LENGTH * tile_kol_width) / 2) - (Stat.TILE_LENGTH / 2));
sky.y = (((Stat.TILE_LENGTH * tile_kol_heigth) / 2) - (Stat.TILE_LENGTH / 2));
sky.z = 0;
sky.name = "sky";
sky.mobility = 0;
this.addChild(sky);
}
public function robot_create():void{
var _local1:Robot_init;
var _local3:Robot;
var _local5:int;
var _local2:Point3D = new Point3D();
_local2.z = 5;
var _local4:int;
while (_local4 < level.robot_array.length) {
_local1 = level.robot_array[_local4];
_local3 = new Robot(_local1.tip, level_diff);
_local3.name = _local1.name;
_local3.coords = new Point3D((_local1.go_array[0].x * Stat.TILE_LENGTH), (_local1.go_array[0].y * Stat.TILE_LENGTH), 5);
_local3.go_coords = new Point3D((_local1.go_array[1].x * Stat.TILE_LENGTH), (_local1.go_array[1].y * Stat.TILE_LENGTH), 5);
_local5 = 0;
while (_local5 < _local1.go_array.length) {
_local2.x = (_local1.go_array[_local5].x * Stat.TILE_LENGTH);
_local2.y = (_local1.go_array[_local5].y * Stat.TILE_LENGTH);
_local3.goto_array.push(new Point3D(_local2.x, _local2.y, _local2.z));
_local5++;
};
this.addChild(_local3);
robot_array.push(_local3);
_local4++;
};
}
public function door_create():void{
door_close = new Door(map_level);
door_close.x = (start_point.x * Stat.TILE_LENGTH);
door_close.y = ((start_point.y - 1) * Stat.TILE_LENGTH);
door_close.z = (Stat.TILE_LENGTH / 2);
this.addChild(door_close);
door_open = new Door(map_level);
door_open.x = (start_point.x * Stat.TILE_LENGTH);
door_open.y = ((start_point.y + 1) * Stat.TILE_LENGTH);
door_open.z = (Stat.TILE_LENGTH / 2);
this.addChild(door_open);
door_open_final = new Door(map_level);
door_open_final.x = (finish_point.x * Stat.TILE_LENGTH);
door_open_final.y = ((finish_point.y - 1) * Stat.TILE_LENGTH);
door_open_final.z = (Stat.TILE_LENGTH / 2);
this.addChild(door_open_final);
door_final = new Door(map_level);
door_final.x = (finish_point.x * Stat.TILE_LENGTH);
door_final.y = ((finish_point.y + 1) * Stat.TILE_LENGTH);
door_final.z = (Stat.TILE_LENGTH / 2);
this.addChild(door_final);
}
public function level_create():void{
switch (map_level){
case 10:
level = new Level_01();
break;
case 20:
level = new Level_02();
break;
case 30:
level = new Level_03();
break;
case 40:
level = new Level_04();
break;
case 50:
level = new Level_05();
break;
case 60:
level = new Level_06();
break;
case 70:
level = new Level_07();
break;
case 80:
level = new Level_08();
break;
case 90:
level = new Level_09();
break;
case 100:
level = new Level_10();
break;
case 110:
level = new Level_11();
break;
case 120:
level = new Level_12();
break;
case 130:
level = new Level_13();
break;
case 140:
level = new Level_14();
break;
case 150:
level = new Level_15();
break;
case 160:
level = new Level_16();
break;
case 170:
level = new Level_17();
break;
case 180:
level = new Level_18();
break;
default:
trace("ERORR LEVEL in room.create_level()");
};
map_block_array = level.map_block_array;
start_point = level.start_point;
finish_point = level.finish_point;
robot_array = new Array();
}
}
}//package main.game
Section 182
//SoundManager (main.game.SoundManager)
package main.game {
import flash.events.*;
import flash.media.*;
public class SoundManager extends EventDispatcher {
private var status_free:Boolean;// = false
private var volumeTransform:SoundTransform;
private var freeSound:FreeSound;
private var chanelFree:SoundChannel;
private var soundSong:Sound;
private var chanelSong:SoundChannel;
private var chanelSound:SoundChannel;
private var status:String;// = "menu"
public var volume:Number;// = 1
public function SoundManager(){
freeSound = new FreeSound();
volumeTransform = new SoundTransform();
super();
volumeTransform.volume = (0.5 * volume);
}
public function free_play():void{
if (!status_free){
status_free = true;
volumeTransform.volume = 1;
chanelFree = freeSound.play(0, 99999, volumeTransform);
};
}
public function song_end_play():void{
soundSong = new EndSound();
volumeTransform.volume = 1;
chanelSong = soundSong.play(0, 99999, volumeTransform);
}
public function free_stop():void{
if (((status_free) && (!((chanelFree == null))))){
status_free = false;
chanelFree.stop();
};
}
public function song_start(_arg1:Event=null):void{
if (status == "easy"){
soundSong = new EasySound();
volumeTransform.volume = (0.7 * volume);
chanelSong = soundSong.play(0, 99999, volumeTransform);
} else {
soundSong = new HardSound();
volumeTransform.volume = (0.5 * volume);
chanelSong = soundSong.play(0, 99999, volumeTransform);
};
chanelSong.removeEventListener(Event.SOUND_COMPLETE, song_start);
}
public function song_stop():void{
if (chanelSong != null){
chanelSong.stop();
};
}
public function song_play(_arg1:String="menu"):void{
var _local2:Number = 0;
if ((((_arg1 == "easy")) && (!((status == "easy"))))){
if (chanelSong != null){
_local2 = chanelSong.position;
chanelSong.stop();
};
status = "easy";
soundSong = new EasySound();
volumeTransform.volume = (0.7 * volume);
chanelSong = soundSong.play(_local2, 0, volumeTransform);
if (chanelSong != null){
chanelSong.addEventListener(Event.SOUND_COMPLETE, song_start);
};
} else {
if ((((_arg1 == "hard")) && (!((status == "hard"))))){
if (chanelSong != null){
_local2 = chanelSong.position;
chanelSong.stop();
};
status = "hard";
soundSong = new HardSound();
volumeTransform.volume = (0.5 * volume);
chanelSong = soundSong.play(_local2, 0, volumeTransform);
if (chanelSong != null){
chanelSong.addEventListener(Event.SOUND_COMPLETE, song_start);
} else {
chanelSong = soundSong.play(_local2, 0, volumeTransform);
if (chanelSong != null){
chanelSong = soundSong.play(_local2, 0, volumeTransform);
};
};
} else {
if (_arg1 == "menu"){
status = "menu";
soundSong = new IntroSound();
chanelSong = soundSong.play(_local2, 99999, volumeTransform);
chanelSong.soundTransform = volumeTransform;
};
};
};
}
}
}//package main.game
Section 183
//SpriteMaterial (main.game.SpriteMaterial)
package main.game {
import alternativa.types.*;
import alternativa.engine3d.materials.*;
import flash.display.*;
import alternativa.utils.*;
public class SpriteMaterial extends SpriteTextureMaterial {
public function SpriteMaterial(_arg1:String){
var _local3:Bitmap;
var _local5:Bitmap;
var _local6:Sprite;
var _local7:Sprite;
var _local2:BitmapData = new BitmapData(100, 100, false);
var _local4:BitmapData = new BitmapData(100, 100, false);
if (_arg1 == "Fire"){
_local6 = new Boom_1();
_local7 = new Boom_1_alpha();
} else {
if (_arg1 == "Boom"){
_local6 = new Boom_1();
_local7 = new Boom_1_alpha();
};
};
if (_arg1 == "Fire"){
_local6 = new Boom_1();
_local7 = new Boom_1_alpha();
} else {
if (_arg1 == "Boom"){
_local6 = new Boom_1();
_local7 = new Boom_1_alpha();
};
};
_local2.draw(_local6);
_local3 = new Bitmap(_local2);
_local4.draw(_local7);
_local5 = new Bitmap(_local4);
var _local8:Texture = new Texture(BitmapUtils.mergeBitmapAlpha(_local3.bitmapData, _local5.bitmapData, true));
super(_local8, 1, false);
}
}
}//package main.game
Section 184
//Weapon (main.game.Weapon)
package main.game {
public class Weapon {
public var gun:Boolean;// = true
public var machine_ammo:Number;// = 0
public var uzi_ammo:Number;// = 0
public var rifle:Boolean;// = false
public var machine:Boolean;// = false
public var uzi_bullets:Number;// = 45
public var uzi:Boolean;// = false
public var rifle_ammo:Number;// = 0
public var gun_ammo:Number;// = 9
public var gun_bullets:Number;// = 10
public var machine_bullets:Number;// = 100
public var rifle_bullets:Number;// = 30
private static const GUN_MAX:Number = 10;
private static const RIFLE_DAMAGE:Number = 20;
private static const UZI_MAX:Number = 45;
private static const UZI_DAMAGE:Number = 10;
private static const RIFLE_MAX:Number = 30;
private static const GUN_DAMAGE:Number = 6;
private static const MACHNE_MAX:Number = 100;
private static const MACHNE_DAMAGE:Number = 13;
public function weapon_change(_arg1:Herou_stat, _arg2:String):void{
var _local3:Number = _arg1.ammo;
var _local4:Number = _arg1.bullets;
if (_arg2 == "gun"){
_arg1.ammo = gun_ammo;
_arg1.bullets = gun_bullets;
_arg1.damage = GUN_DAMAGE;
_arg1.full_bullets = GUN_MAX;
} else {
if (_arg2 == "uzi"){
_arg1.ammo = uzi_ammo;
_arg1.bullets = uzi_bullets;
_arg1.damage = UZI_DAMAGE;
_arg1.full_bullets = UZI_MAX;
} else {
if (_arg2 == "rifle"){
_arg1.ammo = rifle_ammo;
_arg1.bullets = rifle_bullets;
_arg1.damage = RIFLE_DAMAGE;
_arg1.full_bullets = RIFLE_MAX;
} else {
if (_arg2 == "machine"){
_arg1.ammo = machine_ammo;
_arg1.bullets = machine_bullets;
_arg1.damage = MACHNE_DAMAGE;
_arg1.full_bullets = MACHNE_MAX;
} else {
trace("bad tip weapon! - class Weapon");
};
};
};
};
if (_arg1.weapon_tip == "gun"){
gun_ammo = _local3;
gun_bullets = _local4;
} else {
if (_arg1.weapon_tip == "uzi"){
uzi_ammo = _local3;
uzi_bullets = _local4;
} else {
if (_arg1.weapon_tip == "rifle"){
rifle_ammo = _local3;
rifle_bullets = _local4;
} else {
if (_arg1.weapon_tip == "machine"){
machine_ammo = _local3;
machine_bullets = _local4;
} else {
trace("bad tip weapon! - class Weapon");
};
};
};
};
_arg1.weapon_tip = _arg2;
}
public function save_ammo(_arg1:Herou_stat):void{
var _local2:Number = _arg1.ammo;
var _local3:Number = _arg1.bullets;
if (_arg1.weapon_tip == "gun"){
gun_ammo = _local2;
gun_bullets = _local3;
} else {
if (_arg1.weapon_tip == "uzi"){
uzi_ammo = _local2;
uzi_bullets = _local3;
} else {
if (_arg1.weapon_tip == "rifle"){
rifle_ammo = _local2;
rifle_bullets = _local3;
} else {
if (_arg1.weapon_tip == "machine"){
machine_ammo = _local2;
machine_bullets = _local3;
} else {
trace("bad tip weapon! - class Weapon");
};
};
};
};
}
public function load_ammo(_arg1:Herou_stat):void{
if (_arg1.weapon_tip == "gun"){
_arg1.ammo = gun_ammo;
} else {
if (_arg1.weapon_tip == "uzi"){
_arg1.ammo = uzi_ammo;
} else {
if (_arg1.weapon_tip == "rifle"){
_arg1.ammo = rifle_ammo;
} else {
if (_arg1.weapon_tip == "machine"){
_arg1.ammo = machine_ammo;
} else {
trace("bad tip weapon! - class Weapon");
};
};
};
};
}
}
}//package main.game
Section 185
//Stat (main.Stat)
package main {
import alternativa.engine3d.materials.*;
import flash.geom.*;
import alternativa.utils.*;
public class Stat {
public static const HEROU_WIDTH:Number = 50;
public static const MATERIALxCCCCCC_0:FillMaterial = new FillMaterial(0xCCCCCC, 1, "normal", -1, 0);
public static const HEROU_LENGTH:Number = 50;
public static const MATERIALxCCCCCC_2:FillMaterial = new FillMaterial(0xCCCCCC, 1, "normal", 2, 0);
public static const MATERIALx777777_2:FillMaterial = new FillMaterial(0x777777, 1, "normal", 2, 0);
public static const TILE_LENGTH:Number = 150;
public static const MAIN_WIDTH:Number = 550;
public static const ROBOT_HEND_X:Number = 0;
public static const ROBOT_HEND_Z:Number = 40;
public static const MATERIALxFF0000_2:FillMaterial = new FillMaterial(0xFF0000, 1, "normal", 2, 0);
public static const ROBOT_UP_HANDS_RADIAN:Number = 0;
public static const HEROU_HEIGTH:Number = 70;
public static const MATERIALxALPHA:FillMaterial = new FillMaterial(0xEEEEEE, 0.3, "normal", 1, 0);
public static const MATERIALxFF0000_0:FillMaterial = new FillMaterial(0xFF0000, 1, "normal", -1, 0);
public static const FIRE_RADIUS:Number = 6;
public static const ROBOT_SEE:Number = 5;
public static const PRICEL:Point = new Point(275, 175);
public static const ROBOT_SEE_DANGER:Number = 10;
public static const INFO_HEIGTH:Number = 50;
public static const MATERIALx111111_0:FillMaterial = new FillMaterial(0x111111, 1, "normal", -1, 0);
public static const ROBOT_DOWN_HANDS_RADIAN:Number = MathUtils.toRadian(-90);
public static const ROBOT_MOVE_SPEED:Number = 4;
public static const ROBOT_ROTATE_RADIAN:Number = MathUtils.toRadian(10);
public static const ROBOT_LIFE:Number = 300;
public static const MATERIALxEEEEEE_2:FillMaterial = new FillMaterial(0xEEEEEE, 1, "normal", 2, 0);
public static const MAIN_WIDTH_CENTER:Number = 275;
public static const MAIN_HEIGTH:Number = 400;
public static const MATERIALxAAAAAA_0:FillMaterial = new FillMaterial(0xAAAAAA, 1, "normal", -1, 0);
public static const MATERIALxAAAAAA_2:FillMaterial = new FillMaterial(0xAAAAAA, 1, "normal", 2, 0);
public static const ROBOT_HEND_RIGHT_Y:Number = 46;
public static const MATERIALx444444_0:FillMaterial = new FillMaterial(0x777777, 1, "normal", -1, 0);
public static const MATERIALx00CC00_0:FillMaterial = new FillMaterial(0xCC00, 1, "normal", -1, 0);
public static const ROBOT_ROTATE_HANDS_RADIAN:Number = MathUtils.toRadian(6);
public static const MATERIALx999999_2:FillMaterial = new FillMaterial(0x999999, 1, "normal", 2, 0);
public static const ROBOT_FIRE_SPEED:Number = 21;
public static const MATERIALx00CC00_A:FillMaterial = new FillMaterial(0xCC00, 0.3, "normal", -1, 0xCC00);
public static const ROBOT_HEND_LEFT_Y:Number = -46;
public static const MAIN_HEIGTH_CENTER:Number = 200;
}
}//package main
Section 186
//btn_ok2_51 (source_fla.btn_ok2_51)
package source_fla {
import flash.display.*;
public dynamic class btn_ok2_51 extends MovieClip {
public function btn_ok2_51(){
addFrameScript(0, frame1);
}
function frame1(){
this.stop();
}
}
}//package source_fla
Section 187
//btn_restart2_10 (source_fla.btn_restart2_10)
package source_fla {
import flash.display.*;
public dynamic class btn_restart2_10 extends MovieClip {
public function btn_restart2_10(){
addFrameScript(0, frame1);
}
function frame1(){
this.stop();
}
}
}//package source_fla
Section 188
//close_33 (source_fla.close_33)
package source_fla {
import flash.display.*;
public dynamic class close_33 extends MovieClip {
public function close_33(){
addFrameScript(0, frame1);
}
function frame1(){
this.stop();
}
}
}//package source_fla
Section 189
//face_101 (source_fla.face_101)
package source_fla {
import flash.display.*;
public dynamic class face_101 extends MovieClip {
public function face_101(){
addFrameScript(0, frame1);
}
function frame1(){
this.stop();
}
}
}//package source_fla
Section 190
//gameover005copy_17 (source_fla.gameover005copy_17)
package source_fla {
import flash.display.*;
public dynamic class gameover005copy_17 extends MovieClip {
public function gameover005copy_17(){
addFrameScript(0, frame1);
}
function frame1(){
this.stop();
}
}
}//package source_fla
Section 191
//gameover005copy10_41 (source_fla.gameover005copy10_41)
package source_fla {
import flash.display.*;
public dynamic class gameover005copy10_41 extends MovieClip {
public function gameover005copy10_41(){
addFrameScript(0, frame1);
}
function frame1(){
this.stop();
}
}
}//package source_fla
Section 192
//gameover005copy11_42 (source_fla.gameover005copy11_42)
package source_fla {
import flash.display.*;
public dynamic class gameover005copy11_42 extends MovieClip {
public function gameover005copy11_42(){
addFrameScript(0, frame1);
}
function frame1(){
this.stop();
}
}
}//package source_fla
Section 193
//gameover005copy2_18 (source_fla.gameover005copy2_18)
package source_fla {
import flash.display.*;
public dynamic class gameover005copy2_18 extends MovieClip {
public function gameover005copy2_18(){
addFrameScript(0, frame1);
}
function frame1(){
this.stop();
}
}
}//package source_fla
Section 194
//gameover005copy3_5 (source_fla.gameover005copy3_5)
package source_fla {
import flash.display.*;
public dynamic class gameover005copy3_5 extends MovieClip {
public function gameover005copy3_5(){
addFrameScript(0, frame1);
}
function frame1(){
this.stop();
}
}
}//package source_fla
Section 195
//gameover005copy4_6 (source_fla.gameover005copy4_6)
package source_fla {
import flash.display.*;
public dynamic class gameover005copy4_6 extends MovieClip {
public function gameover005copy4_6(){
addFrameScript(0, frame1);
}
function frame1(){
this.stop();
}
}
}//package source_fla
Section 196
//gameover005copy5_52 (source_fla.gameover005copy5_52)
package source_fla {
import flash.display.*;
public dynamic class gameover005copy5_52 extends MovieClip {
public function gameover005copy5_52(){
addFrameScript(0, frame1);
}
function frame1(){
this.stop();
}
}
}//package source_fla
Section 197
//gameover005copy6_53 (source_fla.gameover005copy6_53)
package source_fla {
import flash.display.*;
public dynamic class gameover005copy6_53 extends MovieClip {
public function gameover005copy6_53(){
addFrameScript(0, frame1);
}
function frame1(){
this.stop();
}
}
}//package source_fla
Section 198
//gameover005copy7_54 (source_fla.gameover005copy7_54)
package source_fla {
import flash.display.*;
public dynamic class gameover005copy7_54 extends MovieClip {
public function gameover005copy7_54(){
addFrameScript(0, frame1);
}
function frame1(){
this.stop();
}
}
}//package source_fla
Section 199
//gameover005copy8_19 (source_fla.gameover005copy8_19)
package source_fla {
import flash.display.*;
public dynamic class gameover005copy8_19 extends MovieClip {
public function gameover005copy8_19(){
addFrameScript(0, frame1);
}
function frame1(){
this.stop();
}
}
}//package source_fla
Section 200
//gameover005copy9_40 (source_fla.gameover005copy9_40)
package source_fla {
import flash.display.*;
public dynamic class gameover005copy9_40 extends MovieClip {
public function gameover005copy9_40(){
addFrameScript(0, frame1);
}
function frame1(){
this.stop();
}
}
}//package source_fla
Section 201
//guns_105 (source_fla.guns_105)
package source_fla {
import flash.display.*;
public dynamic class guns_105 extends MovieClip {
public function guns_105(){
addFrameScript(0, frame1);
}
function frame1(){
this.stop();
}
}
}//package source_fla
Section 202
//Timeline_31 (source_fla.Timeline_31)
package source_fla {
import flash.display.*;
public dynamic class Timeline_31 extends MovieClip {
public function Timeline_31(){
addFrameScript(0, frame1);
}
function frame1(){
this.stop();
}
}
}//package source_fla
Section 203
//Timeline_92 (source_fla.Timeline_92)
package source_fla {
import flash.display.*;
public dynamic class Timeline_92 extends MovieClip {
public function Timeline_92(){
addFrameScript(0, frame1, 1, frame2, 20, frame21);
}
function frame1(){
this.stop();
}
function frame21(){
this.stop();
}
function frame2(){
this.play();
}
}
}//package source_fla
Section 204
//Timeline_93 (source_fla.Timeline_93)
package source_fla {
import flash.events.*;
import flash.geom.*;
import flash.display.*;
import flash.text.*;
import flash.media.*;
import flash.system.*;
import flash.utils.*;
import flash.errors.*;
import flash.net.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.external.*;
import flash.filters.*;
import flash.printing.*;
import flash.ui.*;
import flash.xml.*;
public dynamic class Timeline_93 extends MovieClip {
public function Timeline_93(){
addFrameScript(0, frame1, 1, frame2, 17, frame18);
}
function frame18(){
this.stop();
this.ready = true;
}
function frame1(){
this.stop();
this.ready = true;
}
function frame2(){
this.play();
this.ready = false;
}
}
}//package source_fla
Section 205
//Timeline_94 (source_fla.Timeline_94)
package source_fla {
import flash.display.*;
public dynamic class Timeline_94 extends MovieClip {
public function Timeline_94(){
addFrameScript(0, frame1, 1, frame2, 18, frame19);
}
function frame1(){
this.stop();
}
function frame19(){
this.stop();
}
function frame2(){
this.play();
}
}
}//package source_fla
Section 206
//Timeline_95 (source_fla.Timeline_95)
package source_fla {
import flash.display.*;
public dynamic class Timeline_95 extends MovieClip {
public function Timeline_95(){
addFrameScript(0, frame1, 1, frame2, 6, frame7);
}
function frame7(){
this.stop();
}
function frame1(){
this.stop();
}
function frame2(){
this.play();
}
}
}//package source_fla
Section 207
//Timeline_96 (source_fla.Timeline_96)
package source_fla {
import flash.display.*;
public dynamic class Timeline_96 extends MovieClip {
public function Timeline_96(){
addFrameScript(0, frame1, 1, frame2, 6, frame7);
}
function frame7(){
this.stop();
}
function frame1(){
this.stop();
}
function frame2(){
this.play();
}
}
}//package source_fla
Section 208
//zanaves_13 (source_fla.zanaves_13)
package source_fla {
import flash.display.*;
public dynamic class zanaves_13 extends MovieClip {
public function zanaves_13(){
addFrameScript(10, frame11);
}
function frame11(){
stop();
}
}
}//package source_fla
Section 209
//zanaves2_20 (source_fla.zanaves2_20)
package source_fla {
import flash.display.*;
public dynamic class zanaves2_20 extends MovieClip {
public function zanaves2_20(){
addFrameScript(0, frame1, 9, frame10);
}
function frame10(){
stop();
}
function frame1(){
stop();
}
}
}//package source_fla
Section 210
//Blood (Blood)
package {
import flash.display.*;
public dynamic class Blood extends MovieClip {
public function Blood(){
addFrameScript(0, frame1, 6, frame7, 24, frame25);
}
function frame7(){
this.stop();
}
function frame1(){
this.stop();
}
function frame25(){
this.stop();
}
}
}//package
Section 211
//Bloodlife (Bloodlife)
package {
import flash.display.*;
public dynamic class Bloodlife extends MovieClip {
public function Bloodlife(){
addFrameScript(0, frame1);
}
function frame1(){
this.stop();
}
}
}//package
Section 212
//Boom_1 (Boom_1)
package {
import flash.display.*;
public dynamic class Boom_1 extends MovieClip {
}
}//package
Section 213
//Boom_1_alpha (Boom_1_alpha)
package {
import flash.display.*;
public dynamic class Boom_1_alpha extends MovieClip {
}
}//package
Section 214
//BossMap (BossMap)
package {
import flash.display.*;
public dynamic class BossMap extends BitmapData {
public function BossMap(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 215
//ClearRoomClip (ClearRoomClip)
package {
import flash.display.*;
import flash.text.*;
public dynamic class ClearRoomClip extends MovieClip {
public var total_bonus:TextField;
public var btn_ok:MovieClip;
public var level_bonus:TextField;
public var kill_robots_bonus:TextField;
public var btn_shop:MovieClip;
public function ClearRoomClip(){
addFrameScript(0, frame1, 9, frame10);
}
function frame10(){
this.stop();
}
function frame1(){
this.play();
}
}
}//package
Section 216
//Downloader (Downloader)
package {
import flash.display.*;
import com.gamezhero.api.as3.*;
import flash.utils.*;
public class Downloader extends MovieClip {
public function Downloader(){
GamezheroApi.ini("captainzorrolasthope");
GamezheroApi.preloader(this, init);
}
private function init():void{
var _local3:Object;
var _local1:Sprite = new Sprite();
_local1.graphics.beginFill(0);
_local1.graphics.drawRect(0, 0, 600, 450);
_local1.graphics.endFill();
this.addChild(_local1);
this.mask = _local1;
stage.stageFocusRect = false;
var _local2:Class = Class(getDefinitionByName("Shooter2"));
if (_local2){
_local3 = new (_local2);
addChild((_local3 as DisplayObject));
};
}
}
}//package
Section 217
//EasySound (EasySound)
package {
import flash.media.*;
public dynamic class EasySound extends Sound {
}
}//package
Section 218
//EndClip (EndClip)
package {
import flash.display.*;
public dynamic class EndClip extends Sprite {
public var btn_restart:MovieClip;
public var z1:MovieClip;
}
}//package
Section 219
//EndSound (EndSound)
package {
import flash.media.*;
public dynamic class EndSound extends Sound {
}
}//package
Section 220
//Floor (Floor)
package {
import flash.display.*;
public dynamic class Floor extends BitmapData {
public function Floor(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 221
//FreeSound (FreeSound)
package {
import flash.media.*;
public dynamic class FreeSound extends Sound {
}
}//package
Section 222
//Gate (Gate)
package {
import flash.display.*;
public dynamic class Gate extends BitmapData {
public function Gate(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 223
//Gate10 (Gate10)
package {
import flash.display.*;
public dynamic class Gate10 extends BitmapData {
public function Gate10(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 224
//Gate20 (Gate20)
package {
import flash.display.*;
public dynamic class Gate20 extends BitmapData {
public function Gate20(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 225
//Gate30 (Gate30)
package {
import flash.display.*;
public dynamic class Gate30 extends BitmapData {
public function Gate30(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 226
//Gate40 (Gate40)
package {
import flash.display.*;
public dynamic class Gate40 extends BitmapData {
public function Gate40(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 227
//HardSound (HardSound)
package {
import flash.media.*;
public dynamic class HardSound extends Sound {
}
}//package
Section 228
//IntroSound (IntroSound)
package {
import flash.media.*;
public dynamic class IntroSound extends Sound {
}
}//package
Section 229
//Menu (Menu)
package {
import flash.display.*;
import flash.text.*;
public dynamic class Menu extends MovieClip {
public var btn_easy:MovieClip;
public var z1:MovieClip;
public var copyright_txt:TextField;
public var btn_normal:MovieClip;
public var gamezheroBtn2:SimpleButton;
public var btn_play:MovieClip;
public var btn_other:MovieClip;
public var btn_put:MovieClip;
public var publishBtn:SimpleButton;
public var btn_hard:MovieClip;
public var btn_score:MovieClip;
public var z3:MovieClip;
public var btn_next:MovieClip;
public var z2:MovieClip;
public function Menu(){
addFrameScript(0, frame1);
}
function frame1(){
this.stop();
}
}
}//package
Section 230
//Metall1 (Metall1)
package {
import flash.display.*;
public dynamic class Metall1 extends BitmapData {
public function Metall1(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 231
//Metall1Red (Metall1Red)
package {
import flash.display.*;
public dynamic class Metall1Red extends BitmapData {
public function Metall1Red(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 232
//Metall2 (Metall2)
package {
import flash.display.*;
public dynamic class Metall2 extends BitmapData {
public function Metall2(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 233
//Metall2Red (Metall2Red)
package {
import flash.display.*;
public dynamic class Metall2Red extends BitmapData {
public function Metall2Red(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 234
//Metall4 (Metall4)
package {
import flash.display.*;
public dynamic class Metall4 extends BitmapData {
public function Metall4(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 235
//Metall4Red (Metall4Red)
package {
import flash.display.*;
public dynamic class Metall4Red extends BitmapData {
public function Metall4Red(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 236
//Metall5 (Metall5)
package {
import flash.display.*;
public dynamic class Metall5 extends BitmapData {
public function Metall5(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 237
//Metall5Red (Metall5Red)
package {
import flash.display.*;
public dynamic class Metall5Red extends BitmapData {
public function Metall5Red(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 238
//PanelClip (PanelClip)
package {
import flash.display.*;
import flash.text.*;
public dynamic class PanelClip extends MovieClip {
public var reload_mc:MovieClip;
public var weapon:MovieClip;
public var endload_mc:MovieClip;
public var face:MovieClip;
public var damage_mc:MovieClip;
public var boom_mc:MovieClip;
public var txt_life:TextField;
public var txt_qulity:TextField;
public var txt_weapon1:TextField;
public var txt_weapon2:TextField;
public var txt_weapon3:TextField;
public var step_mc:MovieClip;
}
}//package
Section 239
//PauseClip (PauseClip)
package {
import flash.display.*;
public dynamic class PauseClip extends Sprite {
public var btn_menu:MovieClip;
public var btn_other:MovieClip;
public var btn_ok:MovieClip;
}
}//package
Section 240
//Pricel (Pricel)
package {
import flash.display.*;
public dynamic class Pricel extends MovieClip {
}
}//package
Section 241
//Shooter2 (Shooter2)
package {
import flash.events.*;
import main.game.*;
import flash.display.*;
import com.gamezhero.api.as3.*;
public class Shooter2 extends Sprite {
private var soundManager:SoundManager;
public var game_mc:Game;
public var menu:Menu;
public function Shooter2(){
menu_init();
}
private function game_instruction(_arg1:MouseEvent=null):void{
menu.btn_easy.removeEventListener(MouseEvent.MOUSE_DOWN, game_instruction);
menu.btn_easy.removeEventListener(MouseEvent.MOUSE_OVER, menu_over);
menu.btn_easy.removeEventListener(MouseEvent.MOUSE_OUT, menu_out);
menu.gotoAndStop(3);
menu.btn_easy.visible = true;
menu.btn_normal.visible = true;
menu.btn_hard.visible = true;
menu.btn_easy.addEventListener(MouseEvent.MOUSE_DOWN, game_start);
menu.btn_easy.addEventListener(MouseEvent.MOUSE_OVER, menu_over);
menu.btn_easy.addEventListener(MouseEvent.MOUSE_OUT, menu_out);
menu.btn_normal.addEventListener(MouseEvent.MOUSE_DOWN, game_start);
menu.btn_normal.addEventListener(MouseEvent.MOUSE_OVER, menu_over);
menu.btn_normal.addEventListener(MouseEvent.MOUSE_OUT, menu_out);
menu.btn_hard.addEventListener(MouseEvent.MOUSE_DOWN, game_start);
menu.btn_hard.addEventListener(MouseEvent.MOUSE_OVER, menu_over);
menu.btn_hard.addEventListener(MouseEvent.MOUSE_OUT, menu_out);
}
private function game_put(_arg1:MouseEvent=null):void{
GamezheroApi.linkSendToFrined();
}
private function goto(_arg1:MouseEvent):void{
switch (_arg1.target){
case menu.gamezheroBtn2:
GamezheroApi.linkZorroLogo();
break;
case menu.publishBtn:
GamezheroApi.linkPublish();
break;
default:
GamezheroApi.linkMoreGames();
};
}
private function top_score(_arg1:MouseEvent=null):void{
GamezheroApi.linkTopScore();
}
private function menu_out(_arg1:MouseEvent=null):void{
_arg1.currentTarget.gotoAndStop(1);
}
public function menu_restart():void{
removeChild(game_mc);
game_mc = null;
menu_init();
}
private function menu_init():void{
menu = new Menu();
menu.x = (600 / 2);
menu.y = (450 / 2);
addChild(menu);
soundManager = new SoundManager();
soundManager.song_play();
menu.btn_easy.visible = false;
menu.btn_normal.visible = false;
menu.btn_hard.visible = false;
menu.btn_next.visible = false;
menu.btn_play.addEventListener(MouseEvent.MOUSE_DOWN, game_setup);
menu.btn_play.addEventListener(MouseEvent.MOUSE_OVER, menu_over);
menu.btn_play.addEventListener(MouseEvent.MOUSE_OUT, menu_out);
menu.btn_other.addEventListener(MouseEvent.MOUSE_DOWN, game_other);
menu.btn_other.addEventListener(MouseEvent.MOUSE_OVER, menu_over);
menu.btn_other.addEventListener(MouseEvent.MOUSE_OUT, menu_out);
menu.btn_score.addEventListener(MouseEvent.MOUSE_DOWN, top_score);
menu.btn_score.addEventListener(MouseEvent.MOUSE_OVER, menu_over);
menu.btn_score.addEventListener(MouseEvent.MOUSE_OUT, menu_out);
menu.btn_put.addEventListener(MouseEvent.MOUSE_DOWN, game_put);
menu.btn_put.addEventListener(MouseEvent.MOUSE_OVER, menu_over);
menu.btn_put.addEventListener(MouseEvent.MOUSE_OUT, menu_out);
menu.gamezheroBtn2.addEventListener(MouseEvent.MOUSE_DOWN, goto);
menu.publishBtn.addEventListener(MouseEvent.MOUSE_DOWN, goto);
var _local1:String = GamezheroGlobal.getDomain(stage);
var _local2:String = GamezheroGlobal.gameName;
menu.copyright_txt.htmlText = (((("<a target='_blank' href='http://www.gamezhero.com/?utm_campaign=" + _local2) + "&utm_source=") + _local1) + "&utm_medium=copyright'>copyright © gamezhero.com</a>");
}
private function game_other(_arg1:Event):void{
GamezheroApi.linkMoreGames();
}
private function menu_over(_arg1:MouseEvent=null):void{
_arg1.currentTarget.gotoAndStop(2);
}
private function game_start(_arg1:MouseEvent=null):void{
soundManager.song_stop();
var _local2 = 1;
if (_arg1.currentTarget.name == "btn_easy"){
_local2 = 1;
} else {
if (_arg1.currentTarget.name == "btn_easy"){
_local2 = 1.5;
} else {
_local2 = 2;
};
};
menu.btn_easy.removeEventListener(MouseEvent.MOUSE_DOWN, game_start);
menu.btn_easy.removeEventListener(MouseEvent.MOUSE_OVER, menu_over);
menu.btn_easy.removeEventListener(MouseEvent.MOUSE_OUT, menu_out);
menu.btn_normal.removeEventListener(MouseEvent.MOUSE_DOWN, game_start);
menu.btn_normal.removeEventListener(MouseEvent.MOUSE_OVER, menu_over);
menu.btn_normal.removeEventListener(MouseEvent.MOUSE_OUT, menu_out);
menu.btn_hard.removeEventListener(MouseEvent.MOUSE_DOWN, game_start);
menu.btn_hard.removeEventListener(MouseEvent.MOUSE_OVER, menu_over);
menu.btn_hard.removeEventListener(MouseEvent.MOUSE_OUT, menu_out);
removeChild(menu);
soundManager = null;
game_init(_local2);
}
private function game_setup(_arg1:MouseEvent=null):void{
menu.btn_play.removeEventListener(MouseEvent.MOUSE_DOWN, game_setup);
menu.btn_play.removeEventListener(MouseEvent.MOUSE_OVER, menu_over);
menu.btn_play.removeEventListener(MouseEvent.MOUSE_OUT, menu_out);
menu.btn_other.removeEventListener(MouseEvent.MOUSE_DOWN, game_other);
menu.btn_other.removeEventListener(MouseEvent.MOUSE_OVER, menu_over);
menu.btn_other.removeEventListener(MouseEvent.MOUSE_OUT, menu_out);
menu.btn_score.removeEventListener(MouseEvent.MOUSE_DOWN, top_score);
menu.btn_score.removeEventListener(MouseEvent.MOUSE_OVER, menu_over);
menu.btn_score.removeEventListener(MouseEvent.MOUSE_OUT, menu_out);
menu.btn_put.removeEventListener(MouseEvent.MOUSE_DOWN, game_put);
menu.btn_put.removeEventListener(MouseEvent.MOUSE_OVER, menu_over);
menu.btn_put.removeEventListener(MouseEvent.MOUSE_OUT, menu_out);
menu.gamezheroBtn2.removeEventListener(MouseEvent.MOUSE_DOWN, goto);
menu.publishBtn.removeEventListener(MouseEvent.MOUSE_DOWN, goto);
menu.gotoAndStop(2);
menu.btn_next.visible = true;
menu.btn_next.addEventListener(MouseEvent.MOUSE_DOWN, game_instruction);
menu.btn_next.addEventListener(MouseEvent.MOUSE_OVER, menu_over);
menu.btn_next.addEventListener(MouseEvent.MOUSE_OUT, menu_out);
}
private function game_init(_arg1:int=1):void{
game_mc = new Game(this, _arg1);
game_mc.x = ((600 - 550) / 2);
game_mc.y = ((450 - 400) / 2);
addChild(game_mc);
}
}
}//package
Section 242
//ShopClip (ShopClip)
package {
import flash.display.*;
import flash.text.*;
public dynamic class ShopClip extends Sprite {
public var btn_buy_machine:MovieClip;
public var weapon_machine:MovieClip;
public var txt_ammo_machine:TextField;
public var btn_buy_uzi:MovieClip;
public var txt_ammo_uzi:TextField;
public var btn_buy_machine_ammo:MovieClip;
public var btn_buy_uzi_ammo:MovieClip;
public var txt_ammo_rifle:TextField;
public var txt_points:TextField;
public var btn_ok:MovieClip;
public var btn_buy_rifle:MovieClip;
public var btn_buy_rifle_ammo:MovieClip;
public var weapon_uzi:MovieClip;
public var weapon_rifle:MovieClip;
}
}//package
Section 243
//Sky04 (Sky04)
package {
import flash.display.*;
public dynamic class Sky04 extends BitmapData {
public function Sky04(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 244
//SubmitClip (SubmitClip)
package {
import flash.display.*;
public dynamic class SubmitClip extends MovieClip {
public var z1:MovieClip;
public var btn_mainmenu:MovieClip;
public var btn_restart:MovieClip;
public var btn_submit:MovieClip;
public var btn_other:MovieClip;
public function SubmitClip(){
addFrameScript(0, frame1, 9, frame10);
}
function frame10(){
this.stop();
}
function frame1(){
this.play();
}
}
}//package
Section 245
//WallTexture11 (WallTexture11)
package {
import flash.display.*;
public dynamic class WallTexture11 extends BitmapData {
public function WallTexture11(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 246
//WallTexture12 (WallTexture12)
package {
import flash.display.*;
public dynamic class WallTexture12 extends BitmapData {
public function WallTexture12(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 247
//WallTexture13 (WallTexture13)
package {
import flash.display.*;
public dynamic class WallTexture13 extends BitmapData {
public function WallTexture13(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 248
//WallTexture20 (WallTexture20)
package {
import flash.display.*;
public dynamic class WallTexture20 extends BitmapData {
public function WallTexture20(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 249
//WallTexture21 (WallTexture21)
package {
import flash.display.*;
public dynamic class WallTexture21 extends BitmapData {
public function WallTexture21(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 250
//WallTexture22 (WallTexture22)
package {
import flash.display.*;
public dynamic class WallTexture22 extends BitmapData {
public function WallTexture22(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 251
//WallTexture23 (WallTexture23)
package {
import flash.display.*;
public dynamic class WallTexture23 extends BitmapData {
public function WallTexture23(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 252
//WallTexture24 (WallTexture24)
package {
import flash.display.*;
public dynamic class WallTexture24 extends BitmapData {
public function WallTexture24(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 253
//WallTexture30 (WallTexture30)
package {
import flash.display.*;
public dynamic class WallTexture30 extends BitmapData {
public function WallTexture30(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 254
//WallTexture31 (WallTexture31)
package {
import flash.display.*;
public dynamic class WallTexture31 extends BitmapData {
public function WallTexture31(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 255
//WallTexture32 (WallTexture32)
package {
import flash.display.*;
public dynamic class WallTexture32 extends BitmapData {
public function WallTexture32(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 256
//WallTexture33 (WallTexture33)
package {
import flash.display.*;
public dynamic class WallTexture33 extends BitmapData {
public function WallTexture33(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 257
//WallTexture34 (WallTexture34)
package {
import flash.display.*;
public dynamic class WallTexture34 extends BitmapData {
public function WallTexture34(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 258
//WallTexture40 (WallTexture40)
package {
import flash.display.*;
public dynamic class WallTexture40 extends BitmapData {
public function WallTexture40(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 259
//WallTexture41 (WallTexture41)
package {
import flash.display.*;
public dynamic class WallTexture41 extends BitmapData {
public function WallTexture41(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 260
//WallTexture42 (WallTexture42)
package {
import flash.display.*;
public dynamic class WallTexture42 extends BitmapData {
public function WallTexture42(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 261
//WallTexture43 (WallTexture43)
package {
import flash.display.*;
public dynamic class WallTexture43 extends BitmapData {
public function WallTexture43(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 262
//WallTexture44 (WallTexture44)
package {
import flash.display.*;
public dynamic class WallTexture44 extends BitmapData {
public function WallTexture44(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 263
//WeaponGun (WeaponGun)
package {
import flash.events.*;
import flash.geom.*;
import flash.display.*;
import flash.text.*;
import flash.media.*;
import flash.system.*;
import flash.utils.*;
import flash.errors.*;
import flash.net.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.external.*;
import flash.filters.*;
import flash.printing.*;
import flash.ui.*;
import flash.xml.*;
public dynamic class WeaponGun extends MovieClip {
public function WeaponGun(){
addFrameScript(0, frame1, 6, frame7, 13, frame14, 14, frame15, 21, frame22);
}
function frame14(){
this.ready = true;
this.stop();
}
function frame15(){
this.ready = false;
}
function frame7(){
this.ready = false;
}
function frame1(){
this.ready = false;
}
function frame22(){
this.ready = true;
this.stop();
}
}
}//package
Section 264
//WeaponMachine (WeaponMachine)
package {
import flash.events.*;
import flash.geom.*;
import flash.display.*;
import flash.text.*;
import flash.media.*;
import flash.system.*;
import flash.utils.*;
import flash.errors.*;
import flash.net.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.external.*;
import flash.filters.*;
import flash.printing.*;
import flash.ui.*;
import flash.xml.*;
public dynamic class WeaponMachine extends MovieClip {
public function WeaponMachine(){
addFrameScript(0, frame1, 11, frame12, 23, frame24, 24, frame25, 25, frame26);
}
function frame12(){
this.ready = false;
}
function frame1(){
this.ready = false;
}
function frame25(){
this.ready = false;
}
function frame26(){
this.ready = true;
this.stop();
}
function frame24(){
this.ready = true;
this.stop();
}
}
}//package
Section 265
//WeaponRifle (WeaponRifle)
package {
import flash.events.*;
import flash.geom.*;
import flash.display.*;
import flash.text.*;
import flash.media.*;
import flash.system.*;
import flash.utils.*;
import flash.errors.*;
import flash.net.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.external.*;
import flash.filters.*;
import flash.printing.*;
import flash.ui.*;
import flash.xml.*;
public dynamic class WeaponRifle extends MovieClip {
public function WeaponRifle(){
addFrameScript(0, frame1, 8, frame9, 17, frame18, 18, frame19, 21, frame22);
}
function frame18(){
this.ready = true;
this.stop();
}
function frame1(){
this.ready = false;
}
function frame19(){
this.ready = false;
}
function frame9(){
this.ready = false;
}
function frame22(){
this.ready = true;
this.stop();
}
}
}//package
Section 266
//WeaponUzi (WeaponUzi)
package {
import flash.events.*;
import flash.geom.*;
import flash.display.*;
import flash.text.*;
import flash.media.*;
import flash.system.*;
import flash.utils.*;
import flash.errors.*;
import flash.net.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.external.*;
import flash.filters.*;
import flash.printing.*;
import flash.ui.*;
import flash.xml.*;
public dynamic class WeaponUzi extends MovieClip {
public function WeaponUzi(){
addFrameScript(0, frame1, 6, frame7, 13, frame14, 14, frame15, 16, frame17);
}
function frame14(){
this.ready = true;
this.stop();
}
function frame15(){
this.ready = false;
}
function frame7(){
this.ready = false;
}
function frame1(){
this.ready = false;
}
function frame17(){
this.ready = true;
this.stop();
}
}
}//package