Section 1
//DebugDispatcher (com.blitzagency.xray.logger.events.DebugDispatcher)
package com.blitzagency.xray.logger.events {
import flash.events.*;
public class DebugDispatcher extends EventDispatcher {
public static var TRACE:String = "trace";
public function sendEvent(_arg1:String, _arg2:Object):void{
dispatchEvent(new DebugEvent(DebugDispatcher.TRACE, false, false, _arg2));
}
}
}//package com.blitzagency.xray.logger.events
Section 2
//DebugEvent (com.blitzagency.xray.logger.events.DebugEvent)
package com.blitzagency.xray.logger.events {
import flash.events.*;
public class DebugEvent extends Event {
public var obj:Object;
public function DebugEvent(_arg1:String, _arg2:Boolean, _arg3:Boolean, _arg4:Object):void{
obj = new Object();
super(_arg1, _arg2, _arg3);
obj = _arg4;
}
}
}//package com.blitzagency.xray.logger.events
Section 3
//ObjectTools (com.blitzagency.xray.logger.util.ObjectTools)
package com.blitzagency.xray.logger.util {
import com.blitzagency.xray.logger.*;
import flash.utils.*;
public class ObjectTools {
private static var log:XrayLog = new XrayLog();
public function resolveBaseType(_arg1:Object):String{
return ("");
}
public static function getImmediateClassPath(_arg1:Object):String{
var _local2:String;
var _local3:String;
_local2 = getQualifiedClassName(_arg1);
_local3 = getQualifiedSuperclassName(_arg1);
_local2 = ((_local2.indexOf("::") > -1)) ? _local2.split("::").join(".") : _local2;
if (_local3 == null){
return (_local2);
};
_local3 = ((_local3.indexOf("::") > -1)) ? _local3.split("::").join(".") : _local3;
return (((_local3 + ".") + _local2));
}
public static function getFullClassPath(_arg1:Object):String{
var _local2:XML;
var _local3:Array;
var _local4:String;
var _local5:XML;
var _local6:String;
_local2 = describeType(_arg1);
_local3 = [];
_local4 = getQualifiedClassName(_arg1);
_local4 = ((_local4.indexOf("::") > -1)) ? _local4.split("::").join(".") : _local4;
_local3.push(_local4);
for each (_local5 in _local2.extendsClass) {
_local6 = ((_local5.@type.toString().indexOf("::") > -1)) ? _local5.@type.toString().split("::")[1] : _local5.@type.toString();
_local3.push(_local6);
};
return (_local3.join("."));
}
}
}//package com.blitzagency.xray.logger.util
Section 4
//PropertyTools (com.blitzagency.xray.logger.util.PropertyTools)
package com.blitzagency.xray.logger.util {
import flash.utils.*;
public class PropertyTools {
private static function getVariables():void{
}
public static function getProperties(_arg1:Object):Array{
var ary:Array;
var xmlDoc:XML;
var item:XML;
var name:String;
var type:String;
var value:Object;
var obj = _arg1;
ary = [];
try {
xmlDoc = describeType(obj);
for each (item in xmlDoc.variable) {
name = item.@name.toString();
type = item.@type.toString();
value = ((obj[name])!=null) ? obj[name] : "";
ary.push({name:name, type:type, value:value});
};
} catch(e:Error) {
};
return (ary);
}
private static function getMethods():void{
}
}
}//package com.blitzagency.xray.logger.util
Section 5
//Debug (com.blitzagency.xray.logger.Debug)
package com.blitzagency.xray.logger {
import flash.events.*;
import flash.utils.*;
import com.blitzagency.xray.logger.events.*;
import flash.net.*;
public class Debug {
private static var connected:Boolean = false;
private static var xrayLC:LocalConnection;
private static var ed:DebugDispatcher = new DebugDispatcher();
public static function traceObject(_arg1:Object, _arg2:Number=254, _arg3:Number=0, _arg4:String="", _arg5:Number=0):void{
var recurseDepth:Number;
var indent:Number;
var prop:String;
var lead:String;
var i:Number;
var obj:String;
var o = _arg1;
var pRecurseDepth = _arg2;
var pIndent = _arg3;
var pPackage = _arg4;
var pLevel = _arg5;
try {
recurseDepth = pRecurseDepth;
indent = pIndent;
for (prop in o) {
lead = "";
i = 0;
while (i < indent) {
lead = (lead + " ");
i = (i + 1);
};
obj = o[prop].toString();
if ((o[prop] is Array)){
obj = "[Array]";
};
if (obj == "[object Object]"){
obj = "[Object]";
};
_slot1.trace((((lead + prop) + ": ") + obj), pPackage, pLevel);
if (recurseDepth > 0){
_slot1.traceObject(o[prop], (recurseDepth - 1), (indent + 1), pPackage, pLevel);
};
};
} catch(e:Error) {
};
}
public static function trace(_arg1:Object, _arg2:String="", _arg3:Number=0):void{
var msg:String;
var pMsg = _arg1;
var pPackage = _arg2;
var pLevel = _arg3;
ed.sendEvent(DebugDispatcher.TRACE, {message:pMsg, classPackage:pPackage});
if (!connected){
makeConnection();
};
if (connected){
try {
msg = ((String(pMsg).length >= 39995)) ? (String(pMsg).substr(0, 39995) + "...") : String(pMsg);
xrayLC.send("_xray_view_conn", "setTrace", msg, pLevel, pPackage);
} catch(e:LogError) {
LogError("No Xray Interface running");
};
};
}
private static function makeConnection():void{
var err:LogError;
xrayLC = new LocalConnection();
xrayLC.addEventListener("status", statusHandler);
xrayLC.allowDomain("*");
try {
xrayLC.connect(("_xray_standAlone_debug" + getTimer()));
connected = true;
} catch(e:Error) {
err = new LogError("log");
setTimeout(makeConnection, 1000);
};
}
public static function addEventListener(_arg1:String, _arg2:Function):void{
ed.addEventListener(_arg1, _arg2);
}
private static function initialize():Boolean{
ed = new DebugDispatcher();
return (true);
}
private static function statusHandler(_arg1:StatusEvent):void{
if ((((((_arg1.code == null)) && ((_arg1.level == "error")))) && (connected))){
connected = false;
} else {
if ((((_arg1.level == "status")) && ((_arg1.code == null)))){
connected = true;
};
};
}
}
}//package com.blitzagency.xray.logger
class LogError extends Error {
private function LogError(_arg1:String){
super(_arg1);
}
}
Section 6
//Log (com.blitzagency.xray.logger.Log)
package com.blitzagency.xray.logger {
import com.blitzagency.xray.logger.util.*;
public class Log {
private var level:Number;
private var caller:String;// = ""
private var classPackage:String;
private var dump:Object;
private var message:String;
public function Log(_arg1:String, _arg2:Object, _arg3:Number, ... _args){
var err:LogError;
var nullArray:Array;
var str:String;
var p_message = _arg1;
var p_dump = _arg2;
var p_level = _arg3;
var rest = _args;
caller = "";
super();
try {
nullArray.push("bogus");
} catch(e:Error) {
err = new LogError("log");
} finally {
if (err.hasOwnProperty("getStackTrace")){
str = err.getStackTrace();
setCaller(resolveCaller(str));
} else {
setCaller("");
};
setMessage(p_message);
setDump(p_dump);
setLevel(p_level);
setClassPackage(p_dump);
};
}
public function setLevel(_arg1:Number):void{
level = _arg1;
}
public function getCaller():String{
return (caller);
}
public function setMessage(_arg1:String):void{
message = _arg1;
}
public function getLevel():Number{
return (level);
}
public function getDump():Object{
return (dump);
}
public function setCaller(_arg1:String):void{
caller = _arg1;
}
public function setClassPackage(_arg1:Object):void{
classPackage = ObjectTools.getImmediateClassPath(_arg1);
}
public function getMessage():String{
return (message);
}
public function getClassPackage():String{
return (classPackage);
}
public function setDump(_arg1:Object):void{
dump = _arg1;
}
private function resolveCaller(_arg1:String):String{
var ary:Array;
var str = _arg1;
ary = [];
try {
str = str.split("\n").join("");
ary = str.split("\tat ");
str = ary[3];
} catch(e:Error) {
} finally {
str = "";
};
return (str);
}
}
}//package com.blitzagency.xray.logger
class LogError extends Error {
private function LogError(_arg1:String){
super(_arg1);
}
}
Section 7
//Logger (com.blitzagency.xray.logger.Logger)
package com.blitzagency.xray.logger {
public interface Logger {
function setLevel(_arg1:Number=0):void;
function debug(_arg1:Log):void;
function fatal(_arg1:Log):void;
function warn(_arg1:Log):void;
function error(_arg1:Log):void;
function log(_arg1:String, _arg2:String, _arg3:String, _arg4:Number, _arg5:Object=null):void;
function info(_arg1:Log):void;
}
}//package com.blitzagency.xray.logger
Section 8
//XrayLog (com.blitzagency.xray.logger.XrayLog)
package com.blitzagency.xray.logger {
public class XrayLog {
private var logger:XrayLogger;
public function XrayLog(){
logger = XrayLogger.getInstance();
}
public function debug(_arg1:String, ... _args):void{
var _local3:Number;
if (_args.length == 0){
logger.debug(new Log(_arg1, null, XrayLogger.DEBUG));
};
_local3 = 0;
while (_local3 < _args.length) {
if (_local3 > 0){
_arg1 = "";
};
logger.debug(new Log(_arg1, _args[_local3], XrayLogger.DEBUG));
_local3++;
};
}
public function fatal(_arg1:String, ... _args):void{
var _local3:Number;
if (_args.length == 0){
logger.fatal(new Log(_arg1, null, XrayLogger.FATAL));
};
_local3 = 0;
while (_local3 < _args.length) {
if (_local3 > 0){
_arg1 = "";
};
logger.fatal(new Log(_arg1, _args[_local3], XrayLogger.FATAL));
_local3++;
};
}
public function info(_arg1:String, ... _args):void{
var _local3:Number;
if (_args.length == 0){
logger.info(new Log(_arg1, null, XrayLogger.INFO));
};
_local3 = 0;
while (_local3 < _args.length) {
if (_local3 > 0){
_arg1 = "";
};
logger.info(new Log(_arg1, _args[_local3], XrayLogger.INFO));
_local3++;
};
}
public function warn(_arg1:String, ... _args):void{
var _local3:Number;
if (_args.length == 0){
logger.warn(new Log(_arg1, null, XrayLogger.WARN));
};
_local3 = 0;
while (_local3 < _args.length) {
if (_local3 > 0){
_arg1 = "";
};
logger.warn(new Log(_arg1, _args[_local3], XrayLogger.WARN));
_local3++;
};
}
public function error(_arg1:String, ... _args):void{
var _local3:Number;
if (_args.length == 0){
logger.error(new Log(_arg1, null, XrayLogger.ERROR));
};
_local3 = 0;
while (_local3 < _args.length) {
if (_local3 > 0){
_arg1 = "";
};
logger.error(new Log(_arg1, _args[_local3], XrayLogger.ERROR));
_local3++;
};
}
}
}//package com.blitzagency.xray.logger
Section 9
//XrayLogger (com.blitzagency.xray.logger.XrayLogger)
package com.blitzagency.xray.logger {
import flash.events.*;
import flash.utils.*;
import com.blitzagency.xray.logger.util.*;
public class XrayLogger extends EventDispatcher implements Logger {
private var displayObjectRecursionDepth:Number;// = 3
private var level:Number;// = 0
private var indentation:Number;// = 0
private var objectRecursionDepth:Number;// = 254
private var filters:Array;
public static var FATAL:Number = 4;
public static var WARN:Number = 2;
public static var ERROR:Number = 3;
public static var INFO:Number = 1;
public static var DEBUG:Number = 0;
private static var _instance:XrayLogger = null;
public static var NONE:Number = 5;
public function XrayLogger(){
level = 0;
displayObjectRecursionDepth = 3;
objectRecursionDepth = 254;
indentation = 0;
filters = [];
super();
}
public function checkFilters():Boolean{
var _local1:uint;
if (filters.length == 0){
return (true);
};
_local1 = 0;
while (_local1 < filters.length) {
_local1++;
};
return (true);
}
public function debug(_arg1:Log):void{
if (_arg1.getLevel() == level){
log(_arg1.getMessage(), _arg1.getCaller(), _arg1.getClassPackage(), 0, _arg1.getDump());
};
}
public function setIndentation(_arg1:Number=0):void{
indentation = _arg1;
}
public function error(_arg1:Log):void{
if (_arg1.getLevel() >= level){
log(_arg1.getMessage(), _arg1.getCaller(), _arg1.getClassPackage(), 3, _arg1.getDump());
};
}
public function setLevel(_arg1:Number=0):void{
level = _arg1;
}
public function fatal(_arg1:Log):void{
if (_arg1.getLevel() >= level){
log(_arg1.getMessage(), _arg1.getCaller(), _arg1.getClassPackage(), 4, _arg1.getDump());
};
}
public function warn(_arg1:Log):void{
if (_arg1.getLevel() >= level){
log(_arg1.getMessage(), _arg1.getCaller(), _arg1.getClassPackage(), 2, _arg1.getDump());
};
}
public function setObjectRecursionDepth(_arg1:Number):void{
objectRecursionDepth = _arg1;
}
public function setDisplayClipRecursionDepth(_arg1:Number):void{
displayObjectRecursionDepth = _arg1;
}
public function info(_arg1:Log):void{
if (_arg1.getLevel() >= level){
log(_arg1.getMessage(), _arg1.getCaller(), _arg1.getClassPackage(), 1, _arg1.getDump());
};
}
public function log(_arg1:String, _arg2:String, _arg3:String, _arg4:Number, _arg5:Object=null):void{
var _local6:String;
var _local7:String;
var _local8:String;
var _local9:Object;
_local6 = (("(" + getTimer()) + ") ");
if (_arg3.length > 0){
_local6 = (_local6 + (_arg2 + "\n"));
};
_local6 = (_local6 + _arg1);
if (_arg1.length > 0){
Debug.trace(_local6, _arg3, _arg4);
};
if (_arg5 == null){
return;
};
_local7 = typeof(_arg5);
if ((((((((((_local7 == "string")) || ((_local7 == "number")))) || ((_local7 == "boolean")))) || ((_local7 == "undefined")))) || ((_local7 == "null")))){
Debug.trace(_arg5, _arg3, _arg4);
} else {
if (_local7 == "xml"){
Debug.trace(_arg5.toString(), _arg3, _arg4);
} else {
_local8 = ObjectTools.getImmediateClassPath(_arg5);
if ((((_local8 == "Object")) || ((_local8 == "Object.Array")))){
Debug.traceObject(_arg5, objectRecursionDepth, indentation, _arg3, _arg4);
} else {
_local9 = PropertyTools.getProperties(_arg5);
Debug.traceObject(_local9, displayObjectRecursionDepth, indentation, _arg3, _arg4);
};
};
};
}
public function setFilters(_arg1:Array):void{
filters = _arg1;
}
public static function getInstance():XrayLogger{
if (_instance == null){
_instance = new (XrayLogger);
};
return (_instance);
}
public static function resolveLevelAsName(_arg1:Number):String{
switch (_arg1){
case 0:
return ("debug");
case 1:
return ("info");
case 2:
return ("warn");
case 3:
return ("error");
case 4:
return ("fatal");
default:
return ("debug");
};
}
}
}//package com.blitzagency.xray.logger
Section 10
//Stinger3D (com.candystand.Stinger.Stinger3D)
package com.candystand.Stinger {
import flash.display.*;
import flash.events.*;
import com.caurina.transitions.*;
import flash.geom.*;
import org.papervision3d.objects.*;
import org.papervision3d.core.proto.*;
import org.papervision3d.materials.*;
import com.caurina.transitions.properties.*;
import flash.utils.*;
import com.event.*;
import org.papervision3d.scenes.*;
import org.papervision3d.cameras.*;
import flash.text.*;
import flash.net.*;
public class Stinger3D extends MovieClip {
private var planeCounter:Number;// = 0
public var containerMask:MovieClip;
private var camera:Camera3D;
private var anglePerPlane:Number;
private var center:DisplayObject3D;
private var startTime:Number;
public var buttonText:TextField;
private var container:Sprite;
private var planes:Array;
private var radius:Number;// = 540
private var numImages:int;// = 20
private var scene:MovieScene3D;
public static var _instance:Stinger3D;
private static var GAME_NAMES:Array = [];
private static var GAME_LINKS:Array = [];
private static var GAME_ID:Number = 0;
public function Stinger3D(){
planeCounter = 0;
numImages = 20;
radius = 540;
anglePerPlane = ((Math.PI * 2) / numImages);
super();
Stinger3D._instance = this;
DisplayShortcuts.init();
trace("Created Stinger3D");
}
public function destroy():void{
this.removeEventListener(Event.ADDED_TO_STAGE, this.onAddedToStage);
this.removeEventListener(Event.ENTER_FRAME, this.loop);
this.parent.removeChild(this);
}
private function onPressHandler(_arg1:MouseEvent):void{
var _local2:int;
var _local3:URLRequest;
if (_arg1.target.visible){
_local2 = int(_arg1.target.name.split("_")[1]);
_local3 = new URLRequest(((Stinger3D.GAME_LINKS[(_local2 % Stinger3D.GAME_NAMES.length)] + "&vgid=") + Stinger3D.GAME_ID));
navigateToURL(_local3, "_blank");
};
}
private function onRollOutHandler(_arg1:MouseEvent):void{
if (_arg1.target.visible){
Tweener.addTween(_arg1.target, {scaleX:1, scaleY:1, time:0.5});
this.buttonText.text = "";
};
}
private function orientPlanes():void{
var _local1:*;
var _local2:*;
var _local3:Number;
var _local4:Number;
_local1 = 0;
while (_local1 < this.numImages) {
_local2 = _local1;
_local3 = (Math.cos((_local2 * this.anglePerPlane)) * this.radius);
_local4 = (Math.sin((_local2 * this.anglePerPlane)) * this.radius);
this.planes[_local1].extra = new Object();
this.planes[_local1].extra.angle = ((_local2 * this.anglePerPlane) * (180 / Math.PI));
Tweener.addTween(this.planes[_local1], {x:_local3, y:0, z:_local4, time:1, delay:((_local1 * 0.1) + 2), onUpdate:this.onMoveUpdate, onUpdateParams:[this.planes[_local1]], onComplete:this.onMoveComplete});
_local1++;
};
this.dispatchEvent(new Event(StartEvent.START));
}
private function onMoveUpdate(_arg1:Plane):void{
_arg1.lookAt(this.center);
if (_arg1.z >= 15){
_arg1.container.alpha = 0.3;
} else {
_arg1.container.alpha = 1;
};
}
private function correctDegrees(_arg1:Number):Number{
_arg1 = (_arg1 % 360);
if (_arg1 < 0){
_arg1 = (_arg1 + 360);
};
return (_arg1);
}
private function spinPlanes(_arg1:Number):void{
var _local2:*;
var _local3:*;
var _local4:*;
var _local5:Number;
var _local6:Number;
_local2 = 0;
while (_local2 < this.numImages) {
_local3 = (this.planes[_local2].extra.angle + _arg1);
this.planes[_local2].extra.angle = _local3;
_local4 = (_local3 * (Math.PI / 180));
_local5 = (Math.cos(_local4) * this.radius);
_local6 = (Math.sin(_local4) * this.radius);
this.planes[_local2].x = _local5;
this.planes[_local2].z = _local6;
this.onMoveUpdate(this.planes[_local2]);
_local2++;
};
}
public function CSHomepageLink(_arg1:MouseEvent):void{
var _local2:URLRequest;
_local2 = new URLRequest(("http://www.candystand.com/index.do?vgid=" + GAME_ID));
navigateToURL(_local2, "_blank");
}
private function onRollOverHandler(_arg1:MouseEvent):void{
var _local2:int;
if (_arg1.target.visible){
_local2 = int(_arg1.target.name.split("_")[1]);
Tweener.addTween(_arg1.target, {scaleX:1.1, scaleY:1.1, time:0.5});
this.buttonText.text = Stinger3D.GAME_NAMES[(_local2 % Stinger3D.GAME_NAMES.length)].toUpperCase();
};
}
private function onMoveComplete():void{
this.planeCounter++;
if (planeCounter == numImages){
this.dispatchEvent(new Event(Event.COMPLETE));
};
}
private function loop(_arg1:Event):void{
var _local2:int;
var _local3:Number;
if (getTimer() >= (this.startTime + 3000)){
_local2 = 0;
if ((((this.mouseX > _local2)) || ((this.mouseX < -(_local2))))){
if (this.mouseX < 0){
_local2 = (_local2 * -1);
};
_local3 = ((this.mouseX - _local2) / ((stage.stageWidth / 2) - _local2));
_local3 = (_local3 * -2);
this.spinPlanes(_local3);
};
};
scene.renderCamera(this.camera);
}
private function init3D():void{
var _local1:int;
var _local2:int;
this.container = new Sprite();
this.addChildAt(this.container, this.getChildIndex(this.buttonText));
this.container.x = 0;
this.container.y = 75;
this.scene = new MovieScene3D(this.container);
this.camera = new Camera3D();
this.camera.zoom = 5;
this.camera.focus = 100;
this.center = new DisplayObject3D();
this.planes = new Array();
_local1 = 725;
_local2 = 440;
this.containerMask.width = _local1;
this.containerMask.height = _local2;
this.containerMask.x = -((_local1 / 2));
this.containerMask.y = -((_local2 / 2));
this.container.cacheAsBitmap = true;
this.containerMask.cacheAsBitmap = true;
this.container.mask = this.containerMask;
}
public function onAddedToStage(_arg1:Array, _arg2:Array, _arg3:Number):void{
var _local4:int;
var _local5:int;
GAME_NAMES = _arg1;
GAME_LINKS = _arg2;
GAME_ID = _arg3;
init3D();
_local4 = 0;
while (_local4 < this.numImages) {
_local5 = (_local4 - 14);
if (_local5 < 0){
_local5 = (_local4 + 6);
};
this.createImagePlane(_local5);
_local4++;
};
this.orientPlanes();
this.startTime = getTimer();
this.addEventListener(Event.ENTER_FRAME, this.loop, false, 0, true);
}
private function createReflectedBitmap(_arg1:BitmapData):BitmapData{
var _local2:Boolean;
var _local3:Number;
var _local4:Number;
var _local5:Number;
var _local6:MovieClip;
var _local7:MovieClip;
var _local8:MovieClip;
var _local9:BitmapData;
var _local10:Matrix;
var _local11:MovieClip;
var _local12:*;
_local2 = true;
_local3 = 1;
_local4 = 0.3;
_local5 = Math.floor((Math.random() * 1000000));
_local6 = new MovieClip();
_local7 = new MovieClip();
_local7.addChild(new Bitmap(_arg1));
_local8 = new MovieClip();
_local9 = new BitmapData(_arg1.width, (_arg1.height * 0.6));
_local9.draw(_arg1, new Matrix(1, 0, 0, -1, 0, _arg1.height));
_local8.addChild(new Bitmap(_local9));
_local10 = new Matrix();
_local10.createGradientBox(_local9.width, _local9.height, (Math.PI / 2));
_local11 = new MovieClip();
_local8.y = ((_local7.y + _local7.height) + 5);
_local11.graphics.lineStyle(0, 0xFFFFFF, 0);
_local11.graphics.beginGradientFill("linear", [0, 0xFFFFFF], [_local4, 0], [0, 150], _local10);
_local11.graphics.moveTo(0, 0);
_local11.graphics.lineTo(_arg1.width, 0);
_local11.graphics.lineTo(_arg1.width, (_local9.height * _local3));
_local11.graphics.lineTo(0, (_local9.height * _local3));
_local11.graphics.lineTo(0, 0);
_local11.graphics.endFill();
_local11.x = _local8.x;
_local11.y = _local8.y;
_local6.addChild(_local7);
_local6.addChild(_local8);
_local6.addChild(_local11);
_local8.cacheAsBitmap = true;
_local11.cacheAsBitmap = true;
_local8.mask = _local11;
_local12 = new BitmapData(_local6.width, _local6.height, _local2, 0);
_local12.draw(_local6);
_arg1.dispose();
_local9.dispose();
return (_local12);
}
private function createImagePlane(_arg1:int):void{
var _local2:int;
var _local3:Class;
var _local4:BitmapData;
var _local5:InteractiveBitmapMaterial;
var _local6:Plane;
var _local7:Sprite;
_local2 = (_arg1 % GAME_NAMES.length);
_local3 = (getDefinitionByName(("CSSet1Image" + _local2)) as Class);
_local4 = new _local3(240, 240);
_local4 = this.createReflectedBitmap(_local4);
_local5 = new InteractiveBitmapMaterial(_local4);
_local5.doubleSided = true;
_local5.updateBitmap();
_local6 = new Plane(_local5, (_local4.width * 0.625), (_local4.height * 0.625), 2, 2);
this.scene.addChild(_local6, ("CSImage" + String(_arg1)));
_local6.x = -500;
_local6.y = -700;
_local6.z = -500;
_local7 = _local6.container;
_local7.name = ("container_" + _arg1);
_local7.addEventListener(MouseEvent.ROLL_OVER, onRollOverHandler);
_local7.addEventListener(MouseEvent.ROLL_OUT, onRollOutHandler);
_local7.addEventListener(MouseEvent.MOUSE_DOWN, onPressHandler);
this.planes.push(_local6);
}
}
}//package com.candystand.Stinger
Section 11
//DisplayShortcuts (com.caurina.transitions.properties.DisplayShortcuts)
package com.caurina.transitions.properties {
import com.caurina.transitions.*;
import flash.geom.*;
public class DisplayShortcuts {
public function DisplayShortcuts(){
trace("This is an static class and should not be instantiated.");
}
public static function init():void{
Tweener.registerSpecialProperty("_frame", _frame_get, _frame_set);
Tweener.registerSpecialProperty("_autoAlpha", _autoAlpha_get, _autoAlpha_set);
Tweener.registerSpecialPropertySplitter("_scale", _scale_splitter);
Tweener.registerSpecialPropertySplitter("_scrollRect", _scrollRect_splitter);
Tweener.registerSpecialProperty("_scrollRect_x", _scrollRect_property_get, _scrollRect_property_set, ["x"]);
Tweener.registerSpecialProperty("_scrollRect_y", _scrollRect_property_get, _scrollRect_property_set, ["y"]);
Tweener.registerSpecialProperty("_scrollRect_left", _scrollRect_property_get, _scrollRect_property_set, ["left"]);
Tweener.registerSpecialProperty("_scrollRect_right", _scrollRect_property_get, _scrollRect_property_set, ["right"]);
Tweener.registerSpecialProperty("_scrollRect_top", _scrollRect_property_get, _scrollRect_property_set, ["top"]);
Tweener.registerSpecialProperty("_scrollRect_bottom", _scrollRect_property_get, _scrollRect_property_set, ["bottom"]);
Tweener.registerSpecialProperty("_scrollRect_width", _scrollRect_property_get, _scrollRect_property_set, ["width"]);
Tweener.registerSpecialProperty("_scrollRect_height", _scrollRect_property_get, _scrollRect_property_set, ["height"]);
}
public static function _frame_set(_arg1:Object, _arg2:Number, _arg3:Array, _arg4:Object=null):void{
_arg1.gotoAndStop(Math.round(_arg2));
}
public static function _autoAlpha_set(_arg1:Object, _arg2:Number, _arg3:Array, _arg4:Object=null):void{
_arg1.alpha = _arg2;
_arg1.visible = (_arg2 > 0);
}
public static function _frame_get(_arg1:Object, _arg2:Array, _arg3:Object=null):Number{
return (_arg1.currentFrame);
}
public static function _scrollRect_splitter(_arg1:Rectangle, _arg2:Array, _arg3:Object=null):Array{
var _local4:Array;
_local4 = new Array();
if (_arg1 == null){
_local4.push({name:"_scrollRect_x", value:0});
_local4.push({name:"_scrollRect_y", value:0});
_local4.push({name:"_scrollRect_width", value:100});
_local4.push({name:"_scrollRect_height", value:100});
} else {
_local4.push({name:"_scrollRect_x", value:_arg1.x});
_local4.push({name:"_scrollRect_y", value:_arg1.y});
_local4.push({name:"_scrollRect_width", value:_arg1.width});
_local4.push({name:"_scrollRect_height", value:_arg1.height});
};
return (_local4);
}
public static function _autoAlpha_get(_arg1:Object, _arg2:Array, _arg3:Object=null):Number{
return (_arg1.alpha);
}
public static function _scrollRect_property_get(_arg1:Object, _arg2:Array, _arg3:Object=null):Number{
return (_arg1.scrollRect[_arg2[0]]);
}
public static function _scale_splitter(_arg1:Number, _arg2:Array):Array{
var _local3:Array;
_local3 = new Array();
_local3.push({name:"scaleX", value:_arg1});
_local3.push({name:"scaleY", value:_arg1});
return (_local3);
}
public static function _scrollRect_property_set(_arg1:Object, _arg2:Number, _arg3:Array, _arg4:Object=null):void{
var _local5:Rectangle;
_local5 = _arg1.scrollRect;
_local5[_arg3[0]] = Math.round(_arg2);
_arg1.scrollRect = _local5;
}
}
}//package com.caurina.transitions.properties
Section 12
//AuxFunctions (com.caurina.transitions.AuxFunctions)
package com.caurina.transitions {
public class AuxFunctions {
public static function concatObjects(... _args):Object{
var _local2:Object;
var _local3:Object;
var _local4:int;
var _local5:String;
_local2 = {};
_local4 = 0;
while (_local4 < _args.length) {
_local3 = _args[_local4];
for (_local5 in _local3) {
if (_local3[_local5] == null){
delete _local2[_local5];
} else {
_local2[_local5] = _local3[_local5];
};
};
_local4++;
};
return (_local2);
}
public static function numberToG(_arg1:Number):Number{
return (((_arg1 & 0xFF00) >> 8));
}
public static function numberToR(_arg1:Number):Number{
return (((_arg1 & 0xFF0000) >> 16));
}
public static function isInArray(_arg1:String, _arg2:Array):Boolean{
var _local3:uint;
var _local4:uint;
_local3 = _arg2.length;
_local4 = 0;
while (_local4 < _local3) {
if (_arg2[_local4] == _arg1){
return (true);
};
_local4++;
};
return (false);
}
public static function getObjectLength(_arg1:Object):uint{
var _local2:uint;
var _local3:String;
_local2 = 0;
for (_local3 in _arg1) {
_local2++;
};
return (_local2);
}
public static function numberToB(_arg1:Number):Number{
return ((_arg1 & 0xFF));
}
}
}//package com.caurina.transitions
Section 13
//Equations (com.caurina.transitions.Equations)
package com.caurina.transitions {
public class Equations {
public function Equations(){
trace("Equations is a static class and should not be instantiated.");
}
public static function easeOutBounce(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
_arg1 = (_arg1 / _arg4);
if (_arg1 < (1 / 2.75)){
return (((_arg3 * ((7.5625 * _arg1) * _arg1)) + _arg2));
};
if (_arg1 < (2 / 2.75)){
_arg1 = (_arg1 - (1.5 / 2.75));
return (((_arg3 * (((7.5625 * _arg1) * _arg1) + 0.75)) + _arg2));
};
if (_arg1 < (2.5 / 2.75)){
_arg1 = (_arg1 - (2.25 / 2.75));
return (((_arg3 * (((7.5625 * _arg1) * _arg1) + 0.9375)) + _arg2));
};
_arg1 = (_arg1 - (2.625 / 2.75));
return (((_arg3 * (((7.5625 * _arg1) * _arg1) + 0.984375)) + _arg2));
}
public static function easeInOutElastic(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
var _local6:Number;
var _local7:Number;
var _local8:Number;
if (_arg1 == 0){
return (_arg2);
};
_arg1 = (_arg1 / (_arg4 / 2));
if (_arg1 == 2){
return ((_arg2 + _arg3));
};
_local6 = (((!(Boolean(_arg5))) || (isNaN(_arg5.period)))) ? (_arg4 * (0.3 * 1.5)) : _arg5.period;
_local8 = (((!(Boolean(_arg5))) || (isNaN(_arg5.amplitude)))) ? 0 : _arg5.amplitude;
if (((!(Boolean(_local8))) || ((_local8 < Math.abs(_arg3))))){
_local8 = _arg3;
_local7 = (_local6 / 4);
} else {
_local7 = ((_local6 / (2 * Math.PI)) * Math.asin((_arg3 / _local8)));
};
if (_arg1 < 1){
--_arg1;
return (((-0.5 * ((_local8 * Math.pow(2, (10 * _arg1))) * Math.sin(((((_arg1 * _arg4) - _local7) * (2 * Math.PI)) / _local6)))) + _arg2));
};
--_arg1;
return ((((((_local8 * Math.pow(2, (-10 * _arg1))) * Math.sin(((((_arg1 * _arg4) - _local7) * (2 * Math.PI)) / _local6))) * 0.5) + _arg3) + _arg2));
}
public static function easeInOutQuad(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
_arg1 = (_arg1 / (_arg4 / 2));
if (_arg1 < 1){
return (((((_arg3 / 2) * _arg1) * _arg1) + _arg2));
};
--_arg1;
return ((((-(_arg3) / 2) * ((_arg1 * (_arg1 - 2)) - 1)) + _arg2));
}
public static function easeInOutBounce(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
if (_arg1 < (_arg4 / 2)){
return (((easeInBounce((_arg1 * 2), 0, _arg3, _arg4) * 0.5) + _arg2));
};
return ((((easeOutBounce(((_arg1 * 2) - _arg4), 0, _arg3, _arg4) * 0.5) + (_arg3 * 0.5)) + _arg2));
}
public static function easeInOutBack(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
var _local6:Number;
_local6 = (((!(Boolean(_arg5))) || (isNaN(_arg5.overshoot)))) ? 1.70158 : _arg5.overshoot;
_arg1 = (_arg1 / (_arg4 / 2));
if (_arg1 < 1){
_local6 = (_local6 * 1.525);
return ((((_arg3 / 2) * ((_arg1 * _arg1) * (((_local6 + 1) * _arg1) - _local6))) + _arg2));
};
_arg1 = (_arg1 - 2);
_local6 = (_local6 * 1.525);
return ((((_arg3 / 2) * (((_arg1 * _arg1) * (((_local6 + 1) * _arg1) + _local6)) + 2)) + _arg2));
}
public static function easeOutInCubic(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
if (_arg1 < (_arg4 / 2)){
return (easeOutCubic((_arg1 * 2), _arg2, (_arg3 / 2), _arg4, _arg5));
};
return (easeInCubic(((_arg1 * 2) - _arg4), (_arg2 + (_arg3 / 2)), (_arg3 / 2), _arg4, _arg5));
}
public static function easeNone(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
return ((((_arg3 * _arg1) / _arg4) + _arg2));
}
public static function easeOutBack(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
var _local6:Number;
_local6 = (((!(Boolean(_arg5))) || (isNaN(_arg5.overshoot)))) ? 1.70158 : _arg5.overshoot;
_arg1 = ((_arg1 / _arg4) - 1);
return (((_arg3 * (((_arg1 * _arg1) * (((_local6 + 1) * _arg1) + _local6)) + 1)) + _arg2));
}
public static function easeInOutSine(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
return ((((-(_arg3) / 2) * (Math.cos(((Math.PI * _arg1) / _arg4)) - 1)) + _arg2));
}
public static function easeInBack(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
var _local6:Number;
_local6 = (((!(Boolean(_arg5))) || (isNaN(_arg5.overshoot)))) ? 1.70158 : _arg5.overshoot;
_arg1 = (_arg1 / _arg4);
return (((((_arg3 * _arg1) * _arg1) * (((_local6 + 1) * _arg1) - _local6)) + _arg2));
}
public static function easeInQuart(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
_arg1 = (_arg1 / _arg4);
return ((((((_arg3 * _arg1) * _arg1) * _arg1) * _arg1) + _arg2));
}
public static function easeOutInQuint(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
if (_arg1 < (_arg4 / 2)){
return (easeOutQuint((_arg1 * 2), _arg2, (_arg3 / 2), _arg4, _arg5));
};
return (easeInQuint(((_arg1 * 2) - _arg4), (_arg2 + (_arg3 / 2)), (_arg3 / 2), _arg4, _arg5));
}
public static function easeOutInBounce(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
if (_arg1 < (_arg4 / 2)){
return (easeOutBounce((_arg1 * 2), _arg2, (_arg3 / 2), _arg4, _arg5));
};
return (easeInBounce(((_arg1 * 2) - _arg4), (_arg2 + (_arg3 / 2)), (_arg3 / 2), _arg4, _arg5));
}
public static function init():void{
Tweener.registerTransition("easenone", easeNone);
Tweener.registerTransition("linear", easeNone);
Tweener.registerTransition("easeinquad", easeInQuad);
Tweener.registerTransition("easeoutquad", easeOutQuad);
Tweener.registerTransition("easeinoutquad", easeInOutQuad);
Tweener.registerTransition("easeoutinquad", easeOutInQuad);
Tweener.registerTransition("easeincubic", easeInCubic);
Tweener.registerTransition("easeoutcubic", easeOutCubic);
Tweener.registerTransition("easeinoutcubic", easeInOutCubic);
Tweener.registerTransition("easeoutincubic", easeOutInCubic);
Tweener.registerTransition("easeinquart", easeInQuart);
Tweener.registerTransition("easeoutquart", easeOutQuart);
Tweener.registerTransition("easeinoutquart", easeInOutQuart);
Tweener.registerTransition("easeoutinquart", easeOutInQuart);
Tweener.registerTransition("easeinquint", easeInQuint);
Tweener.registerTransition("easeoutquint", easeOutQuint);
Tweener.registerTransition("easeinoutquint", easeInOutQuint);
Tweener.registerTransition("easeoutinquint", easeOutInQuint);
Tweener.registerTransition("easeinsine", easeInSine);
Tweener.registerTransition("easeoutsine", easeOutSine);
Tweener.registerTransition("easeinoutsine", easeInOutSine);
Tweener.registerTransition("easeoutinsine", easeOutInSine);
Tweener.registerTransition("easeincirc", easeInCirc);
Tweener.registerTransition("easeoutcirc", easeOutCirc);
Tweener.registerTransition("easeinoutcirc", easeInOutCirc);
Tweener.registerTransition("easeoutincirc", easeOutInCirc);
Tweener.registerTransition("easeinexpo", easeInExpo);
Tweener.registerTransition("easeoutexpo", easeOutExpo);
Tweener.registerTransition("easeinoutexpo", easeInOutExpo);
Tweener.registerTransition("easeoutinexpo", easeOutInExpo);
Tweener.registerTransition("easeinelastic", easeInElastic);
Tweener.registerTransition("easeoutelastic", easeOutElastic);
Tweener.registerTransition("easeinoutelastic", easeInOutElastic);
Tweener.registerTransition("easeoutinelastic", easeOutInElastic);
Tweener.registerTransition("easeinback", easeInBack);
Tweener.registerTransition("easeoutback", easeOutBack);
Tweener.registerTransition("easeinoutback", easeInOutBack);
Tweener.registerTransition("easeoutinback", easeOutInBack);
Tweener.registerTransition("easeinbounce", easeInBounce);
Tweener.registerTransition("easeoutbounce", easeOutBounce);
Tweener.registerTransition("easeinoutbounce", easeInOutBounce);
Tweener.registerTransition("easeoutinbounce", easeOutInBounce);
}
public static function easeOutExpo(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
return (((_arg1)==_arg4) ? (_arg2 + _arg3) : (((_arg3 * 1.001) * (-(Math.pow(2, ((-10 * _arg1) / _arg4))) + 1)) + _arg2));
}
public static function easeOutInBack(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
if (_arg1 < (_arg4 / 2)){
return (easeOutBack((_arg1 * 2), _arg2, (_arg3 / 2), _arg4, _arg5));
};
return (easeInBack(((_arg1 * 2) - _arg4), (_arg2 + (_arg3 / 2)), (_arg3 / 2), _arg4, _arg5));
}
public static function easeInExpo(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
return (((_arg1)==0) ? _arg2 : (((_arg3 * Math.pow(2, (10 * ((_arg1 / _arg4) - 1)))) + _arg2) - (_arg3 * 0.001)));
}
public static function easeInCubic(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
_arg1 = (_arg1 / _arg4);
return (((((_arg3 * _arg1) * _arg1) * _arg1) + _arg2));
}
public static function easeInQuint(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
_arg1 = (_arg1 / _arg4);
return (((((((_arg3 * _arg1) * _arg1) * _arg1) * _arg1) * _arg1) + _arg2));
}
public static function easeInOutCirc(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
_arg1 = (_arg1 / (_arg4 / 2));
if (_arg1 < 1){
return ((((-(_arg3) / 2) * (Math.sqrt((1 - (_arg1 * _arg1))) - 1)) + _arg2));
};
_arg1 = (_arg1 - 2);
return ((((_arg3 / 2) * (Math.sqrt((1 - (_arg1 * _arg1))) + 1)) + _arg2));
}
public static function easeInQuad(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
_arg1 = (_arg1 / _arg4);
return ((((_arg3 * _arg1) * _arg1) + _arg2));
}
public static function easeInBounce(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
return (((_arg3 - easeOutBounce((_arg4 - _arg1), 0, _arg3, _arg4)) + _arg2));
}
public static function easeOutInExpo(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
if (_arg1 < (_arg4 / 2)){
return (easeOutExpo((_arg1 * 2), _arg2, (_arg3 / 2), _arg4, _arg5));
};
return (easeInExpo(((_arg1 * 2) - _arg4), (_arg2 + (_arg3 / 2)), (_arg3 / 2), _arg4, _arg5));
}
public static function easeOutQuart(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
_arg1 = ((_arg1 / _arg4) - 1);
return (((-(_arg3) * ((((_arg1 * _arg1) * _arg1) * _arg1) - 1)) + _arg2));
}
public static function easeInSine(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
return ((((-(_arg3) * Math.cos(((_arg1 / _arg4) * (Math.PI / 2)))) + _arg3) + _arg2));
}
public static function easeInOutQuart(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
_arg1 = (_arg1 / (_arg4 / 2));
if (_arg1 < 1){
return (((((((_arg3 / 2) * _arg1) * _arg1) * _arg1) * _arg1) + _arg2));
};
_arg1 = (_arg1 - 2);
return ((((-(_arg3) / 2) * ((((_arg1 * _arg1) * _arg1) * _arg1) - 2)) + _arg2));
}
public static function easeOutQuad(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
_arg1 = (_arg1 / _arg4);
return ((((-(_arg3) * _arg1) * (_arg1 - 2)) + _arg2));
}
public static function easeOutInElastic(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
if (_arg1 < (_arg4 / 2)){
return (easeOutElastic((_arg1 * 2), _arg2, (_arg3 / 2), _arg4, _arg5));
};
return (easeInElastic(((_arg1 * 2) - _arg4), (_arg2 + (_arg3 / 2)), (_arg3 / 2), _arg4, _arg5));
}
public static function easeInElastic(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
var _local6:Number;
var _local7:Number;
var _local8:Number;
if (_arg1 == 0){
return (_arg2);
};
_arg1 = (_arg1 / _arg4);
if (_arg1 == 1){
return ((_arg2 + _arg3));
};
_local6 = (((!(Boolean(_arg5))) || (isNaN(_arg5.period)))) ? (_arg4 * 0.3) : _arg5.period;
_local8 = (((!(Boolean(_arg5))) || (isNaN(_arg5.amplitude)))) ? 0 : _arg5.amplitude;
if (((!(Boolean(_local8))) || ((_local8 < Math.abs(_arg3))))){
_local8 = _arg3;
_local7 = (_local6 / 4);
} else {
_local7 = ((_local6 / (2 * Math.PI)) * Math.asin((_arg3 / _local8)));
};
--_arg1;
return ((-(((_local8 * Math.pow(2, (10 * _arg1))) * Math.sin(((((_arg1 * _arg4) - _local7) * (2 * Math.PI)) / _local6)))) + _arg2));
}
public static function easeOutCubic(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
_arg1 = ((_arg1 / _arg4) - 1);
return (((_arg3 * (((_arg1 * _arg1) * _arg1) + 1)) + _arg2));
}
public static function easeOutQuint(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
_arg1 = ((_arg1 / _arg4) - 1);
return (((_arg3 * (((((_arg1 * _arg1) * _arg1) * _arg1) * _arg1) + 1)) + _arg2));
}
public static function easeOutInQuad(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
if (_arg1 < (_arg4 / 2)){
return (easeOutQuad((_arg1 * 2), _arg2, (_arg3 / 2), _arg4, _arg5));
};
return (easeInQuad(((_arg1 * 2) - _arg4), (_arg2 + (_arg3 / 2)), (_arg3 / 2), _arg4, _arg5));
}
public static function easeOutSine(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
return (((_arg3 * Math.sin(((_arg1 / _arg4) * (Math.PI / 2)))) + _arg2));
}
public static function easeInOutCubic(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
_arg1 = (_arg1 / (_arg4 / 2));
if (_arg1 < 1){
return ((((((_arg3 / 2) * _arg1) * _arg1) * _arg1) + _arg2));
};
_arg1 = (_arg1 - 2);
return ((((_arg3 / 2) * (((_arg1 * _arg1) * _arg1) + 2)) + _arg2));
}
public static function easeInOutQuint(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
_arg1 = (_arg1 / (_arg4 / 2));
if (_arg1 < 1){
return ((((((((_arg3 / 2) * _arg1) * _arg1) * _arg1) * _arg1) * _arg1) + _arg2));
};
_arg1 = (_arg1 - 2);
return ((((_arg3 / 2) * (((((_arg1 * _arg1) * _arg1) * _arg1) * _arg1) + 2)) + _arg2));
}
public static function easeInCirc(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
_arg1 = (_arg1 / _arg4);
return (((-(_arg3) * (Math.sqrt((1 - (_arg1 * _arg1))) - 1)) + _arg2));
}
public static function easeOutInSine(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
if (_arg1 < (_arg4 / 2)){
return (easeOutSine((_arg1 * 2), _arg2, (_arg3 / 2), _arg4, _arg5));
};
return (easeInSine(((_arg1 * 2) - _arg4), (_arg2 + (_arg3 / 2)), (_arg3 / 2), _arg4, _arg5));
}
public static function easeInOutExpo(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
if (_arg1 == 0){
return (_arg2);
};
if (_arg1 == _arg4){
return ((_arg2 + _arg3));
};
_arg1 = (_arg1 / (_arg4 / 2));
if (_arg1 < 1){
return (((((_arg3 / 2) * Math.pow(2, (10 * (_arg1 - 1)))) + _arg2) - (_arg3 * 0.0005)));
};
--_arg1;
return (((((_arg3 / 2) * 1.0005) * (-(Math.pow(2, (-10 * _arg1))) + 2)) + _arg2));
}
public static function easeOutElastic(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
var _local6:Number;
var _local7:Number;
var _local8:Number;
if (_arg1 == 0){
return (_arg2);
};
_arg1 = (_arg1 / _arg4);
if (_arg1 == 1){
return ((_arg2 + _arg3));
};
_local6 = (((!(Boolean(_arg5))) || (isNaN(_arg5.period)))) ? (_arg4 * 0.3) : _arg5.period;
_local8 = (((!(Boolean(_arg5))) || (isNaN(_arg5.amplitude)))) ? 0 : _arg5.amplitude;
if (((!(Boolean(_local8))) || ((_local8 < Math.abs(_arg3))))){
_local8 = _arg3;
_local7 = (_local6 / 4);
} else {
_local7 = ((_local6 / (2 * Math.PI)) * Math.asin((_arg3 / _local8)));
};
return (((((_local8 * Math.pow(2, (-10 * _arg1))) * Math.sin(((((_arg1 * _arg4) - _local7) * (2 * Math.PI)) / _local6))) + _arg3) + _arg2));
}
public static function easeOutCirc(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
_arg1 = ((_arg1 / _arg4) - 1);
return (((_arg3 * Math.sqrt((1 - (_arg1 * _arg1)))) + _arg2));
}
public static function easeOutInQuart(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
if (_arg1 < (_arg4 / 2)){
return (easeOutQuart((_arg1 * 2), _arg2, (_arg3 / 2), _arg4, _arg5));
};
return (easeInQuart(((_arg1 * 2) - _arg4), (_arg2 + (_arg3 / 2)), (_arg3 / 2), _arg4, _arg5));
}
public static function easeOutInCirc(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
if (_arg1 < (_arg4 / 2)){
return (easeOutCirc((_arg1 * 2), _arg2, (_arg3 / 2), _arg4, _arg5));
};
return (easeInCirc(((_arg1 * 2) - _arg4), (_arg2 + (_arg3 / 2)), (_arg3 / 2), _arg4, _arg5));
}
}
}//package com.caurina.transitions
Section 14
//PropertyInfoObj (com.caurina.transitions.PropertyInfoObj)
package com.caurina.transitions {
public class PropertyInfoObj {
public var originalValueComplete:Object;
public var modifierParameters:Array;
public var isSpecialProperty:Boolean;
public var hasModifier:Boolean;
public var valueComplete:Number;
public var extra:Object;
public var valueStart:Number;
public var modifierFunction:Function;
public var arrayIndex:Number;
public function PropertyInfoObj(_arg1:Number, _arg2:Number, _arg3:Object, _arg4:Number, _arg5:Object, _arg6:Boolean, _arg7:Function, _arg8:Array){
valueStart = _arg1;
valueComplete = _arg2;
originalValueComplete = _arg3;
arrayIndex = _arg4;
extra = _arg5;
isSpecialProperty = _arg6;
hasModifier = Boolean(_arg7);
modifierFunction = _arg7;
modifierParameters = _arg8;
}
public function toString():String{
var _local1:String;
_local1 = "\n[PropertyInfoObj ";
_local1 = (_local1 + ("valueStart:" + String(valueStart)));
_local1 = (_local1 + ", ");
_local1 = (_local1 + ("valueComplete:" + String(valueComplete)));
_local1 = (_local1 + ", ");
_local1 = (_local1 + ("originalValueComplete:" + String(originalValueComplete)));
_local1 = (_local1 + ", ");
_local1 = (_local1 + ("arrayIndex:" + String(arrayIndex)));
_local1 = (_local1 + ", ");
_local1 = (_local1 + ("extra:" + String(extra)));
_local1 = (_local1 + ", ");
_local1 = (_local1 + ("isSpecialProperty:" + String(isSpecialProperty)));
_local1 = (_local1 + ", ");
_local1 = (_local1 + ("hasModifier:" + String(hasModifier)));
_local1 = (_local1 + ", ");
_local1 = (_local1 + ("modifierFunction:" + String(modifierFunction)));
_local1 = (_local1 + ", ");
_local1 = (_local1 + ("modifierParameters:" + String(modifierParameters)));
_local1 = (_local1 + "]\n");
return (_local1);
}
public function clone():PropertyInfoObj{
var _local1:PropertyInfoObj;
_local1 = new PropertyInfoObj(valueStart, valueComplete, originalValueComplete, arrayIndex, extra, isSpecialProperty, modifierFunction, modifierParameters);
return (_local1);
}
}
}//package com.caurina.transitions
Section 15
//SpecialProperty (com.caurina.transitions.SpecialProperty)
package com.caurina.transitions {
public class SpecialProperty {
public var parameters:Array;
public var preProcess:Function;
public var setValue:Function;
public var getValue:Function;
public function SpecialProperty(_arg1:Function, _arg2:Function, _arg3:Array=null, _arg4:Function=null){
getValue = _arg1;
setValue = _arg2;
parameters = _arg3;
preProcess = _arg4;
}
public function toString():String{
var _local1:String;
_local1 = "";
_local1 = (_local1 + "[SpecialProperty ");
_local1 = (_local1 + ("getValue:" + String(getValue)));
_local1 = (_local1 + ", ");
_local1 = (_local1 + ("setValue:" + String(setValue)));
_local1 = (_local1 + ", ");
_local1 = (_local1 + ("parameters:" + String(parameters)));
_local1 = (_local1 + ", ");
_local1 = (_local1 + ("preProcess:" + String(preProcess)));
_local1 = (_local1 + "]");
return (_local1);
}
}
}//package com.caurina.transitions
Section 16
//SpecialPropertyModifier (com.caurina.transitions.SpecialPropertyModifier)
package com.caurina.transitions {
public class SpecialPropertyModifier {
public var getValue:Function;
public var modifyValues:Function;
public function SpecialPropertyModifier(_arg1:Function, _arg2:Function){
modifyValues = _arg1;
getValue = _arg2;
}
public function toString():String{
var _local1:String;
_local1 = "";
_local1 = (_local1 + "[SpecialPropertyModifier ");
_local1 = (_local1 + ("modifyValues:" + String(modifyValues)));
_local1 = (_local1 + ", ");
_local1 = (_local1 + ("getValue:" + String(getValue)));
_local1 = (_local1 + "]");
return (_local1);
}
}
}//package com.caurina.transitions
Section 17
//SpecialPropertySplitter (com.caurina.transitions.SpecialPropertySplitter)
package com.caurina.transitions {
public class SpecialPropertySplitter {
public var parameters:Array;
public var splitValues:Function;
public function SpecialPropertySplitter(_arg1:Function, _arg2:Array){
splitValues = _arg1;
parameters = _arg2;
}
public function toString():String{
var _local1:String;
_local1 = "";
_local1 = (_local1 + "[SpecialPropertySplitter ");
_local1 = (_local1 + ("splitValues:" + String(splitValues)));
_local1 = (_local1 + ", ");
_local1 = (_local1 + ("parameters:" + String(parameters)));
_local1 = (_local1 + "]");
return (_local1);
}
}
}//package com.caurina.transitions
Section 18
//Tweener (com.caurina.transitions.Tweener)
package com.caurina.transitions {
import flash.display.*;
import flash.events.*;
import flash.utils.*;
public class Tweener {
private static var _timeScale:Number = 1;
private static var _currentTimeFrame:Number;
private static var _specialPropertySplitterList:Object;
private static var _engineExists:Boolean = false;
private static var _specialPropertyModifierList:Object;
private static var _currentTime:Number;
private static var _tweenList:Array;
private static var _specialPropertyList:Object;
private static var _transitionList:Object;
private static var _inited:Boolean = false;
private static var __tweener_controller__:MovieClip;
public function Tweener(){
trace("Tweener is a static class and should not be instantiated.");
}
public static function registerSpecialPropertyModifier(_arg1:String, _arg2:Function, _arg3:Function):void{
var _local4:SpecialPropertyModifier;
if (!_inited){
init();
};
_local4 = new SpecialPropertyModifier(_arg2, _arg3);
_specialPropertyModifierList[_arg1] = _local4;
}
public static function registerSpecialProperty(_arg1:String, _arg2:Function, _arg3:Function, _arg4:Array=null, _arg5:Function=null):void{
var _local6:SpecialProperty;
if (!_inited){
init();
};
_local6 = new SpecialProperty(_arg2, _arg3, _arg4, _arg5);
_specialPropertyList[_arg1] = _local6;
}
public static function init(... _args):void{
_inited = true;
_transitionList = new Object();
Equations.init();
_specialPropertyList = new Object();
_specialPropertyModifierList = new Object();
_specialPropertySplitterList = new Object();
}
private static function updateTweens():Boolean{
var _local1:int;
if (_tweenList.length == 0){
return (false);
};
_local1 = 0;
while (_local1 < _tweenList.length) {
if ((((_tweenList[_local1] == undefined)) || (!(_tweenList[_local1].isPaused)))){
if (!updateTweenByIndex(_local1)){
removeTweenByIndex(_local1);
};
if (_tweenList[_local1] == null){
removeTweenByIndex(_local1, true);
_local1--;
};
};
_local1++;
};
return (true);
}
public static function addCaller(_arg1:Object=null, _arg2:Object=null):Boolean{
var _local3:Number;
var _local4:Array;
var _local5:Object;
var _local6:Number;
var _local7:Number;
var _local8:Function;
var _local9:TweenListObj;
var _local10:Number;
var _local11:String;
if (!Boolean(_arg1)){
return (false);
};
if ((_arg1 is Array)){
_local4 = _arg1.concat();
} else {
_local4 = [_arg1];
};
_local5 = _arg2;
if (!_inited){
init();
};
if (((!(_engineExists)) || (!(Boolean(__tweener_controller__))))){
startEngine();
};
_local6 = (isNaN(_local5.time)) ? 0 : _local5.time;
_local7 = (isNaN(_local5.delay)) ? 0 : _local5.delay;
if (typeof(_local5.transition) == "string"){
_local11 = _local5.transition.toLowerCase();
_local8 = _transitionList[_local11];
} else {
_local8 = _local5.transition;
};
if (!Boolean(_local8)){
_local8 = _transitionList["easeoutexpo"];
};
_local3 = 0;
while (_local3 < _local4.length) {
if (_local5.useFrames == true){
_local9 = new TweenListObj(_local4[_local3], (_currentTimeFrame + (_local7 / _timeScale)), (_currentTimeFrame + ((_local7 + _local6) / _timeScale)), true, _local8, _local5.transitionParams);
} else {
_local9 = new TweenListObj(_local4[_local3], (_currentTime + ((_local7 * 1000) / _timeScale)), (_currentTime + (((_local7 * 1000) + (_local6 * 1000)) / _timeScale)), false, _local8, _local5.transitionParams);
};
_local9.properties = null;
_local9.onStart = _local5.onStart;
_local9.onUpdate = _local5.onUpdate;
_local9.onComplete = _local5.onComplete;
_local9.onOverwrite = _local5.onOverwrite;
_local9.onStartParams = _local5.onStartParams;
_local9.onUpdateParams = _local5.onUpdateParams;
_local9.onCompleteParams = _local5.onCompleteParams;
_local9.onOverwriteParams = _local5.onOverwriteParams;
_local9.onStartScope = _local5.onStartScope;
_local9.onUpdateScope = _local5.onUpdateScope;
_local9.onCompleteScope = _local5.onCompleteScope;
_local9.onOverwriteScope = _local5.onOverwriteScope;
_local9.onErrorScope = _local5.onErrorScope;
_local9.isCaller = true;
_local9.count = _local5.count;
_local9.waitFrames = _local5.waitFrames;
_tweenList.push(_local9);
if ((((_local6 == 0)) && ((_local7 == 0)))){
_local10 = (_tweenList.length - 1);
updateTweenByIndex(_local10);
removeTweenByIndex(_local10);
};
_local3++;
};
return (true);
}
public static function pauseAllTweens():Boolean{
var _local1:Boolean;
var _local2:uint;
if (!Boolean(_tweenList)){
return (false);
};
_local1 = false;
_local2 = 0;
while (_local2 < _tweenList.length) {
pauseTweenByIndex(_local2);
_local1 = true;
_local2++;
};
return (_local1);
}
public static function removeTweens(_arg1:Object, ... _args):Boolean{
var _local3:Array;
var _local4:uint;
_local3 = new Array();
_local4 = 0;
while (_local4 < _args.length) {
if ((((typeof(_args[_local4]) == "string")) && (!(AuxFunctions.isInArray(_args[_local4], _local3))))){
_local3.push(_args[_local4]);
};
_local4++;
};
return (affectTweens(removeTweenByIndex, _arg1, _local3));
}
public static function splitTweens(_arg1:Number, _arg2:Array):uint{
var _local3:TweenListObj;
var _local4:TweenListObj;
var _local5:uint;
var _local6:String;
var _local7:Boolean;
_local3 = _tweenList[_arg1];
_local4 = _local3.clone(false);
_local5 = 0;
while (_local5 < _arg2.length) {
_local6 = _arg2[_local5];
if (Boolean(_local3.properties[_local6])){
_local3.properties[_local6] = undefined;
delete _local3.properties[_local6];
};
_local5++;
};
for (_local6 in _local4.properties) {
_local7 = false;
_local5 = 0;
while (_local5 < _arg2.length) {
if (_arg2[_local5] == _local6){
_local7 = true;
break;
};
_local5++;
};
if (!_local7){
_local4.properties[_local6] = undefined;
delete _local4.properties[_local6];
};
};
_tweenList.push(_local4);
return ((_tweenList.length - 1));
}
public static function updateFrame():void{
_currentTimeFrame++;
}
public static function resumeTweenByIndex(_arg1:Number):Boolean{
var _local2:TweenListObj;
var _local3:Number;
_local2 = _tweenList[_arg1];
if ((((_local2 == null)) || (!(_local2.isPaused)))){
return (false);
};
_local3 = getCurrentTweeningTime(_local2);
_local2.timeStart = (_local2.timeStart + (_local3 - _local2.timePaused));
_local2.timeComplete = (_local2.timeComplete + (_local3 - _local2.timePaused));
_local2.timePaused = undefined;
_local2.isPaused = false;
return (true);
}
public static function getVersion():String{
return ("AS3 1.31.71");
}
public static function onEnterFrame(_arg1:Event):void{
var _local2:Boolean;
updateTime();
updateFrame();
_local2 = false;
_local2 = updateTweens();
if (!_local2){
stopEngine();
};
}
public static function updateTime():void{
_currentTime = getTimer();
}
private static function updateTweenByIndex(_arg1:Number):Boolean{
var tTweening:TweenListObj;
var isOver:Boolean;
var mustUpdate:Boolean;
var nv:Number;
var t:Number;
var b:Number;
var c:Number;
var d:Number;
var pName:String;
var eventScope:Object;
var tScope:Object;
var cTime:Number;
var tProperty:Object;
var pv:Number;
var i = _arg1;
tTweening = _tweenList[i];
if ((((tTweening == null)) || (!(Boolean(tTweening.scope))))){
return (false);
};
isOver = false;
cTime = getCurrentTweeningTime(tTweening);
if (cTime >= tTweening.timeStart){
tScope = tTweening.scope;
if (tTweening.isCaller){
do {
t = (((tTweening.timeComplete - tTweening.timeStart) / tTweening.count) * (tTweening.timesCalled + 1));
b = tTweening.timeStart;
c = (tTweening.timeComplete - tTweening.timeStart);
d = (tTweening.timeComplete - tTweening.timeStart);
nv = tTweening.transition(t, b, c, d);
} while (!(cTime >= nv));
} else {
mustUpdate = (((((tTweening.skipUpdates < 1)) || (!(tTweening.skipUpdates)))) || ((tTweening.updatesSkipped >= tTweening.skipUpdates)));
if (cTime >= tTweening.timeComplete){
isOver = true;
mustUpdate = true;
};
if (!tTweening.hasStarted){
if (Boolean(tTweening.onStart)){
eventScope = (Boolean(tTweening.onStartScope)) ? tTweening.onStartScope : tScope;
try {
tTweening.onStart.apply(eventScope, tTweening.onStartParams);
} catch(e:Error) {
handleError(tTweening, e, "onStart");
};
};
for (pName in tTweening.properties) {
if (tTweening.properties[pName].isSpecialProperty){
if (Boolean(_specialPropertyList[pName].preProcess)){
tTweening.properties[pName].valueComplete = _specialPropertyList[pName].preProcess(tScope, _specialPropertyList[pName].parameters, tTweening.properties[pName].originalValueComplete, tTweening.properties[pName].extra);
};
pv = _specialPropertyList[pName].getValue(tScope, _specialPropertyList[pName].parameters, tTweening.properties[pName].extra);
} else {
pv = tScope[pName];
};
tTweening.properties[pName].valueStart = (isNaN(pv)) ? tTweening.properties[pName].valueComplete : pv;
};
mustUpdate = true;
tTweening.hasStarted = true;
};
if (mustUpdate){
for (pName in tTweening.properties) {
tProperty = tTweening.properties[pName];
if (isOver){
nv = tProperty.valueComplete;
} else {
if (tProperty.hasModifier){
t = (cTime - tTweening.timeStart);
d = (tTweening.timeComplete - tTweening.timeStart);
nv = tTweening.transition(t, 0, 1, d, tTweening.transitionParams);
nv = tProperty.modifierFunction(tProperty.valueStart, tProperty.valueComplete, nv, tProperty.modifierParameters);
} else {
t = (cTime - tTweening.timeStart);
b = tProperty.valueStart;
c = (tProperty.valueComplete - tProperty.valueStart);
d = (tTweening.timeComplete - tTweening.timeStart);
nv = tTweening.transition(t, b, c, d, tTweening.transitionParams);
};
};
if (tTweening.rounded){
nv = Math.round(nv);
};
if (tProperty.isSpecialProperty){
_specialPropertyList[pName].setValue(tScope, nv, _specialPropertyList[pName].parameters, tTweening.properties[pName].extra);
} else {
tScope[pName] = nv;
};
};
tTweening.updatesSkipped = 0;
if (Boolean(tTweening.onUpdate)){
eventScope = (Boolean(tTweening.onUpdateScope)) ? tTweening.onUpdateScope : tScope;
try {
tTweening.onUpdate.apply(eventScope, tTweening.onUpdateParams);
} catch(e:Error) {
handleError(tTweening, e, "onUpdate");
};
};
} else {
tTweening.updatesSkipped++;
};
};
if (((isOver) && (Boolean(tTweening.onComplete)))){
eventScope = (Boolean(tTweening.onCompleteScope)) ? tTweening.onCompleteScope : tScope;
try {
tTweening.onComplete.apply(eventScope, tTweening.onCompleteParams);
} catch(e:Error) {
handleError(tTweening, e, "onComplete");
};
};
return (!(isOver));
};
return (true);
}
public static function setTimeScale(_arg1:Number):void{
var _local2:Number;
var _local3:Number;
if (isNaN(_arg1)){
_arg1 = 1;
};
if (_arg1 < 1E-5){
_arg1 = 1E-5;
};
if (_arg1 != _timeScale){
if (_tweenList != null){
_local2 = 0;
while (_local2 < _tweenList.length) {
_local3 = getCurrentTweeningTime(_tweenList[_local2]);
_tweenList[_local2].timeStart = (_local3 - (((_local3 - _tweenList[_local2].timeStart) * _timeScale) / _arg1));
_tweenList[_local2].timeComplete = (_local3 - (((_local3 - _tweenList[_local2].timeComplete) * _timeScale) / _arg1));
if (_tweenList[_local2].timePaused != undefined){
_tweenList[_local2].timePaused = (_local3 - (((_local3 - _tweenList[_local2].timePaused) * _timeScale) / _arg1));
};
_local2++;
};
};
_timeScale = _arg1;
};
}
public static function resumeAllTweens():Boolean{
var _local1:Boolean;
var _local2:uint;
if (!Boolean(_tweenList)){
return (false);
};
_local1 = false;
_local2 = 0;
while (_local2 < _tweenList.length) {
resumeTweenByIndex(_local2);
_local1 = true;
_local2++;
};
return (_local1);
}
private static function handleError(_arg1:TweenListObj, _arg2:Error, _arg3:String):void{
var eventScope:Object;
var pTweening = _arg1;
var pError = _arg2;
var pCallBackName = _arg3;
if (((Boolean(pTweening.onError)) && ((pTweening.onError is Function)))){
eventScope = (Boolean(pTweening.onErrorScope)) ? pTweening.onErrorScope : pTweening.scope;
try {
pTweening.onError.apply(eventScope, [pTweening.scope, pError]);
} catch(metaError:Error) {
printError(((((String(pTweening.scope) + " raised an error while executing the 'onError' handler. Original error:\n ") + pError.getStackTrace()) + "\nonError error: ") + metaError.getStackTrace()));
};
} else {
if (!Boolean(pTweening.onError)){
printError(((((String(pTweening.scope) + " raised an error while executing the '") + pCallBackName) + "'handler. \n") + pError.getStackTrace()));
};
};
}
private static function startEngine():void{
_engineExists = true;
_tweenList = new Array();
__tweener_controller__ = new MovieClip();
__tweener_controller__.addEventListener(Event.ENTER_FRAME, _slot1.onEnterFrame);
_currentTimeFrame = 0;
updateTime();
}
public static function removeAllTweens():Boolean{
var _local1:Boolean;
var _local2:uint;
if (!Boolean(_tweenList)){
return (false);
};
_local1 = false;
_local2 = 0;
while (_local2 < _tweenList.length) {
removeTweenByIndex(_local2);
_local1 = true;
_local2++;
};
return (_local1);
}
public static function addTween(_arg1:Object=null, _arg2:Object=null):Boolean{
var _local3:Number;
var _local4:Number;
var _local5:String;
var _local6:Array;
var _local7:Object;
var _local8:Number;
var _local9:Number;
var _local10:Array;
var _local11:Object;
var _local12:Object;
var _local13:Function;
var _local14:Object;
var _local15:TweenListObj;
var _local16:Number;
var _local17:Array;
var _local18:Array;
var _local19:Array;
var _local20:String;
if (!Boolean(_arg1)){
return (false);
};
if ((_arg1 is Array)){
_local6 = _arg1.concat();
} else {
_local6 = [_arg1];
};
_local7 = TweenListObj.makePropertiesChain(_arg2);
if (!_inited){
init();
};
if (((!(_engineExists)) || (!(Boolean(__tweener_controller__))))){
startEngine();
};
_local8 = (isNaN(_local7.time)) ? 0 : _local7.time;
_local9 = (isNaN(_local7.delay)) ? 0 : _local7.delay;
_local10 = new Array();
_local11 = {time:true, delay:true, useFrames:true, skipUpdates:true, transition:true, transitionParams:true, onStart:true, onUpdate:true, onComplete:true, onOverwrite:true, onError:true, rounded:true, onStartParams:true, onUpdateParams:true, onCompleteParams:true, onOverwriteParams:true, onStartScope:true, onUpdateScope:true, onCompleteScope:true, onOverwriteScope:true, onErrorScope:true};
_local12 = new Object();
for (_local5 in _local7) {
if (!_local11[_local5]){
if (_specialPropertySplitterList[_local5]){
_local17 = _specialPropertySplitterList[_local5].splitValues(_local7[_local5], _specialPropertySplitterList[_local5].parameters);
_local3 = 0;
while (_local3 < _local17.length) {
if (_specialPropertySplitterList[_local17[_local3].name]){
_local18 = _specialPropertySplitterList[_local17[_local3].name].splitValues(_local17[_local3].value, _specialPropertySplitterList[_local17[_local3].name].parameters);
_local4 = 0;
while (_local4 < _local18.length) {
_local10[_local18[_local4].name] = {valueStart:undefined, valueComplete:_local18[_local4].value, arrayIndex:_local18[_local4].arrayIndex, isSpecialProperty:false};
_local4++;
};
} else {
_local10[_local17[_local3].name] = {valueStart:undefined, valueComplete:_local17[_local3].value, arrayIndex:_local17[_local3].arrayIndex, isSpecialProperty:false};
};
_local3++;
};
} else {
if (_specialPropertyModifierList[_local5] != undefined){
_local19 = _specialPropertyModifierList[_local5].modifyValues(_local7[_local5]);
_local3 = 0;
while (_local3 < _local19.length) {
_local12[_local19[_local3].name] = {modifierParameters:_local19[_local3].parameters, modifierFunction:_specialPropertyModifierList[_local5].getValue};
_local3++;
};
} else {
_local10[_local5] = {valueStart:undefined, valueComplete:_local7[_local5]};
};
};
};
};
for (_local5 in _local10) {
if (_specialPropertyList[_local5] != undefined){
_local10[_local5].isSpecialProperty = true;
} else {
if (_local6[0][_local5] == undefined){
printError((((("The property '" + _local5) + "' doesn't seem to be a normal object property of ") + String(_local6[0])) + " or a registered special property."));
};
};
};
for (_local5 in _local12) {
if (_local10[_local5] != undefined){
_local10[_local5].modifierParameters = _local12[_local5].modifierParameters;
_local10[_local5].modifierFunction = _local12[_local5].modifierFunction;
};
};
if (typeof(_local7.transition) == "string"){
_local20 = _local7.transition.toLowerCase();
_local13 = _transitionList[_local20];
} else {
_local13 = _local7.transition;
};
if (!Boolean(_local13)){
_local13 = _transitionList["easeoutexpo"];
};
_local3 = 0;
while (_local3 < _local6.length) {
_local14 = new Object();
for (_local5 in _local10) {
_local14[_local5] = new PropertyInfoObj(_local10[_local5].valueStart, _local10[_local5].valueComplete, _local10[_local5].valueComplete, _local10[_local5].arrayIndex, {}, _local10[_local5].isSpecialProperty, _local10[_local5].modifierFunction, _local10[_local5].modifierParameters);
};
if (_local7.useFrames == true){
_local15 = new TweenListObj(_local6[_local3], (_currentTimeFrame + (_local9 / _timeScale)), (_currentTimeFrame + ((_local9 + _local8) / _timeScale)), true, _local13, _local7.transitionParams);
} else {
_local15 = new TweenListObj(_local6[_local3], (_currentTime + ((_local9 * 1000) / _timeScale)), (_currentTime + (((_local9 * 1000) + (_local8 * 1000)) / _timeScale)), false, _local13, _local7.transitionParams);
};
_local15.properties = _local14;
_local15.onStart = _local7.onStart;
_local15.onUpdate = _local7.onUpdate;
_local15.onComplete = _local7.onComplete;
_local15.onOverwrite = _local7.onOverwrite;
_local15.onError = _local7.onError;
_local15.onStartParams = _local7.onStartParams;
_local15.onUpdateParams = _local7.onUpdateParams;
_local15.onCompleteParams = _local7.onCompleteParams;
_local15.onOverwriteParams = _local7.onOverwriteParams;
_local15.onStartScope = _local7.onStartScope;
_local15.onUpdateScope = _local7.onUpdateScope;
_local15.onCompleteScope = _local7.onCompleteScope;
_local15.onOverwriteScope = _local7.onOverwriteScope;
_local15.onErrorScope = _local7.onErrorScope;
_local15.rounded = _local7.rounded;
_local15.skipUpdates = _local7.skipUpdates;
removeTweensByTime(_local15.scope, _local15.properties, _local15.timeStart, _local15.timeComplete);
_tweenList.push(_local15);
if ((((_local8 == 0)) && ((_local9 == 0)))){
_local16 = (_tweenList.length - 1);
updateTweenByIndex(_local16);
removeTweenByIndex(_local16);
};
_local3++;
};
return (true);
}
public static function registerTransition(_arg1:String, _arg2:Function):void{
if (!_inited){
init();
};
_transitionList[_arg1] = _arg2;
}
public static function printError(_arg1:String):void{
trace(("## [Tweener] Error: " + _arg1));
}
private static function affectTweens(_arg1:Function, _arg2:Object, _arg3:Array):Boolean{
var _local4:Boolean;
var _local5:uint;
var _local6:Array;
var _local7:uint;
var _local8:uint;
var _local9:uint;
_local4 = false;
if (!Boolean(_tweenList)){
return (false);
};
_local5 = 0;
while (_local5 < _tweenList.length) {
if (((_tweenList[_local5]) && ((_tweenList[_local5].scope == _arg2)))){
if (_arg3.length == 0){
_arg1(_local5);
_local4 = true;
} else {
_local6 = new Array();
_local7 = 0;
while (_local7 < _arg3.length) {
if (Boolean(_tweenList[_local5].properties[_arg3[_local7]])){
_local6.push(_arg3[_local7]);
};
_local7++;
};
if (_local6.length > 0){
_local8 = AuxFunctions.getObjectLength(_tweenList[_local5].properties);
if (_local8 == _local6.length){
_arg1(_local5);
_local4 = true;
} else {
_local9 = splitTweens(_local5, _local6);
_arg1(_local9);
_local4 = true;
};
};
};
};
_local5++;
};
return (_local4);
}
public static function getTweens(_arg1:Object):Array{
var _local2:uint;
var _local3:String;
var _local4:Array;
if (!Boolean(_tweenList)){
return ([]);
};
_local4 = new Array();
_local2 = 0;
while (_local2 < _tweenList.length) {
if (((Boolean(_tweenList[_local2])) && ((_tweenList[_local2].scope == _arg1)))){
for (_local3 in _tweenList[_local2].properties) {
_local4.push(_local3);
};
};
_local2++;
};
return (_local4);
}
public static function isTweening(_arg1:Object):Boolean{
var _local2:uint;
if (!Boolean(_tweenList)){
return (false);
};
_local2 = 0;
while (_local2 < _tweenList.length) {
if (((Boolean(_tweenList[_local2])) && ((_tweenList[_local2].scope == _arg1)))){
return (true);
};
_local2++;
};
return (false);
}
public static function pauseTweenByIndex(_arg1:Number):Boolean{
var _local2:TweenListObj;
_local2 = _tweenList[_arg1];
if ((((_local2 == null)) || (_local2.isPaused))){
return (false);
};
_local2.timePaused = getCurrentTweeningTime(_local2);
_local2.isPaused = true;
return (true);
}
public static function getCurrentTweeningTime(_arg1:Object):Number{
return ((_arg1.useFrames) ? _currentTimeFrame : _currentTime);
}
public static function getTweenCount(_arg1:Object):Number{
var _local2:uint;
var _local3:Number;
if (!Boolean(_tweenList)){
return (0);
};
_local3 = 0;
_local2 = 0;
while (_local2 < _tweenList.length) {
if (((Boolean(_tweenList[_local2])) && ((_tweenList[_local2].scope == _arg1)))){
_local3 = (_local3 + AuxFunctions.getObjectLength(_tweenList[_local2].properties));
};
_local2++;
};
return (_local3);
}
private static function stopEngine():void{
_engineExists = false;
_tweenList = null;
_currentTime = 0;
_currentTimeFrame = 0;
__tweener_controller__.removeEventListener(Event.ENTER_FRAME, _slot1.onEnterFrame);
__tweener_controller__ = null;
}
public static function removeTweensByTime(_arg1:Object, _arg2:Object, _arg3:Number, _arg4:Number):Boolean{
var removed:Boolean;
var removedLocally:Boolean;
var i:uint;
var tl:uint;
var pName:String;
var eventScope:Object;
var p_scope = _arg1;
var p_properties = _arg2;
var p_timeStart = _arg3;
var p_timeComplete = _arg4;
removed = false;
tl = _tweenList.length;
i = 0;
while (i < tl) {
if (((Boolean(_tweenList[i])) && ((p_scope == _tweenList[i].scope)))){
if ((((p_timeComplete > _tweenList[i].timeStart)) && ((p_timeStart < _tweenList[i].timeComplete)))){
removedLocally = false;
for (pName in _tweenList[i].properties) {
if (Boolean(p_properties[pName])){
if (Boolean(_tweenList[i].onOverwrite)){
eventScope = (Boolean(_tweenList[i].onOverwriteScope)) ? _tweenList[i].onOverwriteScope : _tweenList[i].scope;
try {
_tweenList[i].onOverwrite.apply(eventScope, _tweenList[i].onOverwriteParams);
} catch(e:Error) {
handleError(_tweenList[i], e, "onOverwrite");
};
};
_tweenList[i].properties[pName] = undefined;
delete _tweenList[i].properties[pName];
removedLocally = true;
removed = true;
};
};
if (removedLocally){
if (AuxFunctions.getObjectLength(_tweenList[i].properties) == 0){
removeTweenByIndex(i);
};
};
};
};
i = (i + 1);
};
return (removed);
}
public static function registerSpecialPropertySplitter(_arg1:String, _arg2:Function, _arg3:Array=null):void{
var _local4:SpecialPropertySplitter;
if (!_inited){
init();
};
_local4 = new SpecialPropertySplitter(_arg2, _arg3);
_specialPropertySplitterList[_arg1] = _local4;
}
public static function removeTweenByIndex(_arg1:Number, _arg2:Boolean=false):Boolean{
_tweenList[_arg1] = null;
if (_arg2){
_tweenList.splice(_arg1, 1);
};
return (true);
}
public static function resumeTweens(_arg1:Object, ... _args):Boolean{
var _local3:Array;
var _local4:uint;
_local3 = new Array();
_local4 = 0;
while (_local4 < _args.length) {
if ((((typeof(_args[_local4]) == "string")) && (!(AuxFunctions.isInArray(_args[_local4], _local3))))){
_local3.push(_args[_local4]);
};
_local4++;
};
return (affectTweens(resumeTweenByIndex, _arg1, _local3));
}
public static function pauseTweens(_arg1:Object, ... _args):Boolean{
var _local3:Array;
var _local4:uint;
_local3 = new Array();
_local4 = 0;
while (_local4 < _args.length) {
if ((((typeof(_args[_local4]) == "string")) && (!(AuxFunctions.isInArray(_args[_local4], _local3))))){
_local3.push(_args[_local4]);
};
_local4++;
};
return (affectTweens(pauseTweenByIndex, _arg1, _local3));
}
}
}//package com.caurina.transitions
Section 19
//TweenListObj (com.caurina.transitions.TweenListObj)
package com.caurina.transitions {
public class TweenListObj {
public var onUpdate:Function;
public var useFrames:Boolean;
public var hasStarted:Boolean;
public var onOverwriteParams:Array;
public var timeStart:Number;
public var count:Number;
public var timeComplete:Number;
public var onStartParams:Array;
public var onUpdateScope:Object;
public var rounded:Boolean;
public var onUpdateParams:Array;
public var properties:Object;
public var onComplete:Function;
public var transitionParams:Object;
public var updatesSkipped:Number;
public var onStart:Function;
public var onOverwriteScope:Object;
public var skipUpdates:Number;
public var onStartScope:Object;
public var scope:Object;
public var transition:Function;
public var timePaused:Number;
public var onCompleteParams:Array;
public var timesCalled:Number;
public var isCaller:Boolean;
public var onError:Function;
public var onErrorScope:Object;
public var onOverwrite:Function;
public var isPaused:Boolean;
public var waitFrames:Boolean;
public var onCompleteScope:Object;
public function TweenListObj(_arg1:Object, _arg2:Number, _arg3:Number, _arg4:Boolean, _arg5:Function, _arg6:Object){
scope = _arg1;
timeStart = _arg2;
timeComplete = _arg3;
useFrames = _arg4;
transition = _arg5;
transitionParams = _arg6;
properties = new Object();
isPaused = false;
timePaused = undefined;
isCaller = false;
updatesSkipped = 0;
timesCalled = 0;
skipUpdates = 0;
hasStarted = false;
}
public function clone(_arg1:Boolean):TweenListObj{
var _local2:TweenListObj;
var _local3:String;
_local2 = new TweenListObj(scope, timeStart, timeComplete, useFrames, transition, transitionParams);
_local2.properties = new Array();
for (_local3 in properties) {
_local2.properties[_local3] = properties[_local3].clone();
};
_local2.skipUpdates = skipUpdates;
_local2.updatesSkipped = updatesSkipped;
if (!_arg1){
_local2.onStart = onStart;
_local2.onUpdate = onUpdate;
_local2.onComplete = onComplete;
_local2.onOverwrite = onOverwrite;
_local2.onError = onError;
_local2.onStartParams = onStartParams;
_local2.onUpdateParams = onUpdateParams;
_local2.onCompleteParams = onCompleteParams;
_local2.onOverwriteParams = onOverwriteParams;
_local2.onStartScope = onStartScope;
_local2.onUpdateScope = onUpdateScope;
_local2.onCompleteScope = onCompleteScope;
_local2.onOverwriteScope = onOverwriteScope;
_local2.onErrorScope = onErrorScope;
};
_local2.rounded = rounded;
_local2.isPaused = isPaused;
_local2.timePaused = timePaused;
_local2.isCaller = isCaller;
_local2.count = count;
_local2.timesCalled = timesCalled;
_local2.waitFrames = waitFrames;
_local2.hasStarted = hasStarted;
return (_local2);
}
public function toString():String{
var _local1:String;
var _local2:Boolean;
var _local3:String;
_local1 = "\n[TweenListObj ";
_local1 = (_local1 + ("scope:" + String(scope)));
_local1 = (_local1 + ", properties:");
_local2 = true;
for (_local3 in properties) {
if (!_local2){
_local1 = (_local1 + ",");
};
_local1 = (_local1 + ("[name:" + properties[_local3].name));
_local1 = (_local1 + (",valueStart:" + properties[_local3].valueStart));
_local1 = (_local1 + (",valueComplete:" + properties[_local3].valueComplete));
_local1 = (_local1 + "]");
_local2 = false;
};
_local1 = (_local1 + (", timeStart:" + String(timeStart)));
_local1 = (_local1 + (", timeComplete:" + String(timeComplete)));
_local1 = (_local1 + (", useFrames:" + String(useFrames)));
_local1 = (_local1 + (", transition:" + String(transition)));
_local1 = (_local1 + (", transitionParams:" + String(transitionParams)));
if (skipUpdates){
_local1 = (_local1 + (", skipUpdates:" + String(skipUpdates)));
};
if (updatesSkipped){
_local1 = (_local1 + (", updatesSkipped:" + String(updatesSkipped)));
};
if (Boolean(onStart)){
_local1 = (_local1 + (", onStart:" + String(onStart)));
};
if (Boolean(onUpdate)){
_local1 = (_local1 + (", onUpdate:" + String(onUpdate)));
};
if (Boolean(onComplete)){
_local1 = (_local1 + (", onComplete:" + String(onComplete)));
};
if (Boolean(onOverwrite)){
_local1 = (_local1 + (", onOverwrite:" + String(onOverwrite)));
};
if (Boolean(onError)){
_local1 = (_local1 + (", onError:" + String(onError)));
};
if (onStartParams){
_local1 = (_local1 + (", onStartParams:" + String(onStartParams)));
};
if (onUpdateParams){
_local1 = (_local1 + (", onUpdateParams:" + String(onUpdateParams)));
};
if (onCompleteParams){
_local1 = (_local1 + (", onCompleteParams:" + String(onCompleteParams)));
};
if (onOverwriteParams){
_local1 = (_local1 + (", onOverwriteParams:" + String(onOverwriteParams)));
};
if (onStartScope){
_local1 = (_local1 + (", onStartScope:" + String(onStartScope)));
};
if (onUpdateScope){
_local1 = (_local1 + (", onUpdateScope:" + String(onUpdateScope)));
};
if (onCompleteScope){
_local1 = (_local1 + (", onCompleteScope:" + String(onCompleteScope)));
};
if (onOverwriteScope){
_local1 = (_local1 + (", onOverwriteScope:" + String(onOverwriteScope)));
};
if (onErrorScope){
_local1 = (_local1 + (", onErrorScope:" + String(onErrorScope)));
};
if (rounded){
_local1 = (_local1 + (", rounded:" + String(rounded)));
};
if (isPaused){
_local1 = (_local1 + (", isPaused:" + String(isPaused)));
};
if (timePaused){
_local1 = (_local1 + (", timePaused:" + String(timePaused)));
};
if (isCaller){
_local1 = (_local1 + (", isCaller:" + String(isCaller)));
};
if (count){
_local1 = (_local1 + (", count:" + String(count)));
};
if (timesCalled){
_local1 = (_local1 + (", timesCalled:" + String(timesCalled)));
};
if (waitFrames){
_local1 = (_local1 + (", waitFrames:" + String(waitFrames)));
};
if (hasStarted){
_local1 = (_local1 + (", hasStarted:" + String(hasStarted)));
};
_local1 = (_local1 + "]\n");
return (_local1);
}
public static function makePropertiesChain(_arg1:Object):Object{
var _local2:Object;
var _local3:Object;
var _local4:Object;
var _local5:Object;
var _local6:Number;
var _local7:Number;
var _local8:Number;
_local2 = _arg1.base;
if (_local2){
_local3 = {};
if ((_local2 is Array)){
_local4 = [];
_local8 = 0;
while (_local8 < _local2.length) {
_local4.push(_local2[_local8]);
_local8++;
};
} else {
_local4 = [_local2];
};
_local4.push(_arg1);
_local6 = _local4.length;
_local7 = 0;
while (_local7 < _local6) {
if (_local4[_local7]["base"]){
_local5 = AuxFunctions.concatObjects(makePropertiesChain(_local4[_local7]["base"]), _local4[_local7]);
} else {
_local5 = _local4[_local7];
};
_local3 = AuxFunctions.concatObjects(_local3, _local5);
_local7++;
};
if (_local3["base"]){
delete _local3["base"];
};
return (_local3);
//unresolved jump
};
return (_arg1);
}
}
}//package com.caurina.transitions
Section 20
//StartEvent (com.event.StartEvent)
package com.event {
import flash.events.*;
public class StartEvent extends Event {
public static const START:String = "start";
public function StartEvent(_arg1:String){
super(_arg1);
}
}
}//package com.event
Section 21
//3dcslogo_9 (ether_war_viral_fla.3dcslogo_9)
package ether_war_viral_fla {
import flash.display.*;
import flash.events.*;
import flash.geom.*;
import flash.utils.*;
import flash.media.*;
import flash.text.*;
import flash.ui.*;
import flash.filters.*;
import flash.net.*;
import flash.system.*;
import flash.accessibility.*;
import flash.errors.*;
public dynamic class 3dcslogo_9 extends MovieClip {
public function 3dcslogo_9(){
addFrameScript(29, frame30);
}
function frame30(){
stop();
}
}
}//package ether_war_viral_fla
Section 22
//A_26 (ether_war_viral_fla.A_26)
package ether_war_viral_fla {
import flash.display.*;
import flash.events.*;
import flash.geom.*;
import flash.utils.*;
import flash.media.*;
import flash.text.*;
import flash.ui.*;
import flash.filters.*;
import flash.net.*;
import flash.system.*;
import flash.accessibility.*;
import flash.errors.*;
public dynamic class A_26 extends MovieClip {
public function A_26(){
addFrameScript(9, frame10);
}
function frame10(){
stop();
}
}
}//package ether_war_viral_fla
Section 23
//anim_5 (ether_war_viral_fla.anim_5)
package ether_war_viral_fla {
import flash.display.*;
public dynamic class anim_5 extends MovieClip {
public var cslogo_mc:MovieClip;
}
}//package ether_war_viral_fla
Section 24
//Backdrop_89 (ether_war_viral_fla.Backdrop_89)
package ether_war_viral_fla {
import flash.display.*;
import flash.events.*;
import flash.geom.*;
import flash.utils.*;
import flash.media.*;
import flash.text.*;
import flash.ui.*;
import flash.filters.*;
import flash.net.*;
import flash.system.*;
import flash.accessibility.*;
import flash.errors.*;
public dynamic class Backdrop_89 extends MovieClip {
public var Gfx3:MovieClip;
public var Gfx:MovieClip;
public var Gfx2:MovieClip;
public function Backdrop_89(){
addFrameScript(0, frame1);
}
function frame1(){
if (MovieClip(root).Paused){
Gfx.stop();
Gfx2.stop();
Gfx3.stop();
};
stop();
}
}
}//package ether_war_viral_fla
Section 25
//Background_94 (ether_war_viral_fla.Background_94)
package ether_war_viral_fla {
import flash.display.*;
public dynamic class Background_94 extends MovieClip {
public var UnitsMC:MovieClip;
}
}//package ether_war_viral_fla
Section 26
//BlackShieldGfx_113 (ether_war_viral_fla.BlackShieldGfx_113)
package ether_war_viral_fla {
import flash.display.*;
import flash.events.*;
import flash.geom.*;
import flash.utils.*;
import flash.media.*;
import flash.text.*;
import flash.ui.*;
import flash.filters.*;
import flash.net.*;
import flash.system.*;
import flash.accessibility.*;
import flash.errors.*;
public dynamic class BlackShieldGfx_113 extends MovieClip {
public function BlackShieldGfx_113(){
addFrameScript(1, frame2);
}
function frame2(){
gotoAndPlay(1);
}
}
}//package ether_war_viral_fla
Section 27
//BlinkingLight_98 (ether_war_viral_fla.BlinkingLight_98)
package ether_war_viral_fla {
import flash.display.*;
import flash.events.*;
import flash.geom.*;
import flash.utils.*;
import flash.media.*;
import flash.text.*;
import flash.ui.*;
import flash.filters.*;
import flash.net.*;
import flash.system.*;
import flash.accessibility.*;
import flash.errors.*;
public dynamic class BlinkingLight_98 extends MovieClip {
public function BlinkingLight_98(){
addFrameScript(0, frame1, 58, frame59);
}
function frame1(){
MovieClip(root).Animes.push(this);
}
function frame59(){
gotoAndPlay("Start");
}
}
}//package ether_war_viral_fla
Section 28
//BlueShieldGfx_109 (ether_war_viral_fla.BlueShieldGfx_109)
package ether_war_viral_fla {
import flash.display.*;
import flash.events.*;
import flash.geom.*;
import flash.utils.*;
import flash.media.*;
import flash.text.*;
import flash.ui.*;
import flash.filters.*;
import flash.net.*;
import flash.system.*;
import flash.accessibility.*;
import flash.errors.*;
public dynamic class BlueShieldGfx_109 extends MovieClip {
public function BlueShieldGfx_109(){
addFrameScript(1, frame2);
}
function frame2(){
gotoAndPlay(1);
}
}
}//package ether_war_viral_fla
Section 29
//C_22 (ether_war_viral_fla.C_22)
package ether_war_viral_fla {
import flash.display.*;
import flash.events.*;
import flash.geom.*;
import flash.utils.*;
import flash.media.*;
import flash.text.*;
import flash.ui.*;
import flash.filters.*;
import flash.net.*;
import flash.system.*;
import flash.accessibility.*;
import flash.errors.*;
public dynamic class C_22 extends MovieClip {
public function C_22(){
addFrameScript(9, frame10);
}
function frame10(){
stop();
}
}
}//package ether_war_viral_fla
Section 30
//Cannon_104 (ether_war_viral_fla.Cannon_104)
package ether_war_viral_fla {
import flash.display.*;
import flash.events.*;
import flash.geom.*;
import flash.utils.*;
import flash.media.*;
import flash.text.*;
import flash.ui.*;
import flash.filters.*;
import flash.net.*;
import flash.system.*;
import flash.accessibility.*;
import flash.errors.*;
public dynamic class Cannon_104 extends MovieClip {
public var TriShotMC:MovieClip;
public var SmartMC:MovieClip;
public function Cannon_104(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package ether_war_viral_fla
Section 31
//CSLOGO_6 (ether_war_viral_fla.CSLOGO_6)
package ether_war_viral_fla {
import flash.display.*;
import flash.events.*;
import flash.geom.*;
import flash.utils.*;
import flash.media.*;
import flash.text.*;
import com.candystand.Stinger.*;
import flash.ui.*;
import flash.filters.*;
import flash.net.*;
import flash.system.*;
import flash.accessibility.*;
import flash.errors.*;
public dynamic class CSLOGO_6 extends MovieClip {
public var logo_button:SimpleButton;
public function CSLOGO_6(){
addFrameScript(40, frame41, 54, frame55);
}
function frame41(){
this.logo_button.addEventListener(MouseEvent.CLICK, Stinger3D._instance.CSHomepageLink, false, 0, true);
}
function frame55(){
stop();
}
}
}//package ether_war_viral_fla
Section 32
//Engine_102 (ether_war_viral_fla.Engine_102)
package ether_war_viral_fla {
import flash.display.*;
import flash.events.*;
import flash.geom.*;
import flash.utils.*;
import flash.media.*;
import flash.text.*;
import flash.ui.*;
import flash.filters.*;
import flash.net.*;
import flash.system.*;
import flash.accessibility.*;
import flash.errors.*;
public dynamic class Engine_102 extends MovieClip {
public function Engine_102(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package ether_war_viral_fla
Section 33
//ExpandingRing_186 (ether_war_viral_fla.ExpandingRing_186)
package ether_war_viral_fla {
import flash.display.*;
import flash.events.*;
import flash.geom.*;
import flash.utils.*;
import flash.media.*;
import flash.text.*;
import flash.ui.*;
import flash.filters.*;
import flash.net.*;
import flash.system.*;
import flash.accessibility.*;
import flash.errors.*;
public dynamic class ExpandingRing_186 extends MovieClip {
public function ExpandingRing_186(){
addFrameScript(31, frame32);
}
function frame32(){
stop();
}
}
}//package ether_war_viral_fla
Section 34
//GameOverClip_176 (ether_war_viral_fla.GameOverClip_176)
package ether_war_viral_fla {
import flash.display.*;
import flash.events.*;
import flash.geom.*;
import flash.utils.*;
import flash.media.*;
import flash.text.*;
import flash.ui.*;
import flash.filters.*;
import flash.net.*;
import flash.system.*;
import flash.accessibility.*;
import flash.errors.*;
public dynamic class GameOverClip_176 extends MovieClip {
public var ExitBtn:SimpleButton;
public var MoreGamesBtn:SimpleButton;
public function GameOverClip_176(){
addFrameScript(0, frame1);
}
function frame1(){
ExitBtn.addEventListener(MouseEvent.MOUSE_UP, function (_arg1:MouseEvent):void{
MovieClip(root).ResetGame();
});
MoreGamesBtn.addEventListener(MouseEvent.MOUSE_UP, function (_arg1:MouseEvent):void{
navigateToURL(new URLRequest("http://www.candystand.com/index.do?vgid=18347"), "_blank");
});
stop();
}
}
}//package ether_war_viral_fla
Section 35
//GlowingLight1_90 (ether_war_viral_fla.GlowingLight1_90)
package ether_war_viral_fla {
import flash.display.*;
import flash.events.*;
import flash.geom.*;
import flash.utils.*;
import flash.media.*;
import flash.text.*;
import flash.ui.*;
import flash.filters.*;
import flash.net.*;
import flash.system.*;
import flash.accessibility.*;
import flash.errors.*;
public dynamic class GlowingLight1_90 extends MovieClip {
public function GlowingLight1_90(){
addFrameScript(99, frame100, 101, frame102);
}
function frame102(){
}
function frame100(){
if (Math.random() > 0.5){
this.scaleX = (this.scaleX * -1);
};
if (Math.random() > 0.5){
this.scaleY = (this.scaleY * -1);
};
}
}
}//package ether_war_viral_fla
Section 36
//GlowingLight2_91 (ether_war_viral_fla.GlowingLight2_91)
package ether_war_viral_fla {
import flash.display.*;
import flash.events.*;
import flash.geom.*;
import flash.utils.*;
import flash.media.*;
import flash.text.*;
import flash.ui.*;
import flash.filters.*;
import flash.net.*;
import flash.system.*;
import flash.accessibility.*;
import flash.errors.*;
public dynamic class GlowingLight2_91 extends MovieClip {
public function GlowingLight2_91(){
addFrameScript(49, frame50, 51, frame52);
}
function frame52(){
}
function frame50(){
if (Math.random() > 0.5){
this.scaleX = (this.scaleX * -1);
};
if (Math.random() > 0.5){
this.scaleY = (this.scaleY * -1);
};
}
}
}//package ether_war_viral_fla
Section 37
//GlowingLight3_92 (ether_war_viral_fla.GlowingLight3_92)
package ether_war_viral_fla {
import flash.display.*;
import flash.events.*;
import flash.geom.*;
import flash.utils.*;
import flash.media.*;
import flash.text.*;
import flash.ui.*;
import flash.filters.*;
import flash.net.*;
import flash.system.*;
import flash.accessibility.*;
import flash.errors.*;
public dynamic class GlowingLight3_92 extends MovieClip {
public function GlowingLight3_92(){
addFrameScript(149, frame150, 151, frame152);
}
function frame152(){
}
function frame150(){
if (Math.random() > 0.5){
this.scaleX = (this.scaleX * -1);
};
if (Math.random() > 0.5){
this.scaleY = (this.scaleY * -1);
};
}
}
}//package ether_war_viral_fla
Section 38
//GreenShieldGfx_110 (ether_war_viral_fla.GreenShieldGfx_110)
package ether_war_viral_fla {
import flash.display.*;
import flash.events.*;
import flash.geom.*;
import flash.utils.*;
import flash.media.*;
import flash.text.*;
import flash.ui.*;
import flash.filters.*;
import flash.net.*;
import flash.system.*;
import flash.accessibility.*;
import flash.errors.*;
public dynamic class GreenShieldGfx_110 extends MovieClip {
public function GreenShieldGfx_110(){
addFrameScript(1, frame2);
}
function frame2(){
gotoAndPlay(1);
}
}
}//package ether_war_viral_fla
Section 39
//HealthBar_53 (ether_war_viral_fla.HealthBar_53)
package ether_war_viral_fla {
import flash.display.*;
public dynamic class HealthBar_53 extends MovieClip {
public var Bar:MovieClip;
}
}//package ether_war_viral_fla
Section 40
//HitPop_39 (ether_war_viral_fla.HitPop_39)
package ether_war_viral_fla {
import flash.display.*;
import flash.events.*;
import flash.geom.*;
import flash.utils.*;
import flash.media.*;
import flash.text.*;
import flash.ui.*;
import flash.filters.*;
import flash.net.*;
import flash.system.*;
import flash.accessibility.*;
import flash.errors.*;
public dynamic class HitPop_39 extends MovieClip {
public function HitPop_39(){
addFrameScript(0, frame1, 1, frame2);
}
function frame1(){
stop();
}
function frame2(){
this.x = ((Math.random() * 40) - (Math.random() * 40));
this.y = ((Math.random() * 40) - (Math.random() * 40));
}
}
}//package ether_war_viral_fla
Section 41
//I_25 (ether_war_viral_fla.I_25)
package ether_war_viral_fla {
import flash.display.*;
import flash.events.*;
import flash.geom.*;
import flash.utils.*;
import flash.media.*;
import flash.text.*;
import flash.ui.*;
import flash.filters.*;
import flash.net.*;
import flash.system.*;
import flash.accessibility.*;
import flash.errors.*;
public dynamic class I_25 extends MovieClip {
public function I_25(){
addFrameScript(9, frame10);
}
function frame10(){
stop();
}
}
}//package ether_war_viral_fla
Section 42
//L_29 (ether_war_viral_fla.L_29)
package ether_war_viral_fla {
import flash.display.*;
import flash.events.*;
import flash.geom.*;
import flash.utils.*;
import flash.media.*;
import flash.text.*;
import flash.ui.*;
import flash.filters.*;
import flash.net.*;
import flash.system.*;
import flash.accessibility.*;
import flash.errors.*;
public dynamic class L_29 extends MovieClip {
public function L_29(){
addFrameScript(9, frame10);
}
function frame10(){
stop();
}
}
}//package ether_war_viral_fla
Section 43
//M_27 (ether_war_viral_fla.M_27)
package ether_war_viral_fla {
import flash.display.*;
import flash.events.*;
import flash.geom.*;
import flash.utils.*;
import flash.media.*;
import flash.text.*;
import flash.ui.*;
import flash.filters.*;
import flash.net.*;
import flash.system.*;
import flash.accessibility.*;
import flash.errors.*;
public dynamic class M_27 extends MovieClip {
public function M_27(){
addFrameScript(9, frame10);
}
function frame10(){
stop();
}
}
}//package ether_war_viral_fla
Section 44
//MainFader_178 (ether_war_viral_fla.MainFader_178)
package ether_war_viral_fla {
import flash.display.*;
import flash.events.*;
import flash.geom.*;
import flash.utils.*;
import flash.media.*;
import flash.text.*;
import flash.ui.*;
import flash.filters.*;
import flash.net.*;
import flash.system.*;
import flash.accessibility.*;
import flash.errors.*;
public dynamic class MainFader_178 extends MovieClip {
public function MainFader_178(){
addFrameScript(12, frame13, 31, frame32);
}
function frame13(){
stop();
}
function frame32(){
MovieClip(root).ResetGame("Victory");
}
}
}//package ether_war_viral_fla
Section 45
//MissPop_56 (ether_war_viral_fla.MissPop_56)
package ether_war_viral_fla {
import flash.display.*;
import flash.events.*;
import flash.geom.*;
import flash.utils.*;
import flash.media.*;
import flash.text.*;
import flash.ui.*;
import flash.filters.*;
import flash.net.*;
import flash.system.*;
import flash.accessibility.*;
import flash.errors.*;
public dynamic class MissPop_56 extends MovieClip {
public function MissPop_56(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package ether_war_viral_fla
Section 46
//OptionsPanel_167 (ether_war_viral_fla.OptionsPanel_167)
package ether_war_viral_fla {
import flash.display.*;
import flash.events.*;
import flash.geom.*;
import flash.utils.*;
import flash.media.*;
import flash.text.*;
import flash.ui.*;
import flash.filters.*;
import flash.net.*;
import flash.system.*;
import flash.accessibility.*;
import flash.errors.*;
public dynamic class OptionsPanel_167 extends MovieClip {
public var ParticleLevelBtn:SimpleButton;
public var ParticleLevelTxt:TextField;
public var QualityTxt:TextField;
public var ExitBtn:SimpleButton;
public var AuroraBtn:SimpleButton;
public var AuroraTxt:TextField;
public var QualityBtn:SimpleButton;
public function OptionsPanel_167(){
addFrameScript(0, frame1);
}
function frame1(){
ParticleLevelBtn.addEventListener(MouseEvent.MOUSE_UP, function (_arg1:MouseEvent):void{
if (MovieClip(root).CamMC.HeroMC.MSDown == false){
MovieClip(root).ParticleSystemMC.SetPTCs();
if (ParticleLevelTxt.text == "High"){
ParticleLevelTxt.text = "Low";
} else {
ParticleLevelTxt.text = "High";
};
};
});
AuroraBtn.addEventListener(MouseEvent.MOUSE_UP, function (_arg1:MouseEvent):void{
if (MovieClip(root).CamMC.HeroMC.MSDown == false){
MovieClip(root).SetAurora();
if (AuroraTxt.text == "On"){
AuroraTxt.text = "Off";
} else {
AuroraTxt.text = "On";
};
};
});
QualityBtn.addEventListener(MouseEvent.MOUSE_UP, function (_arg1:MouseEvent):void{
if (MovieClip(root).CamMC.HeroMC.MSDown == false){
if (stage.quality == "HIGH"){
stage.quality = "MEDIUM";
QualityTxt.text = "Medium";
} else {
if (stage.quality == "MEDIUM"){
stage.quality = "LOW";
QualityTxt.text = "Low";
} else {
stage.quality = "HIGH";
QualityTxt.text = "High";
};
};
};
});
ExitBtn.addEventListener(MouseEvent.MOUSE_UP, function (_arg1:MouseEvent):void{
if (MovieClip(root).CamMC.HeroMC.MSDown == false){
MovieClip(root).ResetGame();
};
});
stop();
}
}
}//package ether_war_viral_fla
Section 47
//P_21 (ether_war_viral_fla.P_21)
package ether_war_viral_fla {
import flash.display.*;
import flash.events.*;
import flash.geom.*;
import flash.utils.*;
import flash.media.*;
import flash.text.*;
import flash.ui.*;
import flash.filters.*;
import flash.net.*;
import flash.system.*;
import flash.accessibility.*;
import flash.errors.*;
public dynamic class P_21 extends MovieClip {
public function P_21(){
addFrameScript(9, frame10);
}
function frame10(){
stop();
}
}
}//package ether_war_viral_fla
Section 48
//ParticlasmLogoMod_18 (ether_war_viral_fla.ParticlasmLogoMod_18)
package ether_war_viral_fla {
import flash.display.*;
import flash.events.*;
import flash.geom.*;
import flash.utils.*;
import flash.media.*;
import flash.text.*;
import flash.ui.*;
import flash.filters.*;
import flash.net.*;
import flash.system.*;
import flash.accessibility.*;
import flash.errors.*;
public dynamic class ParticlasmLogoMod_18 extends MovieClip {
public var LogoT:MovieClip;
public var LogoC:MovieClip;
public var CurrentItem;
public var LogoA2:MovieClip;
public var Temp;
public var LogoBackgroundBtn:SimpleButton;
public var Rand;
public var a;
public var LogoParticleHolder:MovieClip;
public var Rand2;
public var MySound:Sound;
public var LogoCom:MovieClip;
public var LogoA:MovieClip;
public var PTC;
public var LogoI:MovieClip;
public var LogoL:MovieClip;
public var LogoP:MovieClip;
public var LogoS:MovieClip;
public var LogoM:MovieClip;
public var LogoR:MovieClip;
public function ParticlasmLogoMod_18(){
addFrameScript(0, frame1, 4, frame5, 8, frame9, 12, frame13, 16, frame17, 20, frame21, 24, frame25, 28, frame29, 32, frame33, 36, frame37, 40, frame41, 130, frame131);
}
public function Pop(_arg1){
Rand = (Math.random() * 360);
Rand2 = (5 + Math.ceil((Math.random() * 5)));
a = 1;
while (a <= Rand2) {
Temp = new LogoParticle();
PTC = LogoParticleHolder.addChild(Temp);
PTC.x = _arg1.x;
PTC.y = _arg1.y;
PTC.rotation = (Rand + ((a * 360) / Rand2));
a++;
};
MySound.play();
}
function frame1(){
MovieClip(root).stop();
MySound = new LogoSound();
LogoBackgroundBtn.addEventListener(MouseEvent.MOUSE_UP, function (_arg1:MouseEvent):void{
navigateToURL(new URLRequest("http://www.Particlasm.com/"), "_blank");
});
}
function frame13(){
Pop(LogoR);
}
function frame17(){
Pop(LogoT);
}
function frame5(){
Pop(LogoP);
}
function frame29(){
Pop(LogoM);
}
function frame37(){
Pop(LogoS);
}
function frame9(){
Pop(LogoC);
}
function frame25(){
Pop(LogoA);
}
function frame41(){
Pop(LogoL);
}
function frame33(){
Pop(LogoA2);
}
function frame21(){
Pop(LogoI);
}
function frame131(){
MovieClip(root).play();
stop();
}
}
}//package ether_war_viral_fla
Section 49
//PauseMenu_129 (ether_war_viral_fla.PauseMenu_129)
package ether_war_viral_fla {
import flash.display.*;
import flash.events.*;
import flash.geom.*;
import flash.utils.*;
import flash.media.*;
import flash.text.*;
import flash.ui.*;
import flash.filters.*;
import flash.net.*;
import flash.system.*;
import flash.accessibility.*;
import flash.errors.*;
public dynamic class PauseMenu_129 extends MovieClip {
public var OptionsBtn:SimpleButton;
public var OptionsPanelMC:MovieClip;
public var UpgradesPanelMC:MovieClip;
public var CSBtn:SimpleButton;
public var UpgradesBtn:SimpleButton;
public function PauseMenu_129(){
addFrameScript(0, frame1);
}
function frame1(){
UpgradesBtn.addEventListener(MouseEvent.MOUSE_UP, function (_arg1:MouseEvent):void{
if (MovieClip(root).CamMC.HeroMC.MSDown == false){
OptionsPanelMC.x = -1000;
UpgradesPanelMC.x = 0;
};
});
OptionsBtn.addEventListener(MouseEvent.MOUSE_UP, function (_arg1:MouseEvent):void{
if (MovieClip(root).CamMC.HeroMC.MSDown == false){
OptionsPanelMC.x = 0;
UpgradesPanelMC.x = -1000;
};
});
CSBtn.addEventListener(MouseEvent.MOUSE_UP, function (_arg1:MouseEvent):void{
if (MovieClip(root).CamMC.HeroMC.MSDown == false){
navigateToURL(new URLRequest("http://www.candystand.com/index.do?vgid=18347"), "_blank");
};
});
stop();
}
}
}//package ether_war_viral_fla
Section 50
//PopupFader_164 (ether_war_viral_fla.PopupFader_164)
package ether_war_viral_fla {
import flash.display.*;
import flash.events.*;
import flash.geom.*;
import flash.utils.*;
import flash.media.*;
import flash.text.*;
import flash.ui.*;
import flash.filters.*;
import flash.net.*;
import flash.system.*;
import flash.accessibility.*;
import flash.errors.*;
public dynamic class PopupFader_164 extends MovieClip {
public function PopupFader_164(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package ether_war_viral_fla
Section 51
//R_23 (ether_war_viral_fla.R_23)
package ether_war_viral_fla {
import flash.display.*;
import flash.events.*;
import flash.geom.*;
import flash.utils.*;
import flash.media.*;
import flash.text.*;
import flash.ui.*;
import flash.filters.*;
import flash.net.*;
import flash.system.*;
import flash.accessibility.*;
import flash.errors.*;
public dynamic class R_23 extends MovieClip {
public function R_23(){
addFrameScript(9, frame10);
}
function frame10(){
stop();
}
}
}//package ether_war_viral_fla
Section 52
//Radar_114 (ether_war_viral_fla.Radar_114)
package ether_war_viral_fla {
import flash.display.*;
public dynamic class Radar_114 extends MovieClip {
public var DotsMC:MovieClip;
}
}//package ether_war_viral_fla
Section 53
//Reactor_38 (ether_war_viral_fla.Reactor_38)
package ether_war_viral_fla {
import flash.display.*;
import flash.events.*;
import flash.geom.*;
import flash.utils.*;
import flash.media.*;
import flash.text.*;
import flash.ui.*;
import flash.filters.*;
import flash.net.*;
import flash.system.*;
import flash.accessibility.*;
import flash.errors.*;
public dynamic class Reactor_38 extends MovieClip {
public function Reactor_38(){
addFrameScript(0, frame1, 39, frame40);
}
function frame1(){
MovieClip(root).Animes.push(this);
}
function frame40(){
gotoAndPlay("Start");
}
}
}//package ether_war_viral_fla
Section 54
//RedShieldGfx_111 (ether_war_viral_fla.RedShieldGfx_111)
package ether_war_viral_fla {
import flash.display.*;
import flash.events.*;
import flash.geom.*;
import flash.utils.*;
import flash.media.*;
import flash.text.*;
import flash.ui.*;
import flash.filters.*;
import flash.net.*;
import flash.system.*;
import flash.accessibility.*;
import flash.errors.*;
public dynamic class RedShieldGfx_111 extends MovieClip {
public function RedShieldGfx_111(){
addFrameScript(1, frame2);
}
function frame2(){
gotoAndPlay(1);
}
}
}//package ether_war_viral_fla
Section 55
//S_28 (ether_war_viral_fla.S_28)
package ether_war_viral_fla {
import flash.display.*;
import flash.events.*;
import flash.geom.*;
import flash.utils.*;
import flash.media.*;
import flash.text.*;
import flash.ui.*;
import flash.filters.*;
import flash.net.*;
import flash.system.*;
import flash.accessibility.*;
import flash.errors.*;
public dynamic class S_28 extends MovieClip {
public function S_28(){
addFrameScript(9, frame10);
}
function frame10(){
stop();
}
}
}//package ether_war_viral_fla
Section 56
//Shield_108 (ether_war_viral_fla.Shield_108)
package ether_war_viral_fla {
import flash.display.*;
import flash.events.*;
import flash.geom.*;
import flash.utils.*;
import flash.media.*;
import flash.text.*;
import flash.ui.*;
import flash.filters.*;
import flash.net.*;
import flash.system.*;
import flash.accessibility.*;
import flash.errors.*;
public dynamic class Shield_108 extends MovieClip {
public var Gfx:MovieClip;
public function Shield_108(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package ether_war_viral_fla
Section 57
//SpinningReds_60 (ether_war_viral_fla.SpinningReds_60)
package ether_war_viral_fla {
import flash.display.*;
import flash.events.*;
import flash.geom.*;
import flash.utils.*;
import flash.media.*;
import flash.text.*;
import flash.ui.*;
import flash.filters.*;
import flash.net.*;
import flash.system.*;
import flash.accessibility.*;
import flash.errors.*;
public dynamic class SpinningReds_60 extends MovieClip {
public function SpinningReds_60(){
addFrameScript(0, frame1, 9, frame10);
}
function frame10(){
gotoAndPlay("Ani");
}
function frame1(){
MovieClip(root).Animes.push(this);
}
}
}//package ether_war_viral_fla
Section 58
//T_24 (ether_war_viral_fla.T_24)
package ether_war_viral_fla {
import flash.display.*;
import flash.events.*;
import flash.geom.*;
import flash.utils.*;
import flash.media.*;
import flash.text.*;
import flash.ui.*;
import flash.filters.*;
import flash.net.*;
import flash.system.*;
import flash.accessibility.*;
import flash.errors.*;
public dynamic class T_24 extends MovieClip {
public function T_24(){
addFrameScript(9, frame10);
}
function frame10(){
stop();
}
}
}//package ether_war_viral_fla
Section 59
//Timeline_30 (ether_war_viral_fla.Timeline_30)
package ether_war_viral_fla {
import flash.display.*;
import flash.events.*;
import flash.geom.*;
import flash.utils.*;
import flash.media.*;
import flash.text.*;
import flash.ui.*;
import flash.filters.*;
import flash.net.*;
import flash.system.*;
import flash.accessibility.*;
import flash.errors.*;
public dynamic class Timeline_30 extends MovieClip {
public function Timeline_30(){
addFrameScript(19, frame20);
}
function frame20(){
stop();
}
}
}//package ether_war_viral_fla
Section 60
//Turret_40 (ether_war_viral_fla.Turret_40)
package ether_war_viral_fla {
import flash.display.*;
import flash.events.*;
import flash.geom.*;
import flash.utils.*;
import flash.media.*;
import flash.text.*;
import flash.ui.*;
import flash.filters.*;
import flash.net.*;
import flash.system.*;
import flash.accessibility.*;
import flash.errors.*;
public dynamic class Turret_40 extends MovieClip {
public function Turret_40(){
addFrameScript(0, frame1, 2, frame3, 10, frame11);
}
function frame3(){
gotoAndPlay("Still");
}
function frame1(){
MovieClip(root).Animes.push(this);
}
function frame11(){
gotoAndPlay("Still");
}
}
}//package ether_war_viral_fla
Section 61
//Tutorial_121 (ether_war_viral_fla.Tutorial_121)
package ether_war_viral_fla {
import flash.display.*;
import flash.events.*;
import flash.geom.*;
import flash.utils.*;
import flash.media.*;
import flash.text.*;
import flash.ui.*;
import flash.filters.*;
import flash.net.*;
import flash.system.*;
import flash.accessibility.*;
import flash.errors.*;
public dynamic class Tutorial_121 extends MovieClip {
public function Tutorial_121(){
addFrameScript(0, frame1);
}
function frame1(){
MovieClip(root).TutDone = true;
stop();
}
}
}//package ether_war_viral_fla
Section 62
//UpgradesPanel_130 (ether_war_viral_fla.UpgradesPanel_130)
package ether_war_viral_fla {
import flash.display.*;
import flash.events.*;
import flash.geom.*;
import flash.utils.*;
import flash.media.*;
import flash.text.*;
import flash.ui.*;
import flash.filters.*;
import flash.net.*;
import flash.system.*;
import flash.accessibility.*;
import flash.errors.*;
public dynamic class UpgradesPanel_130 extends MovieClip {
public var ShieldBtn:SimpleButton;
public var TripleShotDisplayMC:MovieClip;
public var AlliedUnitsBtn:SimpleButton;
public var AlliedUnitsCostTxt:TextField;
public var ShieldDisplayMC:MovieClip;
public var SecondaryCostTxt:TextField;
public var CannonCostTxt:TextField;
public var RepulsionCostTxt:TextField;
public var EngineDisplayMC:MovieClip;
public var EngineBtn:SimpleButton;
public var RepulsionShieldDisplayMC:MovieClip;
public var SmartCostTxt:TextField;
public var EngineCostTxt:TextField;
public var SmartMissilesDisplayMC:MovieClip;
public var SmartMissilesBtn:SimpleButton;
public var AlliedUnitsDisplayMC:MovieClip;
public var RepulsionShieldBtn:SimpleButton;
public var TripleShotBtn:SimpleButton;
public var Popup:MovieClip;
public var TripleShotCostTxt:TextField;
public var CannonDisplayMC:MovieClip;
public var ShieldCostTxt:TextField;
public var SecondaryCannonsDisplayMC:MovieClip;
public var SecondaryCannonsBtn:SimpleButton;
public var CannonBtn:SimpleButton;
public function UpgradesPanel_130(){
addFrameScript(0, frame1);
}
function frame1(){
AlliedUnitsBtn.addEventListener(MouseEvent.MOUSE_UP, function (_arg1:MouseEvent):void{
if (MovieClip(root).CamMC.HeroMC.MSDown == false){
MovieClip(root).CamMC.setAlliedUnits();
};
});
CannonBtn.addEventListener(MouseEvent.MOUSE_UP, function (_arg1:MouseEvent):void{
if (MovieClip(root).CamMC.HeroMC.MSDown == false){
if (CannonBtn.enabled){
MovieClip(root).CamMC.HeroMC.setCannon();
};
};
});
ShieldBtn.addEventListener(MouseEvent.MOUSE_UP, function (_arg1:MouseEvent):void{
if (MovieClip(root).CamMC.HeroMC.MSDown == false){
if (ShieldBtn.enabled){
MovieClip(root).CamMC.HeroMC.setShield();
};
};
});
EngineBtn.addEventListener(MouseEvent.MOUSE_UP, function (_arg1:MouseEvent):void{
if (MovieClip(root).CamMC.HeroMC.MSDown == false){
if (EngineBtn.enabled){
MovieClip(root).CamMC.HeroMC.setEngine();
};
};
});
TripleShotBtn.addEventListener(MouseEvent.MOUSE_UP, function (_arg1:MouseEvent):void{
if (MovieClip(root).CamMC.HeroMC.MSDown == false){
if (TripleShotBtn.enabled){
MovieClip(root).CamMC.HeroMC.setPowerUp("TriShot");
};
};
});
SecondaryCannonsBtn.addEventListener(MouseEvent.MOUSE_UP, function (_arg1:MouseEvent):void{
if (MovieClip(root).CamMC.HeroMC.MSDown == false){
if (SecondaryCannonsBtn.enabled){
MovieClip(root).CamMC.HeroMC.setPowerUp("Secondary");
};
};
});
SmartMissilesBtn.addEventListener(MouseEvent.MOUSE_UP, function (_arg1:MouseEvent):void{
if (MovieClip(root).CamMC.HeroMC.MSDown == false){
if (SmartMissilesBtn.enabled){
MovieClip(root).CamMC.HeroMC.setPowerUp("Smart");
};
};
});
RepulsionShieldBtn.addEventListener(MouseEvent.MOUSE_UP, function (_arg1:MouseEvent):void{
if (MovieClip(root).CamMC.HeroMC.MSDown == false){
if (RepulsionShieldBtn.enabled){
MovieClip(root).CamMC.HeroMC.setPowerUp("Repulsion");
};
};
});
stop();
}
}
}//package ether_war_viral_fla
Section 63
//WarningsMC_119 (ether_war_viral_fla.WarningsMC_119)
package ether_war_viral_fla {
import flash.display.*;
import flash.events.*;
import flash.geom.*;
import flash.utils.*;
import flash.media.*;
import flash.text.*;
import flash.ui.*;
import flash.filters.*;
import flash.net.*;
import flash.system.*;
import flash.accessibility.*;
import flash.errors.*;
public dynamic class WarningsMC_119 extends MovieClip {
public function WarningsMC_119(){
addFrameScript(1, frame2, 61, frame62, 127, frame128);
}
function frame2(){
gotoAndPlay("Stopped");
}
function frame128(){
gotoAndPlay("Stopped");
}
function frame62(){
gotoAndPlay("Stopped");
}
}
}//package ether_war_viral_fla
Section 64
//WhitePtc_190 (ether_war_viral_fla.WhitePtc_190)
package ether_war_viral_fla {
import flash.display.*;
import flash.events.*;
import flash.geom.*;
import flash.utils.*;
import flash.media.*;
import flash.text.*;
import flash.ui.*;
import flash.filters.*;
import flash.net.*;
import flash.system.*;
import flash.accessibility.*;
import flash.errors.*;
public dynamic class WhitePtc_190 extends MovieClip {
public var MovX:Number;
public var Rot:Number;
public var MovY:Number;
public function WhitePtc_190(){
addFrameScript(0, frame1, 1, frame2, 2, frame3);
}
function frame3(){
gotoAndPlay("Loop");
}
function frame1(){
Rot = ((Math.random() * 10) - (Math.random() * 10));
MovX = ((Math.random() * 20) - (Math.random() * 20));
MovY = ((Math.random() * 20) - (Math.random() * 20));
this.scaleX = (0.5 + (Math.random() / 2));
this.scaleY = (0.5 + (Math.random() / 2));
}
function frame2(){
this.rotation = (this.rotation + Rot);
this.x = (this.x + MovX);
this.y = (this.y + MovY);
}
}
}//package ether_war_viral_fla
Section 65
//Victory_180 (ether_war_viral_fla.Victory_180)
package ether_war_viral_fla {
import flash.display.*;
import flash.events.*;
import flash.geom.*;
import flash.utils.*;
import flash.media.*;
import flash.text.*;
import flash.ui.*;
import flash.filters.*;
import flash.net.*;
import flash.system.*;
import flash.accessibility.*;
import flash.errors.*;
public dynamic class Victory_180 extends MovieClip {
public var ExitBtn:SimpleButton;
public var MoreGamesBtn:SimpleButton;
public var DisplayTxt:TextField;
public function Victory_180(){
addFrameScript(735, frame736, 749, frame750);
}
function frame750(){
ExitBtn.addEventListener(MouseEvent.MOUSE_UP, function (_arg1:MouseEvent):void{
MovieClip(root).ResetGame();
});
MoreGamesBtn.addEventListener(MouseEvent.MOUSE_UP, function (_arg1:MouseEvent):void{
navigateToURL(new URLRequest("http://www.candystand.com/index.do?vgid=18347"), "_blank");
});
stop();
}
function frame736(){
DisplayTxt.text = ((((("Final Score: " + String((MovieClip(root).Score - MovieClip(root).TimeBonus))) + "\rTime Bonus: ") + String(MovieClip(root).TimeBonus)) + "\r\rTotal Score: ") + String(MovieClip(root).Score));
}
}
}//package ether_war_viral_fla
Section 66
//YellowShieldGfx_112 (ether_war_viral_fla.YellowShieldGfx_112)
package ether_war_viral_fla {
import flash.display.*;
import flash.events.*;
import flash.geom.*;
import flash.utils.*;
import flash.media.*;
import flash.text.*;
import flash.ui.*;
import flash.filters.*;
import flash.net.*;
import flash.system.*;
import flash.accessibility.*;
import flash.errors.*;
public dynamic class YellowShieldGfx_112 extends MovieClip {
public function YellowShieldGfx_112(){
addFrameScript(1, frame2);
}
function frame2(){
gotoAndPlay(1);
}
}
}//package ether_war_viral_fla
Section 67
//Camera3D (org.papervision3d.cameras.Camera3D)
package org.papervision3d.cameras {
import org.papervision3d.objects.*;
import org.papervision3d.core.proto.*;
import org.papervision3d.core.*;
public class Camera3D extends CameraObject3D {
public var goto:Number3D;
public var target:DisplayObject3D;
public function Camera3D(_arg1:DisplayObject3D=null, _arg2:Number=2, _arg3:Number=100, _arg4:Object=null){
super(_arg2, _arg3, _arg4);
this.target = ((_arg1) || (DisplayObject3D.ZERO));
this.goto = new Number3D(this.x, this.y, this.z);
}
override public function transformView(_arg1:Matrix3D=null):void{
this.lookAt(this.target);
super.transformView();
}
public function hover(_arg1:Number, _arg2:Number, _arg3:Number):void{
var _local4:DisplayObject3D;
var _local5:Number3D;
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;
_local4 = this.target;
_local5 = this.goto;
_local6 = 8;
switch (_arg1){
case 0:
_local7 = (_local5.x - _local4.x);
_local8 = (_local5.z - _local4.z);
_local9 = Math.atan2(_local8, _local7);
_local10 = Math.sqrt(((_local7 * _local7) + (_local8 * _local8)));
_local11 = (0.5 * _arg2);
_local12 = (_local10 * Math.cos((_local9 - _local11)));
_local13 = (_local10 * Math.sin((_local9 - _local11)));
_local14 = (_local5.y - (300 * _arg3));
this.x = (this.x - ((this.x - _local12) / _local6));
this.y = (this.y - ((this.y - _local14) / _local6));
this.z = (this.z - ((this.z - _local13) / _local6));
break;
case 1:
this.x = (this.x - ((this.x - (1000 * _arg2)) / _local6));
this.y = (this.y - ((this.y - (1000 * _arg3)) / _local6));
break;
};
}
}
}//package org.papervision3d.cameras
Section 68
//DefaultTriangleCuller (org.papervision3d.core.culling.DefaultTriangleCuller)
package org.papervision3d.core.culling {
import org.papervision3d.objects.*;
import org.papervision3d.core.geom.*;
import org.papervision3d.core.proto.*;
public class DefaultTriangleCuller implements ITriangleCuller {
private static var y2:Number;
private static var y1:Number;
private static var y0:Number;
private static var x0:Number;
private static var x1:Number;
private static var x2:Number;
public function testFace(_arg1:DisplayObject3D, _arg2:Face3DInstance, _arg3:Vertex2D, _arg4:Vertex2D, _arg5:Vertex2D):Boolean{
var _local6:MaterialObject3D;
if (((((_arg3.visible) && (_arg4.visible))) && (_arg5.visible))){
_local6 = (_arg2.face.material) ? _arg2.face.material : _arg1.material;
if (_local6.invisible){
return (false);
};
x0 = _arg3.x;
y0 = _arg3.y;
x1 = _arg4.x;
y1 = _arg4.y;
x2 = _arg5.x;
y2 = _arg5.y;
if (_local6.oneSide){
if (_local6.opposite){
if ((((x2 - x0) * (y1 - y0)) - ((y2 - y0) * (x1 - x0))) > 0){
return (false);
};
} else {
if ((((x2 - x0) * (y1 - y0)) - ((y2 - y0) * (x1 - x0))) < 0){
return (false);
};
};
};
return (true);
};
return (false);
}
}
}//package org.papervision3d.core.culling
Section 69
//ITriangleCuller (org.papervision3d.core.culling.ITriangleCuller)
package org.papervision3d.core.culling {
import org.papervision3d.objects.*;
import org.papervision3d.core.geom.*;
public interface ITriangleCuller {
function testFace(_arg1:DisplayObject3D, _arg2:Face3DInstance, _arg3:Vertex2D, _arg4:Vertex2D, _arg5:Vertex2D):Boolean;
}
}//package org.papervision3d.core.culling
Section 70
//IFaceDrawer (org.papervision3d.core.draw.IFaceDrawer)
package org.papervision3d.core.draw {
import flash.display.*;
import org.papervision3d.objects.*;
import org.papervision3d.core.geom.*;
public interface IFaceDrawer {
function drawFace3D(_arg1:DisplayObject3D, _arg2:Face3D, _arg3:Graphics, _arg4:Vertex2D, _arg5:Vertex2D, _arg6:Vertex2D):int;
}
}//package org.papervision3d.core.draw
Section 71
//Face3D (org.papervision3d.core.geom.Face3D)
package org.papervision3d.core.geom {
import flash.display.*;
import org.papervision3d.objects.*;
import org.papervision3d.core.proto.*;
import org.papervision3d.core.*;
public class Face3D {
public var vertices:Array;
public var face3DInstance:Face3DInstance;
public var id:Number;
public var uv:Array;
public var material:MaterialObject3D;
private var renderMat:MaterialObject3D;
public var faceNormal:Number3D;
public var screenZ:Number;
public var _materialName:String;
public var visible:Boolean;
public var v0:Vertex3D;
public var v1:Vertex3D;
public var v2:Vertex3D;
private static var _totalFaces:Number = 0;
public function Face3D(_arg1:Array, _arg2:MaterialObject3D=null, _arg3:Array=null){
this.vertices = _arg1;
v0 = _arg1[0];
v1 = _arg1[1];
v2 = _arg1[2];
this.material = _arg2;
this.uv = _arg3;
this.id = _totalFaces++;
face3DInstance = new Face3DInstance(this);
createNormal();
}
protected function createNormal():void{
var _local1:Number3D;
var _local2:Number3D;
var _local3:Number3D;
var _local4:Number3D;
var _local5:Number3D;
_local1 = v0.toNumber3D();
_local2 = v1.toNumber3D();
_local3 = v2.toNumber3D();
_local4 = Number3D.sub(_local2, _local1);
_local5 = Number3D.sub(_local3, _local1);
faceNormal = Number3D.cross(_local5, _local4);
faceNormal.normalize();
}
public function render(_arg1:DisplayObject3D, _arg2:Sprite):Number{
renderMat = (material) ? material : _arg1.material;
return (renderMat.drawFace3D(_arg1, this, _arg2.graphics, v0.vertex2DInstance, v1.vertex2DInstance, v2.vertex2DInstance));
}
}
}//package org.papervision3d.core.geom
Section 72
//Face3DInstance (org.papervision3d.core.geom.Face3DInstance)
package org.papervision3d.core.geom {
import flash.display.*;
import org.papervision3d.objects.*;
import org.papervision3d.core.*;
public class Face3DInstance {
public var container:Sprite;
public var faceNormal:Number3D;
public var screenZ:Number;
public var visible:Boolean;// = false
public var instance:DisplayObject3D;
public var face:Face3D;
public function Face3DInstance(_arg1:Face3D, _arg2:DisplayObject3D=null){
visible = false;
super();
this.face = _arg1;
this.instance = _arg2;
faceNormal = new Number3D();
}
}
}//package org.papervision3d.core.geom
Section 73
//Mesh3D (org.papervision3d.core.geom.Mesh3D)
package org.papervision3d.core.geom {
import org.papervision3d.objects.*;
import org.papervision3d.core.proto.*;
import org.papervision3d.core.*;
import flash.utils.*;
import org.papervision3d.core.culling.*;
public class Mesh3D extends Vertices3D {
public function Mesh3D(_arg1:MaterialObject3D, _arg2:Array, _arg3:Array, _arg4:String=null, _arg5:Object=null){
super(_arg2, _arg4, _arg5);
this.geometry.faces = ((_arg3) || (new Array()));
this.material = ((_arg1) || (MaterialObject3D.DEFAULT));
}
override public function project(_arg1:DisplayObject3D, _arg2:CameraObject3D, _arg3:Array=null):Number{
var _local4:Array;
var _local5:Number;
var _local6:Number;
var _local7:ITriangleCuller;
var _local8:Vertex2D;
var _local9:Vertex2D;
var _local10:Vertex2D;
var _local11:Face3DInstance;
var _local12:Face3D;
var _local13:MaterialObject3D;
super.project(_arg1, _arg2, _arg3);
if (!_arg3){
_arg3 = this._sorted;
};
_local4 = this.geometry.faces;
_local5 = 0;
_local6 = 0;
_local7 = scene.triangleCuller;
for each (_local12 in _local4) {
_local13 = (_local12.material) ? _local12.material : material;
_local11 = _local12.face3DInstance;
_local11.instance = this;
_local8 = _local12.v0.vertex2DInstance;
_local9 = _local12.v1.vertex2DInstance;
_local10 = _local12.v2.vertex2DInstance;
if ((_local11.visible = _local7.testFace(this, _local11, _local8, _local9, _local10))){
if (_local13.needsFaceNormals){
_local12.faceNormal.copyTo(_local11.faceNormal);
Matrix3D.multiplyVector3x3(this.view, _local11.faceNormal);
};
if (_local13.needsVertexNormals){
_local12.v0.normal.copyTo(_local12.v0.vertex2DInstance.normal);
Matrix3D.multiplyVector3x3(this.view, _local12.v0.vertex2DInstance.normal);
_local12.v1.normal.copyTo(_local12.v1.vertex2DInstance.normal);
Matrix3D.multiplyVector3x3(this.view, _local12.v1.vertex2DInstance.normal);
_local12.v2.normal.copyTo(_local12.v2.vertex2DInstance.normal);
Matrix3D.multiplyVector3x3(this.view, _local12.v2.vertex2DInstance.normal);
};
switch (meshSort){
case DisplayObject3D.MESH_SORT_CENTER:
_local5 = (_local5 + (_local11.screenZ = (((_local8.z + _local9.z) + _local10.z) * 0.333)));
break;
case DisplayObject3D.MESH_SORT_FAR:
_local5 = (_local5 + (_local11.screenZ = Math.max(_local8.z, _local9.z, _local10.z)));
break;
case DisplayObject3D.MESH_SORT_CLOSE:
_local5 = (_local5 + (_local11.screenZ = Math.min(_local8.z, _local9.z, _local10.z)));
break;
};
_local6++;
_arg3.push(_local11);
} else {
scene.stats.culledTriangles++;
};
};
return ((this.screenZ = (_local5 / _local6)));
}
public function mergeVertices():void{
var _local1:Dictionary;
var _local2:Array;
var _local3:Vertex3D;
var _local4:Face3D;
var _local5:Vertex3D;
_local1 = new Dictionary();
_local2 = new Array();
for each (_local3 in this.geometry.vertices) {
for each (_local5 in _local1) {
if ((((((_local3.x == _local5.x)) && ((_local3.y == _local5.y)))) && ((_local3.z == _local5.z)))){
_local1[_local3] = _local5;
break;
};
};
if (!_local1[_local3]){
_local1[_local3] = _local3;
_local2.push(_local3);
};
};
this.geometry.vertices = _local2;
for each (_local4 in this.geometry.faces) {
_local4.v0 = _local1[_local4.v0];
_local4.v1 = _local1[_local4.v1];
_local4.v2 = _local1[_local4.v2];
};
}
public function projectTexture(_arg1:String="x", _arg2:String="y"):void{
var _local3:Array;
var _local4:Object;
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:Number;
var _local9:MaterialObject3D;
var _local10:String;
var _local11:Face3D;
var _local12:Array;
var _local13:Vertex3D;
var _local14:Vertex3D;
var _local15:Vertex3D;
var _local16:NumberUV;
var _local17:NumberUV;
var _local18:NumberUV;
_local3 = this.geometry.faces;
_local4 = this.boundingBox();
_local5 = _local4.min[_arg1];
_local6 = _local4.size[_arg1];
_local7 = _local4.min[_arg2];
_local8 = _local4.size[_arg2];
_local9 = this.material;
for (_local10 in _local3) {
_local11 = _local3[Number(_local10)];
_local12 = _local11.vertices;
_local13 = _local12[0];
_local14 = _local12[1];
_local15 = _local12[2];
_local16 = new NumberUV(((_local13[_arg1] - _local5) / _local6), ((_local13[_arg2] - _local7) / _local8));
_local17 = new NumberUV(((_local14[_arg1] - _local5) / _local6), ((_local14[_arg2] - _local7) / _local8));
_local18 = new NumberUV(((_local15[_arg1] - _local5) / _local6), ((_local15[_arg2] - _local7) / _local8));
_local11.uv = [_local16, _local17, _local18];
};
}
}
}//package org.papervision3d.core.geom
Section 74
//Vertex2D (org.papervision3d.core.geom.Vertex2D)
package org.papervision3d.core.geom {
import org.papervision3d.core.*;
public class Vertex2D {
public var visible:Boolean;
public var normal:Number3D;
public var extra:Object;
public var x:Number;
public var y:Number;
public var z:Number;
public function Vertex2D(_arg1:Number=0, _arg2:Number=0, _arg3:Number=0){
this.x = _arg1;
this.y = _arg2;
this.z = _arg3;
this.visible = false;
this.normal = new Number3D();
}
public function clone():Vertex2D{
var _local1:Vertex2D;
_local1 = new Vertex2D(x, y, z);
_local1.visible = visible;
_local1.extra = extra;
return (_local1);
}
}
}//package org.papervision3d.core.geom
Section 75
//Vertex3D (org.papervision3d.core.geom.Vertex3D)
package org.papervision3d.core.geom {
import org.papervision3d.core.*;
import flash.utils.*;
public class Vertex3D {
public var vertex2DInstance:Vertex2D;
public var connectedFaces:Dictionary;
public var normal:Number3D;
public var extra:Object;
public var x:Number;
public var y:Number;
public var z:Number;
public function Vertex3D(_arg1:Number=0, _arg2:Number=0, _arg3:Number=0){
this.x = _arg1;
this.y = _arg2;
this.z = _arg3;
this.vertex2DInstance = new Vertex2D();
this.normal = new Number3D();
this.connectedFaces = new Dictionary();
}
public function calculateNormal():void{
var _local1:Face3D;
normal = new Number3D();
for each (_local1 in connectedFaces) {
normal = Number3D.add(_local1.faceNormal, normal);
};
normal.normalize();
}
public function toNumber3D():Number3D{
return (new Number3D(x, y, z));
}
public function clone():Vertex3D{
var _local1:Vertex3D;
_local1 = new Vertex3D(x, y, z);
_local1.extra = extra;
_local1.vertex2DInstance = vertex2DInstance.clone();
_local1.normal = normal.clone();
return (_local1);
}
}
}//package org.papervision3d.core.geom
Section 76
//Vertices3D (org.papervision3d.core.geom.Vertices3D)
package org.papervision3d.core.geom {
import org.papervision3d.objects.*;
import org.papervision3d.core.proto.*;
import org.papervision3d.core.*;
import org.papervision3d.scenes.*;
public class Vertices3D extends DisplayObject3D {
public function Vertices3D(_arg1:Array, _arg2:String=null, _arg3:Object=null){
super(_arg2, new GeometryObject3D(), _arg3);
this.geometry.vertices = ((_arg1) || (new Array()));
}
override public function project(_arg1:DisplayObject3D, _arg2:CameraObject3D, _arg3:Array=null):Number{
var _local4:Matrix3D;
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;
var _local17:Number;
var _local18:Number;
var _local19:Number;
var _local20:Vertex3D;
var _local21:Vertex2D;
var _local22:Number;
var _local23:Array;
var _local24:int;
var _local25:Number;
var _local26:Number;
super.project(_arg1, _arg2, _arg3);
_local4 = this.view;
_local5 = _local4.n11;
_local6 = _local4.n12;
_local7 = _local4.n13;
_local8 = _local4.n21;
_local9 = _local4.n22;
_local10 = _local4.n23;
_local11 = _local4.n31;
_local12 = _local4.n32;
_local13 = _local4.n33;
_local23 = this.geometry.vertices;
_local24 = _local23.length;
_local25 = _arg2.focus;
_local26 = (_local25 * _arg2.zoom);
while ((_local20 = _local23[--_local24])) {
_local14 = _local20.x;
_local15 = _local20.y;
_local16 = _local20.z;
_local19 = ((((_local14 * _local11) + (_local15 * _local12)) + (_local16 * _local13)) + _local4.n34);
_local21 = _local20.vertex2DInstance;
if ((_local21.visible = (_local19 > 0))){
_local17 = ((((_local14 * _local5) + (_local15 * _local6)) + (_local16 * _local7)) + _local4.n14);
_local18 = ((((_local14 * _local8) + (_local15 * _local9)) + (_local16 * _local10)) + _local4.n24);
_local22 = (_local26 / (_local25 + _local19));
_local21.x = (_local17 * _local22);
_local21.y = (_local18 * _local22);
_local21.z = _local19;
};
};
return (0);
}
public function transformVertices(_arg1:Matrix3D):void{
var _local2:Number;
var _local3:Number;
var _local4:Number;
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:Number;
var _local9:Number;
var _local10:Number;
var _local11:Number;
var _local12:Number;
var _local13:Number;
var _local14:Array;
var _local15:int;
var _local16:Vertex3D;
var _local17:Number;
var _local18:Number;
var _local19:Number;
var _local20:Number;
var _local21:Number;
var _local22:Number;
_local2 = _arg1.n11;
_local3 = _arg1.n12;
_local4 = _arg1.n13;
_local5 = _arg1.n21;
_local6 = _arg1.n22;
_local7 = _arg1.n23;
_local8 = _arg1.n31;
_local9 = _arg1.n32;
_local10 = _arg1.n33;
_local11 = _arg1.n14;
_local12 = _arg1.n24;
_local13 = _arg1.n34;
_local14 = this.geometry.vertices;
_local15 = _local14.length;
while ((_local16 = _local14[--_local15])) {
_local17 = _local16.x;
_local18 = _local16.y;
_local19 = _local16.z;
_local20 = ((((_local17 * _local2) + (_local18 * _local3)) + (_local19 * _local4)) + _local11);
_local21 = ((((_local17 * _local5) + (_local18 * _local6)) + (_local19 * _local7)) + _local12);
_local22 = ((((_local17 * _local8) + (_local18 * _local9)) + (_local19 * _local10)) + _local13);
_local16.x = _local20;
_local16.y = _local21;
_local16.z = _local22;
};
}
public function boundingBox():Object{
var _local1:Object;
var _local2:Object;
var _local3:String;
var _local4:Vertex3D;
_local1 = this.geometry.vertices;
_local2 = new Object();
_local2.min = new Number3D();
_local2.max = new Number3D();
_local2.size = new Number3D();
for (_local3 in _local1) {
_local4 = _local1[Number(_local3)];
_local2.min.x = ((_local2.min.x)==undefined) ? _local4.x : Math.min(_local4.x, _local2.min.x);
_local2.max.x = ((_local2.max.x)==undefined) ? _local4.x : Math.max(_local4.x, _local2.max.x);
_local2.min.y = ((_local2.min.y)==undefined) ? _local4.y : Math.min(_local4.y, _local2.min.y);
_local2.max.y = ((_local2.max.y)==undefined) ? _local4.y : Math.max(_local4.y, _local2.max.y);
_local2.min.z = ((_local2.min.z)==undefined) ? _local4.z : Math.min(_local4.z, _local2.min.z);
_local2.max.z = ((_local2.max.z)==undefined) ? _local4.z : Math.max(_local4.z, _local2.max.z);
};
_local2.size.x = (_local2.max.x - _local2.min.x);
_local2.size.y = (_local2.max.y - _local2.min.y);
_local2.size.z = (_local2.max.z - _local2.min.z);
return (_local2);
}
}
}//package org.papervision3d.core.geom
Section 77
//CameraObject3D (org.papervision3d.core.proto.CameraObject3D)
package org.papervision3d.core.proto {
import org.papervision3d.objects.*;
import org.papervision3d.core.*;
public class CameraObject3D extends DisplayObject3D {
public var sort:Boolean;
public var zoom:Number;
public var focus:Number;
private static var _flipY:Matrix3D = Matrix3D.scaleMatrix(1, -1, 1);
public static var DEFAULT_POS:Number3D = new Number3D(0, 0, -1000);
public function CameraObject3D(_arg1:Number=3, _arg2:Number=500, _arg3:Object=null){
this.x = (_arg3) ? ((_arg3.x) || (DEFAULT_POS.x)) : DEFAULT_POS.x;
this.y = (_arg3) ? ((_arg3.y) || (DEFAULT_POS.y)) : DEFAULT_POS.y;
this.z = (_arg3) ? ((_arg3.z) || (DEFAULT_POS.z)) : DEFAULT_POS.z;
this.zoom = _arg1;
this.focus = _arg2;
this.sort = (_arg3) ? !((_arg3.sort == false)) : true;
}
public function transformView(_arg1:Matrix3D=null):void{
this.view = Matrix3D.inverse(Matrix3D.multiply(((_arg1) || (this.transform)), _flipY));
}
public function pan(_arg1:Number):void{
super.yaw(_arg1);
}
public function tilt(_arg1:Number):void{
super.pitch(_arg1);
}
}
}//package org.papervision3d.core.proto
Section 78
//DisplayObjectContainer3D (org.papervision3d.core.proto.DisplayObjectContainer3D)
package org.papervision3d.core.proto {
import flash.events.*;
import org.papervision3d.objects.*;
import org.papervision3d.materials.*;
import flash.utils.*;
import org.papervision3d.*;
public class DisplayObjectContainer3D extends EventDispatcher {
protected var _children:Dictionary;
public var root:DisplayObjectContainer3D;
private var _childrenTotal:int;
protected var _childrenByName:Object;
public function DisplayObjectContainer3D():void{
this._children = new Dictionary(false);
this._childrenByName = new Dictionary(true);
this._childrenTotal = 0;
}
public function getChildByName(_arg1:String):DisplayObject3D{
return (this._childrenByName[_arg1]);
}
public function addCollada(_arg1:String, _arg2:MaterialsList=null, _arg3:Number=1):void{
Papervision3D.log("The addCollada() method has been deprecated. Use addChildren( new Collada( filename ) )");
}
public function removeChildByName(_arg1:String):DisplayObject3D{
return (removeChild(getChildByName(_arg1)));
}
public function get numChildren():int{
return (this._childrenTotal);
}
override public function toString():String{
return (childrenList());
}
public function addChildren(_arg1:DisplayObject3D):DisplayObjectContainer3D{
var _local2:DisplayObject3D;
for each (_local2 in _arg1.children) {
_arg1.removeChild(_local2);
this.addChild(_local2);
};
return (this);
}
public function removeChild(_arg1:DisplayObject3D):DisplayObject3D{
if (_arg1){
delete this._childrenByName[this._children[_arg1]];
delete this._children[_arg1];
_arg1.parent = null;
_arg1.root = null;
return (_arg1);
};
return (null);
}
public function addChild(_arg1:DisplayObject3D, _arg2:String=null):DisplayObject3D{
_arg2 = ((((_arg2) || (_arg1.name))) || (String(_arg1.id)));
this._children[_arg1] = _arg2;
this._childrenByName[_arg2] = _arg1;
this._childrenTotal++;
_arg1.parent = this;
_arg1.root = this.root;
return (_arg1);
}
public function childrenList():String{
var _local1:String;
var _local2:String;
_local1 = "";
for (_local2 in this._children) {
_local1 = (_local1 + (_local2 + "\n"));
};
return (_local1);
}
public function get children():Object{
return (this._childrenByName);
}
}
}//package org.papervision3d.core.proto
Section 79
//GeometryObject3D (org.papervision3d.core.proto.GeometryObject3D)
package org.papervision3d.core.proto {
import flash.events.*;
import org.papervision3d.core.geom.*;
import org.papervision3d.materials.*;
import org.papervision3d.core.*;
import flash.utils.*;
import org.papervision3d.scenes.*;
public class GeometryObject3D extends EventDispatcher {
protected var _boundingSphere2:Number;
protected var _boundingSphereDirty:Boolean;// = true
public var _ready:Boolean;// = false
protected var _material:MaterialObject3D;
public var faces:Array;
public var vertices:Array;
public function GeometryObject3D(_arg1:Object=null):void{
_ready = false;
_boundingSphereDirty = true;
super();
}
public function transformVertices(_arg1:Matrix3D):void{
}
public function get boundingSphere2():Number{
if (_boundingSphereDirty){
return (getBoundingSphere2());
};
return (_boundingSphere2);
}
public function getBoundingSphere2():Number{
var _local1:Number;
var _local2:Number;
var _local3:Vertex3D;
_local1 = 0;
for each (_local3 in this.vertices) {
_local2 = (((_local3.x * _local3.x) + (_local3.y * _local3.y)) + (_local3.z * _local3.z));
_local1 = ((_local2)>_local1) ? _local2 : _local1;
};
this._boundingSphereDirty = false;
return ((_boundingSphere2 = _local1));
}
private function createVertexNormals():void{
var _local1:Dictionary;
var _local2:Face3D;
var _local3:Vertex3D;
_local1 = new Dictionary(true);
for each (_local2 in faces) {
_local2.v0.connectedFaces[_local2] = _local2;
_local2.v1.connectedFaces[_local2] = _local2;
_local2.v2.connectedFaces[_local2] = _local2;
_local1[_local2.v0] = _local2.v0;
_local1[_local2.v1] = _local2.v1;
_local1[_local2.v2] = _local2.v2;
};
for each (_local3 in _local1) {
_local3.calculateNormal();
};
}
public function transformUV(_arg1:MaterialObject3D):void{
var _local2:String;
if (_arg1.bitmap){
for (_local2 in this.faces) {
faces[_local2].transformUV(_arg1);
};
};
}
public function set ready(_arg1:Boolean):void{
if (_arg1){
createVertexNormals();
};
_ready = _arg1;
}
public function get ready():Boolean{
return (_ready);
}
}
}//package org.papervision3d.core.proto
Section 80
//MaterialObject3D (org.papervision3d.core.proto.MaterialObject3D)
package org.papervision3d.core.proto {
import flash.display.*;
import flash.events.*;
import org.papervision3d.objects.*;
import org.papervision3d.core.geom.*;
import org.papervision3d.materials.*;
import org.papervision3d.core.draw.*;
public class MaterialObject3D extends EventDispatcher implements IFaceDrawer {
public var widthOffset:Number;// = 0
public var name:String;
public var scene:SceneObject3D;
public var needsVertexNormals:Boolean;// = false
public var heightOffset:Number;// = 0
public var fillAlpha:Number;// = 0
public var fillColor:Number;
public var id:Number;
public var invisible:Boolean;// = false
public var smooth:Boolean;// = false
public var bitmap:BitmapData;
public var lineColor:Number;
public var lineAlpha:Number;// = 0
public var oneSide:Boolean;// = true
public var lineThickness:Number;// = 1
public var opposite:Boolean;// = false
public var maxU:Number;
public var needsFaceNormals:Boolean;// = false
public var tiled:Boolean;// = false
public var maxV:Number;
public static var DEFAULT_COLOR:int = 0;
public static var DEBUG_COLOR:int = 0xFF00FF;
private static var _totalMaterialObjects:Number = 0;
public function MaterialObject3D(){
smooth = false;
tiled = false;
lineColor = DEFAULT_COLOR;
lineAlpha = 0;
lineThickness = 1;
fillColor = DEFAULT_COLOR;
fillAlpha = 0;
oneSide = true;
invisible = false;
opposite = false;
needsFaceNormals = false;
needsVertexNormals = false;
widthOffset = 0;
heightOffset = 0;
super();
this.id = _totalMaterialObjects++;
}
public function get doubleSided():Boolean{
return (!(this.oneSide));
}
public function drawFace3D(_arg1:DisplayObject3D, _arg2:Face3D, _arg3:Graphics, _arg4:Vertex2D, _arg5:Vertex2D, _arg6:Vertex2D):int{
return (0);
}
public function set doubleSided(_arg1:Boolean):void{
this.oneSide = !(_arg1);
}
public function updateBitmap():void{
}
override public function toString():String{
return (((((("[MaterialObject3D] bitmap:" + this.bitmap) + " lineColor:") + this.lineColor) + " fillColor:") + fillColor));
}
public function copy(_arg1:MaterialObject3D):void{
this.bitmap = _arg1.bitmap;
this.smooth = _arg1.smooth;
this.lineColor = _arg1.lineColor;
this.lineAlpha = _arg1.lineAlpha;
this.fillColor = _arg1.fillColor;
this.fillAlpha = _arg1.fillAlpha;
this.needsFaceNormals = _arg1.needsFaceNormals;
this.needsVertexNormals = _arg1.needsVertexNormals;
this.oneSide = _arg1.oneSide;
this.opposite = _arg1.opposite;
this.invisible = _arg1.invisible;
this.scene = _arg1.scene;
this.name = _arg1.name;
this.maxU = _arg1.maxU;
this.maxV = _arg1.maxV;
}
public function clone():MaterialObject3D{
var _local1:MaterialObject3D;
_local1 = new MaterialObject3D();
_local1.copy(this);
return (_local1);
}
public static function get DEFAULT():MaterialObject3D{
var _local1:MaterialObject3D;
_local1 = new WireframeMaterial();
_local1.lineColor = (0xFFFFFF * Math.random());
_local1.lineAlpha = 1;
_local1.fillColor = DEFAULT_COLOR;
_local1.fillAlpha = 1;
_local1.doubleSided = false;
return (_local1);
}
public static function get DEBUG():MaterialObject3D{
var _local1:MaterialObject3D;
_local1 = new (MaterialObject3D);
_local1.lineColor = (0xFFFFFF * Math.random());
_local1.lineAlpha = 1;
_local1.fillColor = DEBUG_COLOR;
_local1.fillAlpha = 0.37;
_local1.doubleSided = true;
return (_local1);
}
}
}//package org.papervision3d.core.proto
Section 81
//SceneObject3D (org.papervision3d.core.proto.SceneObject3D)
package org.papervision3d.core.proto {
import flash.display.*;
import org.papervision3d.objects.*;
import org.papervision3d.materials.*;
import flash.utils.*;
import org.papervision3d.core.culling.*;
import org.papervision3d.core.stat.*;
import org.papervision3d.*;
public class SceneObject3D extends DisplayObjectContainer3D {
public var triangleCuller:ITriangleCuller;
public var container:Sprite;
private var geometries:Dictionary;
public var objects:Array;
public var stats:RenderStatistics;
public var materials:MaterialsList;
public function SceneObject3D(_arg1:Sprite){
triangleCuller = new DefaultTriangleCuller();
super();
if (_arg1){
this.container = _arg1;
} else {
Papervision3D.log("Scene3D: container argument required.");
};
this.objects = new Array();
this.materials = new MaterialsList();
Papervision3D.log((((((Papervision3D.NAME + " ") + Papervision3D.VERSION) + " (") + Papervision3D.DATE) + ")\n"));
this.stats = new RenderStatistics();
this.stats.points = 0;
this.stats.polys = 0;
this.stats.triangles = 0;
this.stats.performance = 0;
this.stats.rendered = 0;
this.root = this;
}
override public function addChild(_arg1:DisplayObject3D, _arg2:String=null):DisplayObject3D{
var _local3:DisplayObject3D;
_local3 = super.addChild(_arg1, _arg2);
_arg1.scene = this;
this.objects.push(_local3);
return (_local3);
}
public function renderCamera(_arg1:CameraObject3D):void{
var _local2:Array;
var _local3:DisplayObject3D;
var _local4:Number;
stats.clear();
stats.performance = getTimer();
MovieMaterial.updateAnimatedBitmaps();
if (_arg1){
_arg1.transformView();
_local2 = this.objects;
_local4 = _local2.length;
while ((_local3 = _local2[--_local4])) {
if (_local3.visible){
_local3.project(_arg1, _arg1);
};
};
};
if (_arg1.sort){
this.objects.sortOn("screenZ", Array.NUMERIC);
};
renderObjects(_arg1.sort);
}
protected function renderObjects(_arg1:Boolean):void{
}
override public function removeChild(_arg1:DisplayObject3D):DisplayObject3D{
var _local2:int;
super.removeChild(_arg1);
_local2 = 0;
while (_local2 < this.objects.length) {
if (this.objects[_local2] === _arg1){
this.objects.splice(_local2, 1);
return (_arg1);
};
_local2++;
};
return (_arg1);
}
}
}//package org.papervision3d.core.proto
Section 82
//RenderStatistics (org.papervision3d.core.stat.RenderStatistics)
package org.papervision3d.core.stat {
public class RenderStatistics {
public var points:int;// = 0
public var polys:int;// = 0
public var triangles:int;// = 0
public var pixels:Number;
public var performance:int;// = 0
public var rendered:int;// = 0
public var culledTriangles:int;// = 0
public var particles:Number;
public function RenderStatistics(){
performance = 0;
points = 0;
polys = 0;
rendered = 0;
triangles = 0;
culledTriangles = 0;
super();
}
public function clear():void{
performance = 0;
points = 0;
polys = 0;
rendered = 0;
triangles = 0;
pixels = 0;
particles = 0;
culledTriangles = 0;
}
public function toString():String{
return (new String(((((((((("Performance:" + performance) + ", Points:") + points) + " Polys:") + polys) + " Rendered:") + rendered) + " Culled:") + culledTriangles)));
}
}
}//package org.papervision3d.core.stat
Section 83
//Matrix3D (org.papervision3d.core.Matrix3D)
package org.papervision3d.core {
public class Matrix3D {
public var n31:Number;
public var n32:Number;
public var n11:Number;
public var n13:Number;
public var n14:Number;
public var n33:Number;
public var n12:Number;
public var n21:Number;
public var n22:Number;
public var n23:Number;
public var n24:Number;
public var n34:Number;
private static var toDEGREES:Number = (180 / Math.PI);
private static var toRADIANS:Number = (Math.PI / 180);
public function Matrix3D(_arg1:Array=null){
if (((!(_arg1)) || ((_arg1.length < 12)))){
n11 = (n22 = (n33 = 1));
n12 = (n13 = (n14 = (n21 = (n23 = (n24 = (n31 = (n32 = (n34 = 0))))))));
} else {
n11 = _arg1[0];
n12 = _arg1[1];
n13 = _arg1[2];
n14 = _arg1[3];
n21 = _arg1[4];
n22 = _arg1[5];
n23 = _arg1[6];
n24 = _arg1[7];
n31 = _arg1[8];
n32 = _arg1[9];
n33 = _arg1[10];
n34 = _arg1[11];
};
}
public function calculateMultiply3x3(_arg1:Matrix3D, _arg2:Matrix3D):void{
var _local3:Number;
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;
var _local17:Number;
var _local18:Number;
var _local19:Number;
var _local20:Number;
_local3 = _arg1.n11;
_local4 = _arg2.n11;
_local5 = _arg1.n21;
_local6 = _arg2.n21;
_local7 = _arg1.n31;
_local8 = _arg2.n31;
_local9 = _arg1.n12;
_local10 = _arg2.n12;
_local11 = _arg1.n22;
_local12 = _arg2.n22;
_local13 = _arg1.n32;
_local14 = _arg2.n32;
_local15 = _arg1.n13;
_local16 = _arg2.n13;
_local17 = _arg1.n23;
_local18 = _arg2.n23;
_local19 = _arg1.n33;
_local20 = _arg2.n33;
this.n11 = (((_local3 * _local4) + (_local9 * _local6)) + (_local15 * _local8));
this.n12 = (((_local3 * _local10) + (_local9 * _local12)) + (_local15 * _local14));
this.n13 = (((_local3 * _local16) + (_local9 * _local18)) + (_local15 * _local20));
this.n21 = (((_local5 * _local4) + (_local11 * _local6)) + (_local17 * _local8));
this.n22 = (((_local5 * _local10) + (_local11 * _local12)) + (_local17 * _local14));
this.n23 = (((_local5 * _local16) + (_local11 * _local18)) + (_local17 * _local20));
this.n31 = (((_local7 * _local4) + (_local13 * _local6)) + (_local19 * _local8));
this.n32 = (((_local7 * _local10) + (_local13 * _local12)) + (_local19 * _local14));
this.n33 = (((_local7 * _local16) + (_local13 * _local18)) + (_local19 * _local20));
}
public function get trace():Number{
return ((((this.n11 + this.n22) + this.n33) + 1));
}
public function get det():Number{
return ((((((this.n11 * this.n22) - (this.n21 * this.n12)) * this.n33) - (((this.n11 * this.n32) - (this.n31 * this.n12)) * this.n23)) + (((this.n21 * this.n32) - (this.n31 * this.n22)) * this.n13)));
}
public function copy3x3(_arg1:Matrix3D):Matrix3D{
this.n11 = _arg1.n11;
this.n12 = _arg1.n12;
this.n13 = _arg1.n13;
this.n21 = _arg1.n21;
this.n22 = _arg1.n22;
this.n23 = _arg1.n23;
this.n31 = _arg1.n31;
this.n32 = _arg1.n32;
this.n33 = _arg1.n33;
return (this);
}
public function calculateAdd(_arg1:Matrix3D, _arg2:Matrix3D):void{
this.n11 = (_arg1.n11 + _arg2.n11);
this.n12 = (_arg1.n12 + _arg2.n12);
this.n13 = (_arg1.n13 + _arg2.n13);
this.n14 = (_arg1.n14 + _arg2.n14);
this.n21 = (_arg1.n21 + _arg2.n21);
this.n22 = (_arg1.n22 + _arg2.n22);
this.n23 = (_arg1.n23 + _arg2.n23);
this.n24 = (_arg1.n24 + _arg2.n24);
this.n31 = (_arg1.n31 + _arg2.n31);
this.n32 = (_arg1.n32 + _arg2.n32);
this.n33 = (_arg1.n33 + _arg2.n33);
this.n34 = (_arg1.n34 + _arg2.n34);
}
public function calculateMultiply(_arg1:Matrix3D, _arg2:Matrix3D):void{
var _local3:Number;
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;
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;
_local3 = _arg1.n11;
_local4 = _arg2.n11;
_local5 = _arg1.n21;
_local6 = _arg2.n21;
_local7 = _arg1.n31;
_local8 = _arg2.n31;
_local9 = _arg1.n12;
_local10 = _arg2.n12;
_local11 = _arg1.n22;
_local12 = _arg2.n22;
_local13 = _arg1.n32;
_local14 = _arg2.n32;
_local15 = _arg1.n13;
_local16 = _arg2.n13;
_local17 = _arg1.n23;
_local18 = _arg2.n23;
_local19 = _arg1.n33;
_local20 = _arg2.n33;
_local21 = _arg1.n14;
_local22 = _arg2.n14;
_local23 = _arg1.n24;
_local24 = _arg2.n24;
_local25 = _arg1.n34;
_local26 = _arg2.n34;
this.n11 = (((_local3 * _local4) + (_local9 * _local6)) + (_local15 * _local8));
this.n12 = (((_local3 * _local10) + (_local9 * _local12)) + (_local15 * _local14));
this.n13 = (((_local3 * _local16) + (_local9 * _local18)) + (_local15 * _local20));
this.n14 = ((((_local3 * _local22) + (_local9 * _local24)) + (_local15 * _local26)) + _local21);
this.n21 = (((_local5 * _local4) + (_local11 * _local6)) + (_local17 * _local8));
this.n22 = (((_local5 * _local10) + (_local11 * _local12)) + (_local17 * _local14));
this.n23 = (((_local5 * _local16) + (_local11 * _local18)) + (_local17 * _local20));
this.n24 = ((((_local5 * _local22) + (_local11 * _local24)) + (_local17 * _local26)) + _local23);
this.n31 = (((_local7 * _local4) + (_local13 * _local6)) + (_local19 * _local8));
this.n32 = (((_local7 * _local10) + (_local13 * _local12)) + (_local19 * _local14));
this.n33 = (((_local7 * _local16) + (_local13 * _local18)) + (_local19 * _local20));
this.n34 = ((((_local7 * _local22) + (_local13 * _local24)) + (_local19 * _local26)) + _local25);
}
public function toString():String{
var _local1:String;
_local1 = "";
_local1 = (_local1 + ((((((((int((n11 * 1000)) / 1000) + "\t\t") + (int((n12 * 1000)) / 1000)) + "\t\t") + (int((n13 * 1000)) / 1000)) + "\t\t") + (int((n14 * 1000)) / 1000)) + "\n"));
_local1 = (_local1 + ((((((((int((n21 * 1000)) / 1000) + "\t\t") + (int((n22 * 1000)) / 1000)) + "\t\t") + (int((n23 * 1000)) / 1000)) + "\t\t") + (int((n24 * 1000)) / 1000)) + "\n"));
_local1 = (_local1 + ((((((((int((n31 * 1000)) / 1000) + "\t\t") + (int((n32 * 1000)) / 1000)) + "\t\t") + (int((n33 * 1000)) / 1000)) + "\t\t") + (int((n34 * 1000)) / 1000)) + "\n"));
return (_local1);
}
public function copy(_arg1:Matrix3D):Matrix3D{
this.n11 = _arg1.n11;
this.n12 = _arg1.n12;
this.n13 = _arg1.n13;
this.n14 = _arg1.n14;
this.n21 = _arg1.n21;
this.n22 = _arg1.n22;
this.n23 = _arg1.n23;
this.n24 = _arg1.n24;
this.n31 = _arg1.n31;
this.n32 = _arg1.n32;
this.n33 = _arg1.n33;
this.n34 = _arg1.n34;
return (this);
}
public function calculateInverse(_arg1:Matrix3D):void{
var _local2:Number;
var _local3:Number;
var _local4:Number;
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:Number;
var _local9:Number;
var _local10:Number;
var _local11:Number;
var _local12:Number;
var _local13:Number;
var _local14:Number;
_local2 = _arg1.det;
if (Math.abs(_local2) > 0.001){
_local2 = (1 / _local2);
_local3 = _arg1.n11;
_local4 = _arg1.n21;
_local5 = _arg1.n31;
_local6 = _arg1.n12;
_local7 = _arg1.n22;
_local8 = _arg1.n32;
_local9 = _arg1.n13;
_local10 = _arg1.n23;
_local11 = _arg1.n33;
_local12 = _arg1.n14;
_local13 = _arg1.n24;
_local14 = _arg1.n34;
this.n11 = (_local2 * ((_local7 * _local11) - (_local8 * _local10)));
this.n12 = (-(_local2) * ((_local6 * _local11) - (_local8 * _local9)));
this.n13 = (_local2 * ((_local6 * _local10) - (_local7 * _local9)));
this.n14 = (-(_local2) * (((_local6 * ((_local10 * _local14) - (_local11 * _local13))) - (_local7 * ((_local9 * _local14) - (_local11 * _local12)))) + (_local8 * ((_local9 * _local13) - (_local10 * _local12)))));
this.n21 = (-(_local2) * ((_local4 * _local11) - (_local5 * _local10)));
this.n22 = (_local2 * ((_local3 * _local11) - (_local5 * _local9)));
this.n23 = (-(_local2) * ((_local3 * _local10) - (_local4 * _local9)));
this.n24 = (_local2 * (((_local3 * ((_local10 * _local14) - (_local11 * _local13))) - (_local4 * ((_local9 * _local14) - (_local11 * _local12)))) + (_local5 * ((_local9 * _local13) - (_local10 * _local12)))));
this.n31 = (_local2 * ((_local4 * _local8) - (_local5 * _local7)));
this.n32 = (-(_local2) * ((_local3 * _local8) - (_local5 * _local6)));
this.n33 = (_local2 * ((_local3 * _local7) - (_local4 * _local6)));
this.n34 = (-(_local2) * (((_local3 * ((_local7 * _local14) - (_local8 * _local13))) - (_local4 * ((_local6 * _local14) - (_local8 * _local12)))) + (_local5 * ((_local6 * _local13) - (_local7 * _local12)))));
};
}
public static function rotationMatrixWithReference(_arg1:Number3D, _arg2:Number, _arg3:Number3D):Matrix3D{
var _local4:Matrix3D;
_local4 = Matrix3D.translationMatrix(_arg3.x, -(_arg3.y), _arg3.z);
Matrix3D.translationMatrix(_arg3.x, -(_arg3.y), _arg3.z).calculateMultiply(_local4, Matrix3D.rotationMatrix(_arg1.x, _arg1.y, _arg1.z, _arg2));
_local4.calculateMultiply(_local4, Matrix3D.translationMatrix(-(_arg3.x), _arg3.y, -(_arg3.z)));
return (_local4);
}
public static function multiplyVector3x3(_arg1:Matrix3D, _arg2:Number3D):void{
var _local3:Number;
var _local4:Number;
var _local5:Number;
_local3 = _arg2.x;
_local4 = _arg2.y;
_local5 = _arg2.z;
_arg2.x = (((_local3 * _arg1.n11) + (_local4 * _arg1.n12)) + (_local5 * _arg1.n13));
_arg2.y = (((_local3 * _arg1.n21) + (_local4 * _arg1.n22)) + (_local5 * _arg1.n23));
_arg2.z = (((_local3 * _arg1.n31) + (_local4 * _arg1.n32)) + (_local5 * _arg1.n33));
}
public static function multiply3x3(_arg1:Matrix3D, _arg2:Matrix3D):Matrix3D{
var _local3:Matrix3D;
_local3 = new (Matrix3D);
_local3.calculateMultiply3x3(_arg1, _arg2);
return (_local3);
}
public static function normalizeQuaternion(_arg1:Object):Object{
var _local2:Number;
_local2 = magnitudeQuaternion(_arg1);
_arg1.x = (_arg1.x / _local2);
_arg1.y = (_arg1.y / _local2);
_arg1.z = (_arg1.z / _local2);
_arg1.w = (_arg1.w / _local2);
return (_arg1);
}
public static function multiplyVector(_arg1:Matrix3D, _arg2:Number3D):void{
var _local3:Number;
var _local4:Number;
var _local5:Number;
_local3 = _arg2.x;
_local4 = _arg2.y;
_local5 = _arg2.z;
_arg2.x = ((((_local3 * _arg1.n11) + (_local4 * _arg1.n12)) + (_local5 * _arg1.n13)) + _arg1.n14);
_arg2.y = ((((_local3 * _arg1.n21) + (_local4 * _arg1.n22)) + (_local5 * _arg1.n23)) + _arg1.n24);
_arg2.z = ((((_local3 * _arg1.n31) + (_local4 * _arg1.n32)) + (_local5 * _arg1.n33)) + _arg1.n34);
}
public static function axis2quaternion(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Object{
var _local5:Number;
var _local6:Number;
var _local7:Object;
_local5 = Math.sin((_arg4 / 2));
_local6 = Math.cos((_arg4 / 2));
_local7 = new Object();
_local7.x = (_arg1 * _local5);
_local7.y = (_arg2 * _local5);
_local7.z = (_arg3 * _local5);
_local7.w = _local6;
return (normalizeQuaternion(_local7));
}
public static function translationMatrix(_arg1:Number, _arg2:Number, _arg3:Number):Matrix3D{
var _local4:Matrix3D;
_local4 = IDENTITY;
_local4.n14 = _arg1;
_local4.n24 = _arg2;
_local4.n34 = _arg3;
return (_local4);
}
public static function magnitudeQuaternion(_arg1:Object):Number{
return (Math.sqrt(((((_arg1.w * _arg1.w) + (_arg1.x * _arg1.x)) + (_arg1.y * _arg1.y)) + (_arg1.z * _arg1.z))));
}
public static function euler2quaternion(_arg1:Number, _arg2:Number, _arg3:Number):Object{
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:Object;
_local4 = Math.sin((_arg1 * 0.5));
_local5 = Math.cos((_arg1 * 0.5));
_local6 = Math.sin((_arg2 * 0.5));
_local7 = Math.cos((_arg2 * 0.5));
_local8 = Math.sin((_arg3 * 0.5));
_local9 = Math.cos((_arg3 * 0.5));
_local10 = (_local5 * _local7);
_local11 = (_local4 * _local6);
_local12 = new Object();
_local12.x = ((_local8 * _local10) - (_local9 * _local11));
_local12.y = (((_local9 * _local4) * _local7) + ((_local8 * _local5) * _local6));
_local12.z = (((_local9 * _local5) * _local6) - ((_local8 * _local4) * _local7));
_local12.w = ((_local9 * _local10) + (_local8 * _local11));
return (_local12);
}
public static function rotationX(_arg1:Number):Matrix3D{
var _local2:Matrix3D;
var _local3:Number;
var _local4:Number;
_local2 = IDENTITY;
_local3 = Math.cos(_arg1);
_local4 = Math.sin(_arg1);
_local2.n22 = _local3;
_local2.n23 = -(_local4);
_local2.n32 = _local4;
_local2.n33 = _local3;
return (_local2);
}
public static function rotationY(_arg1:Number):Matrix3D{
var _local2:Matrix3D;
var _local3:Number;
var _local4:Number;
_local2 = IDENTITY;
_local3 = Math.cos(_arg1);
_local4 = Math.sin(_arg1);
_local2.n11 = _local3;
_local2.n13 = -(_local4);
_local2.n31 = _local4;
_local2.n33 = _local3;
return (_local2);
}
public static function rotationZ(_arg1:Number):Matrix3D{
var _local2:Matrix3D;
var _local3:Number;
var _local4:Number;
_local2 = IDENTITY;
_local3 = Math.cos(_arg1);
_local4 = Math.sin(_arg1);
_local2.n11 = _local3;
_local2.n12 = -(_local4);
_local2.n21 = _local4;
_local2.n22 = _local3;
return (_local2);
}
public static function clone(_arg1:Matrix3D):Matrix3D{
return (new Matrix3D([_arg1.n11, _arg1.n12, _arg1.n13, _arg1.n14, _arg1.n21, _arg1.n22, _arg1.n23, _arg1.n24, _arg1.n31, _arg1.n32, _arg1.n33, _arg1.n34]));
}
public static function rotationMatrix(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Matrix3D{
var _local5:Matrix3D;
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;
_local5 = IDENTITY;
_local6 = Math.cos(_arg4);
_local7 = Math.sin(_arg4);
_local8 = (1 - _local6);
_local9 = ((_arg1 * _arg2) * _local8);
_local10 = ((_arg2 * _arg3) * _local8);
_local11 = ((_arg1 * _arg3) * _local8);
_local12 = (_local7 * _arg3);
_local13 = (_local7 * _arg2);
_local14 = (_local7 * _arg1);
_local5.n11 = (_local6 + ((_arg1 * _arg1) * _local8));
_local5.n12 = (-(_local12) + _local9);
_local5.n13 = (_local13 + _local11);
_local5.n21 = (_local12 + _local9);
_local5.n22 = (_local6 + ((_arg2 * _arg2) * _local8));
_local5.n23 = (-(_local14) + _local10);
_local5.n31 = (-(_local13) + _local11);
_local5.n32 = (_local14 + _local10);
_local5.n33 = (_local6 + ((_arg3 * _arg3) * _local8));
return (_local5);
}
public static function add(_arg1:Matrix3D, _arg2:Matrix3D):Matrix3D{
var _local3:Matrix3D;
_local3 = new (Matrix3D);
_local3.calculateAdd(_arg1, _arg2);
return (_local3);
}
public static function rotateAxis(_arg1:Matrix3D, _arg2:Number3D):void{
var _local3:Number;
var _local4:Number;
var _local5:Number;
_local3 = _arg2.x;
_local4 = _arg2.y;
_local5 = _arg2.z;
_arg2.x = (((_local3 * _arg1.n11) + (_local4 * _arg1.n12)) + (_local5 * _arg1.n13));
_arg2.y = (((_local3 * _arg1.n21) + (_local4 * _arg1.n22)) + (_local5 * _arg1.n23));
_arg2.z = (((_local3 * _arg1.n31) + (_local4 * _arg1.n32)) + (_local5 * _arg1.n33));
_arg2.normalize();
}
public static function multiply(_arg1:Matrix3D, _arg2:Matrix3D):Matrix3D{
var _local3:Matrix3D;
_local3 = new (Matrix3D);
_local3.calculateMultiply(_arg1, _arg2);
return (_local3);
}
public static function multiplyQuaternion(_arg1:Object, _arg2:Object):Object{
var _local3:Number;
var _local4:Number;
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:Number;
var _local9:Number;
var _local10:Number;
var _local11:Object;
_local3 = _arg1.x;
_local4 = _arg1.y;
_local5 = _arg1.z;
_local6 = _arg1.w;
_local7 = _arg2.x;
_local8 = _arg2.y;
_local9 = _arg2.z;
_local10 = _arg2.w;
_local11 = new Object();
_local11.x = ((((_local6 * _local7) + (_local3 * _local10)) + (_local4 * _local9)) - (_local5 * _local8));
_local11.y = ((((_local6 * _local8) + (_local4 * _local10)) + (_local5 * _local7)) - (_local3 * _local9));
_local11.z = ((((_local6 * _local9) + (_local5 * _local10)) + (_local3 * _local8)) - (_local4 * _local7));
_local11.w = ((((_local6 * _local10) - (_local3 * _local7)) - (_local4 * _local8)) - (_local5 * _local9));
return (_local11);
}
public static function euler2matrix(_arg1:Number3D):Matrix3D{
var _local2:Matrix3D;
var _local3:Number;
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;
_local2 = IDENTITY;
_local3 = (_arg1.x * toRADIANS);
_local4 = (_arg1.y * toRADIANS);
_local5 = (_arg1.z * toRADIANS);
_local6 = Math.cos(_local3);
_local7 = Math.sin(_local3);
_local8 = Math.cos(_local4);
_local9 = Math.sin(_local4);
_local10 = Math.cos(_local5);
_local11 = Math.sin(_local5);
_local12 = (_local6 * _local9);
_local13 = (_local7 * _local9);
_local2.n11 = (_local8 * _local10);
_local2.n12 = (-(_local8) * _local11);
_local2.n13 = _local9;
_local2.n21 = ((_local13 * _local10) + (_local6 * _local11));
_local2.n22 = ((-(_local13) * _local11) + (_local6 * _local10));
_local2.n23 = (-(_local7) * _local8);
_local2.n31 = ((-(_local12) * _local10) + (_local7 * _local11));
_local2.n32 = ((_local12 * _local11) + (_local7 * _local10));
_local2.n33 = (_local6 * _local8);
return (_local2);
}
public static function scaleMatrix(_arg1:Number, _arg2:Number, _arg3:Number):Matrix3D{
var _local4:Matrix3D;
_local4 = IDENTITY;
_local4.n11 = _arg1;
_local4.n22 = _arg2;
_local4.n33 = _arg3;
return (_local4);
}
public static function quaternion2matrix(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Matrix3D{
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:Matrix3D;
_local5 = (_arg1 * _arg1);
_local6 = (_arg1 * _arg2);
_local7 = (_arg1 * _arg3);
_local8 = (_arg1 * _arg4);
_local9 = (_arg2 * _arg2);
_local10 = (_arg2 * _arg3);
_local11 = (_arg2 * _arg4);
_local12 = (_arg3 * _arg3);
_local13 = (_arg3 * _arg4);
_local14 = IDENTITY;
_local14.n11 = (1 - (2 * (_local9 + _local12)));
_local14.n12 = (2 * (_local6 - _local13));
_local14.n13 = (2 * (_local7 + _local11));
_local14.n21 = (2 * (_local6 + _local13));
_local14.n22 = (1 - (2 * (_local5 + _local12)));
_local14.n23 = (2 * (_local10 - _local8));
_local14.n31 = (2 * (_local7 - _local11));
_local14.n32 = (2 * (_local10 + _local8));
_local14.n33 = (1 - (2 * (_local5 + _local9)));
return (_local14);
}
public static function inverse(_arg1:Matrix3D):Matrix3D{
var _local2:Matrix3D;
_local2 = new (Matrix3D);
_local2.calculateInverse(_arg1);
return (_local2);
}
public static function matrix2euler(_arg1:Matrix3D):Number3D{
var _local2:Number3D;
var _local3:Number3D;
var _local4:Number3D;
var _local5:Number3D;
var _local6:Matrix3D;
var _local7:Matrix3D;
var _local8:Matrix3D;
var _local9:Number;
_local2 = new Number3D();
_local3 = new Number3D(_arg1.n11, _arg1.n21, _arg1.n31);
_local4 = new Number3D(_arg1.n12, _arg1.n22, _arg1.n32);
_local5 = new Number3D(_arg1.n13, _arg1.n23, _arg1.n33);
_local3.normalize();
_local4.normalize();
_local5.normalize();
_local6 = new Matrix3D([_local3.x, _local4.x, _local5.x, 0, _local3.y, _local4.y, _local5.y, 0, _local3.z, _local4.z, _local5.z, 0]);
_local2.x = Math.atan2(_local6.n23, _local6.n33);
_local7 = Matrix3D.rotationX(-(_local2.x));
_local8 = Matrix3D.multiply(_local7, _local6);
_local9 = Math.sqrt(((_local8.n11 * _local8.n11) + (_local8.n21 * _local8.n21)));
_local2.y = Math.atan2(-(_local8.n31), _local9);
_local2.z = Math.atan2(-(_local8.n12), _local8.n11);
if (_local2.x == Math.PI){
if (_local2.y > 0){
_local2.y = (_local2.y - Math.PI);
} else {
_local2.y = (_local2.y + Math.PI);
};
_local2.x = 0;
_local2.z = (_local2.z + Math.PI);
};
_local2.x = (_local2.x * toDEGREES);
_local2.y = (_local2.y * toDEGREES);
_local2.z = (_local2.z * toDEGREES);
return (_local2);
}
public static function get IDENTITY():Matrix3D{
return (new Matrix3D([1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0]));
}
}
}//package org.papervision3d.core
Section 84
//Number3D (org.papervision3d.core.Number3D)
package org.papervision3d.core {
public class Number3D {
public var x:Number;
public var y:Number;
public var z:Number;
public function Number3D(_arg1:Number=0, _arg2:Number=0, _arg3:Number=0){
this.x = _arg1;
this.y = _arg2;
this.z = _arg3;
}
public function toString():String{
return (((((("x:" + x) + " y:") + y) + " z:") + z));
}
public function normalize():void{
var _local1:Number;
_local1 = this.modulo;
if (((!((_local1 == 0))) && (!((_local1 == 1))))){
this.x = (this.x / _local1);
this.y = (this.y / _local1);
this.z = (this.z / _local1);
};
}
public function get modulo():Number{
return (Math.sqrt((((this.x * this.x) + (this.y * this.y)) + (this.z * this.z))));
}
public function copyTo(_arg1:Number3D):void{
_arg1.x = x;
_arg1.y = y;
_arg1.z = z;
}
public function clone():Number3D{
return (new Number3D(this.x, this.y, this.z));
}
public static function sub(_arg1:Number3D, _arg2:Number3D):Number3D{
return (new Number3D((_arg1.x - _arg2.x), (_arg1.y - _arg2.y), (_arg1.z - _arg2.z)));
}
public static function add(_arg1:Number3D, _arg2:Number3D):Number3D{
return (new Number3D((_arg1.x + _arg2.x), (_arg1.y + _arg2.y), (_arg1.z + _arg2.z)));
}
public static function cross(_arg1:Number3D, _arg2:Number3D):Number3D{
return (new Number3D(((_arg2.y * _arg1.z) - (_arg2.z * _arg1.y)), ((_arg2.z * _arg1.x) - (_arg2.x * _arg1.z)), ((_arg2.x * _arg1.y) - (_arg2.y * _arg1.x))));
}
public static function get ZERO():Number3D{
return (new Number3D(0, 0, 0));
}
public static function dot(_arg1:Number3D, _arg2:Number3D):Number{
return ((((_arg1.x * _arg2.x) + (_arg1.y * _arg2.y)) + (_arg2.z * _arg1.z)));
}
}
}//package org.papervision3d.core
Section 85
//NumberUV (org.papervision3d.core.NumberUV)
package org.papervision3d.core {
public class NumberUV {
public var u:Number;
public var v:Number;
public function NumberUV(_arg1:Number=0, _arg2:Number=0){
this.u = _arg1;
this.v = _arg2;
}
public function toString():String{
return (((("u:" + u) + " v:") + v));
}
public function clone():NumberUV{
return (new NumberUV(this.u, this.v));
}
public static function get ZERO():NumberUV{
return (new NumberUV(0, 0));
}
}
}//package org.papervision3d.core
Section 86
//InteractiveScene3DEvent (org.papervision3d.events.InteractiveScene3DEvent)
package org.papervision3d.events {
import flash.display.*;
import flash.events.*;
import org.papervision3d.objects.*;
import org.papervision3d.core.geom.*;
import org.papervision3d.utils.*;
public class InteractiveScene3DEvent extends Event {
public var sprite:Sprite;// = null
public var interactiveContainerData:InteractiveContainerData;// = null
public var displayObject3D:DisplayObject3D;// = null
public var face3d:Face3D;// = null
public static const OBJECT_ADDED:String = "objectAdded";
public static const OBJECT_PRESS:String = "mousePress";
public static const OBJECT_RELEASE:String = "mouseRelease";
public static const OBJECT_CLICK:String = "mouseClick";
public static const OBJECT_RELEASE_OUTSIDE:String = "mouseReleaseOutside";
public static const OBJECT_OUT:String = "mouseOut";
public static const OBJECT_MOVE:String = "mouseMove";
public static const OBJECT_OVER:String = "mouseOver";
public function InteractiveScene3DEvent(_arg1:String, _arg2:DisplayObject3D=null, _arg3:Sprite=null, _arg4:Face3D=null, _arg5:InteractiveContainerData=null, _arg6:Boolean=false, _arg7:Boolean=false){
displayObject3D = null;
sprite = null;
face3d = null;
interactiveContainerData = null;
super(_arg1, _arg6, _arg7);
this.displayObject3D = _arg2;
this.sprite = _arg3;
this.face3d = _arg4;
this.interactiveContainerData = _arg5;
}
}
}//package org.papervision3d.events
Section 87
//BitmapMaterial (org.papervision3d.materials.BitmapMaterial)
package org.papervision3d.materials {
import flash.display.*;
import flash.geom.*;
import org.papervision3d.objects.*;
import org.papervision3d.core.geom.*;
import org.papervision3d.core.proto.*;
import org.papervision3d.core.draw.*;
import flash.utils.*;
import org.papervision3d.*;
public class BitmapMaterial extends MaterialObject3D implements IFaceDrawer {
public var uvMatrices:Dictionary;
protected var _texture:Object;
public static var AUTO_MIP_MAPPING:Boolean = false;
protected static var _localMatrix:Matrix = new Matrix();
public static var MIP_MAP_DEPTH:Number = 8;
protected static var _triMatrix:Matrix = new Matrix();
public function BitmapMaterial(_arg1:BitmapData=null){
uvMatrices = new Dictionary();
super();
if (_arg1){
texture = _arg1;
};
}
override public function drawFace3D(_arg1:DisplayObject3D, _arg2:Face3D, _arg3:Graphics, _arg4:Vertex2D, _arg5:Vertex2D, _arg6:Vertex2D):int{
var _local7:Matrix;
var _local8:Number;
var _local9:Number;
var _local10:Number;
var _local11:Number;
var _local12:Number;
var _local13:Number;
if (lineAlpha){
_arg3.lineStyle(0, lineColor, lineAlpha);
};
if (bitmap){
_local7 = ((uvMatrices[_arg2]) || (transformUV(_arg2, _arg1)));
_local8 = _arg4.x;
_local9 = _arg4.y;
_local10 = _arg5.x;
_local11 = _arg5.y;
_local12 = _arg6.x;
_local13 = _arg6.y;
_triMatrix.a = (_local10 - _local8);
_triMatrix.b = (_local11 - _local9);
_triMatrix.c = (_local12 - _local8);
_triMatrix.d = (_local13 - _local9);
_triMatrix.tx = _local8;
_triMatrix.ty = _local9;
_localMatrix.a = _local7.a;
_localMatrix.b = _local7.b;
_localMatrix.c = _local7.c;
_localMatrix.d = _local7.d;
_localMatrix.tx = _local7.tx;
_localMatrix.ty = _local7.ty;
_localMatrix.concat(_triMatrix);
_arg3.beginBitmapFill(bitmap, _localMatrix, tiled, smooth);
};
_arg3.moveTo(_local8, _local9);
_arg3.lineTo(_local10, _local11);
_arg3.lineTo(_local12, _local13);
_arg3.lineTo(_local8, _local9);
if (bitmap){
_arg3.endFill();
};
if (lineAlpha){
_arg3.lineStyle();
};
return (1);
}
public function resetMapping():void{
uvMatrices = new Dictionary();
}
public function transformUV(_arg1:Face3D, _arg2:DisplayObject3D=null):Matrix{
var _local3:Array;
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:Matrix;
var _local17:Matrix;
if (!_arg1.uv){
Papervision3D.log("MaterialObject3D: transformUV() uv not found!");
} else {
if (bitmap){
_local3 = _arg1.uv;
_local4 = (bitmap.width * maxU);
_local5 = (bitmap.height * maxV);
_local6 = (_local4 * _local3[0].u);
_local7 = (_local5 * (1 - _local3[0].v));
_local8 = (_local4 * _local3[1].u);
_local9 = (_local5 * (1 - _local3[1].v));
_local10 = (_local4 * _local3[2].u);
_local11 = (_local5 * (1 - _local3[2].v));
if ((((((_local6 == _local8)) && ((_local7 == _local9)))) || ((((_local6 == _local10)) && ((_local7 == _local11)))))){
_local6 = (_local6 - ((_local6)>0.05) ? 0.05 : -0.05);
_local7 = (_local7 - ((_local7)>0.07) ? 0.07 : -0.07);
};
if ((((_local10 == _local8)) && ((_local11 == _local9)))){
_local10 = (_local10 - ((_local10)>0.05) ? 0.04 : -0.04);
_local11 = (_local11 - ((_local11)>0.06) ? 0.06 : -0.06);
};
_local12 = (_local8 - _local6);
_local13 = (_local9 - _local7);
_local14 = (_local10 - _local6);
_local15 = (_local11 - _local7);
_local16 = new Matrix(_local12, _local13, _local14, _local15, _local6, _local7);
_local16.invert();
_local17 = ((uvMatrices[_arg1]) || ((uvMatrices[_arg1] = _local16.clone())));
_local17.a = _local16.a;
_local17.b = _local16.b;
_local17.c = _local16.c;
_local17.d = _local16.d;
_local17.tx = _local16.tx;
_local17.ty = _local16.ty;
} else {
Papervision3D.log("MaterialObject3D: transformUV() material.bitmap not found!");
};
};
return (_local17);
}
public function get texture():Object{
return (this._texture);
}
protected function correctBitmap(_arg1:BitmapData):BitmapData{
var _local2:BitmapData;
var _local3:Number;
var _local4:Number;
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:Boolean;
_local3 = (1 << MIP_MAP_DEPTH);
_local4 = (_arg1.width / _local3);
_local4 = ((_local4 == uint(_local4))) ? _local4 : (uint(_local4) + 1);
_local5 = (_arg1.height / _local3);
_local5 = ((_local5 == uint(_local5))) ? _local5 : (uint(_local5) + 1);
_local6 = (_local3 * _local4);
_local7 = (_local3 * _local5);
_local8 = true;
if (_local6 > 2880){
_local6 = _arg1.width;
_local8 = false;
};
if (_local7 > 2880){
_local7 = _arg1.height;
_local8 = false;
};
if (!_local8){
Papervision3D.log((("Material " + this.name) + ": Texture too big for mip mapping. Resizing recommended for better performance and quality."));
};
if (((_arg1) && (((!(((_arg1.width % _local3) == 0))) || (!(((_arg1.height % _local3) == 0))))))){
_local2 = new BitmapData(_local6, _local7, _arg1.transparent, 0);
widthOffset = _arg1.width;
heightOffset = _arg1.height;
this.maxU = (_arg1.width / _local6);
this.maxV = (_arg1.height / _local7);
_local2.draw(_arg1);
extendBitmapEdges(_local2, _arg1.width, _arg1.height);
} else {
this.maxU = (this.maxV = 1);
_local2 = _arg1;
};
return (_local2);
}
public function set texture(_arg1:Object):void{
if ((_arg1 is BitmapData) == false){
Papervision3D.log("Error: BitmapMaterial.texture requires a BitmapData object for the texture");
return;
};
bitmap = createBitmap(BitmapData(_arg1));
_texture = _arg1;
}
protected function createBitmap(_arg1:BitmapData):BitmapData{
resetMapping();
if (AUTO_MIP_MAPPING){
return (correctBitmap(_arg1));
};
this.maxU = (this.maxV = 1);
return (_arg1);
}
override public function toString():String{
return (((((("Texture:" + this.texture) + " lineColor:") + this.lineColor) + " lineAlpha:") + this.lineAlpha));
}
override public function copy(_arg1:MaterialObject3D):void{
super.copy(_arg1);
this.maxU = _arg1.maxU;
this.maxV = _arg1.maxV;
}
protected function extendBitmapEdges(_arg1:BitmapData, _arg2:Number, _arg3:Number):void{
var _local4:Rectangle;
var _local5:Point;
var _local6:int;
_local4 = new Rectangle();
_local5 = new Point();
if (_arg1.width > _arg2){
_local4.x = (_arg2 - 1);
_local4.y = 0;
_local4.width = 1;
_local4.height = _arg3;
_local5.y = 0;
_local6 = _arg2;
while (_local6 < _arg1.width) {
_local5.x = _local6;
_arg1.copyPixels(_arg1, _local4, _local5);
_local6++;
};
};
if (_arg1.height > _arg3){
_local4.x = 0;
_local4.y = (_arg3 - 1);
_local4.width = _arg1.width;
_local4.height = 1;
_local5.x = 0;
_local6 = _arg3;
while (_local6 < _arg1.height) {
_local5.y = _local6;
_arg1.copyPixels(_arg1, _local4, _local5);
_local6++;
};
};
}
override public function clone():MaterialObject3D{
var _local1:MaterialObject3D;
_local1 = super.clone();
_local1.maxU = this.maxU;
_local1.maxV = this.maxV;
return (_local1);
}
}
}//package org.papervision3d.materials
Section 88
//InteractiveBitmapMaterial (org.papervision3d.materials.InteractiveBitmapMaterial)
package org.papervision3d.materials {
import flash.display.*;
import org.papervision3d.objects.*;
import org.papervision3d.core.geom.*;
public class InteractiveBitmapMaterial extends BitmapMaterial {
public function InteractiveBitmapMaterial(_arg1:BitmapData){
super(_arg1);
}
override public function drawFace3D(_arg1:DisplayObject3D, _arg2:Face3D, _arg3:Graphics, _arg4:Vertex2D, _arg5:Vertex2D, _arg6:Vertex2D):int{
var _local7:int;
_local7 = super.drawFace3D(_arg1, _arg2, _arg3, _arg4, _arg5, _arg6);
if (((!((_arg1.interactiveSceneManager == null))) && (_local7))){
_arg1.interactiveSceneManager.drawFace(_arg1, _arg2, _arg4.x, _arg5.x, _arg6.x, _arg4.y, _arg5.y, _arg6.y);
};
return (_local7);
}
}
}//package org.papervision3d.materials
Section 89
//InteractiveMovieMaterial (org.papervision3d.materials.InteractiveMovieMaterial)
package org.papervision3d.materials {
import flash.display.*;
import org.papervision3d.objects.*;
import org.papervision3d.core.geom.*;
public class InteractiveMovieMaterial extends MovieMaterial {
public function InteractiveMovieMaterial(_arg1:Sprite, _arg2:Boolean=false, _arg3:Boolean=false){
super(_arg1, _arg2, _arg3);
}
override public function drawFace3D(_arg1:DisplayObject3D, _arg2:Face3D, _arg3:Graphics, _arg4:Vertex2D, _arg5:Vertex2D, _arg6:Vertex2D):int{
var _local7:int;
_local7 = super.drawFace3D(_arg1, _arg2, _arg3, _arg4, _arg5, _arg6);
if (((!((_arg1.interactiveSceneManager == null))) && (_local7))){
_arg1.interactiveSceneManager.drawFace(_arg1, _arg2, _arg4.x, _arg5.x, _arg6.x, _arg4.y, _arg5.y, _arg6.y);
};
return (_local7);
}
}
}//package org.papervision3d.materials
Section 90
//MaterialsList (org.papervision3d.materials.MaterialsList)
package org.papervision3d.materials {
import org.papervision3d.core.proto.*;
import flash.utils.*;
public class MaterialsList {
public var materialsByName:Dictionary;
protected var _materials:Dictionary;
private var _materialsTotal:int;
public function MaterialsList(_arg1=null):void{
var _local2:String;
var _local3:String;
super();
this.materialsByName = new Dictionary(true);
this._materials = new Dictionary(false);
this._materialsTotal = 0;
if (_arg1){
if ((_arg1 is Array)){
for (_local2 in _arg1) {
this.addMaterial(_arg1[_local2]);
};
} else {
if ((_arg1 is Object)){
for (_local3 in _arg1) {
this.addMaterial(_arg1[_local3], _local3);
};
};
};
};
}
public function get numMaterials():int{
return (this._materialsTotal);
}
public function addMaterial(_arg1:MaterialObject3D, _arg2:String=null):MaterialObject3D{
_arg2 = ((((_arg2) || (_arg1.name))) || (String(_arg1.id)));
this._materials[_arg1] = _arg2;
this.materialsByName[_arg2] = _arg1;
this._materialsTotal++;
return (_arg1);
}
public function removeMaterial(_arg1:MaterialObject3D):MaterialObject3D{
delete this.materialsByName[this._materials[_arg1]];
delete this._materials[_arg1];
return (_arg1);
}
public function toString():String{
var _local1:String;
var _local2:MaterialObject3D;
_local1 = "";
for each (_local2 in this.materialsByName) {
_local1 = (_local1 + (this._materials[_local2] + "\n"));
};
return (_local1);
}
public function removeMaterialByName(_arg1:String):MaterialObject3D{
return (removeMaterial(getMaterialByName(_arg1)));
}
public function clone():MaterialsList{
var _local1:MaterialsList;
var _local2:MaterialObject3D;
_local1 = new MaterialsList();
for each (_local2 in this.materialsByName) {
_local1.addMaterial(_local2.clone(), this._materials[_local2]);
};
return (_local1);
}
public function getMaterialByName(_arg1:String):MaterialObject3D{
return ((this.materialsByName[_arg1]) ? this.materialsByName[_arg1] : this.materialsByName["all"]);
}
}
}//package org.papervision3d.materials
Section 91
//MovieMaterial (org.papervision3d.materials.MovieMaterial)
package org.papervision3d.materials {
import flash.display.*;
import flash.geom.*;
import flash.utils.*;
import org.papervision3d.*;
public class MovieMaterial extends BitmapMaterial {
public var movieTransparent:Boolean;
public var allowAutoResize:Boolean;// = true
public var movie:DisplayObject;
private static var animatedMaterials:Dictionary = new Dictionary(false);
public function MovieMaterial(_arg1:DisplayObject=null, _arg2:Boolean=false, _arg3:Boolean=false){
allowAutoResize = true;
super();
movieTransparent = _arg2;
this.animated = _arg3;
if (_arg1){
texture = _arg1;
};
}
public function drawBitmap():void{
var _local1:Matrix;
bitmap.fillRect(bitmap.rect, this.fillColor);
_local1 = new Matrix();
_local1.scale(movie.scaleX, movie.scaleY);
bitmap.draw(movie, _local1, movie.transform.colorTransform);
}
override public function get texture():Object{
return (this._texture);
}
public function get animated():Boolean{
return (animatedMaterials[this]);
}
override public function set texture(_arg1:Object):void{
if ((_arg1 is DisplayObject) == false){
Papervision3D.log("Error: MovieMaterial.texture requires a Sprite to be passed as the object");
return;
};
bitmap = createBitmapFromSprite(DisplayObject(_arg1));
_texture = _arg1;
}
protected function createBitmapFromSprite(_arg1:DisplayObject):BitmapData{
movie = _arg1;
initBitmap(movie);
drawBitmap();
bitmap = super.createBitmap(bitmap);
return (bitmap);
}
public function set animated(_arg1:Boolean):void{
animatedMaterials[this] = _arg1;
}
override public function updateBitmap():void{
var _local1:int;
var _local2:int;
_local1 = int(movie.width);
_local2 = int(movie.height);
if (((allowAutoResize) && (((!((_local1 == bitmap.width))) || (!((_local2 == bitmap.height))))))){
initBitmap(movie);
};
drawBitmap();
}
protected function initBitmap(_arg1:DisplayObject):void{
if (bitmap){
bitmap.dispose();
};
bitmap = new BitmapData(_arg1.width, _arg1.height, this.movieTransparent);
}
public static function updateAnimatedBitmaps():void{
var _local1:Object;
for (_local1 in animatedMaterials) {
if (animatedMaterials[_local1]){
_local1.updateBitmap();
};
};
}
}
}//package org.papervision3d.materials
Section 92
//WireframeMaterial (org.papervision3d.materials.WireframeMaterial)
package org.papervision3d.materials {
import flash.display.*;
import org.papervision3d.objects.*;
import org.papervision3d.core.geom.*;
import org.papervision3d.core.proto.*;
import org.papervision3d.core.draw.*;
public class WireframeMaterial extends MaterialObject3D implements IFaceDrawer {
public function WireframeMaterial(_arg1:Number=0xFF00FF, _arg2:Number=100){
this.lineColor = _arg1;
this.lineAlpha = _arg2;
this.doubleSided = false;
}
override public function drawFace3D(_arg1:DisplayObject3D, _arg2:Face3D, _arg3:Graphics, _arg4:Vertex2D, _arg5:Vertex2D, _arg6:Vertex2D):int{
var _local7:Number;
var _local8:Number;
var _local9:Number;
var _local10:Number;
var _local11:Number;
var _local12:Number;
_local7 = _arg4.x;
_local8 = _arg4.y;
_local9 = _arg5.x;
_local10 = _arg5.y;
_local11 = _arg6.x;
_local12 = _arg6.y;
if (lineAlpha){
_arg3.lineStyle(0, lineColor, lineAlpha);
_arg3.moveTo(_local7, _local8);
_arg3.lineTo(_local9, _local10);
_arg3.lineTo(_local11, _local12);
_arg3.lineTo(_local7, _local8);
_arg3.lineStyle();
return (1);
};
return (0);
}
override public function toString():String{
return (((("WireframeMaterial - color:" + this.lineColor) + " alpha:") + this.lineAlpha));
}
}
}//package org.papervision3d.materials
Section 93
//DisplayObject3D (org.papervision3d.objects.DisplayObject3D)
package org.papervision3d.objects {
import flash.display.*;
import org.papervision3d.core.geom.*;
import org.papervision3d.core.proto.*;
import org.papervision3d.materials.*;
import org.papervision3d.core.*;
import com.blitzagency.xray.logger.*;
import org.papervision3d.utils.*;
import org.papervision3d.*;
import org.papervision3d.scenes.*;
public class DisplayObject3D extends DisplayObjectContainer3D {
public var extra:Object;
public var id:int;
private var _rotationY:Number;
private var _rotationZ:Number;
private var _rotationX:Number;
public var material:MaterialObject3D;
public var meshSort:uint;// = 1
public var materials:MaterialsList;
private var _scaleDirty:Boolean;// = false
public var transform:Matrix3D;
public var screenZ:Number;
public var visible:Boolean;
private var _scaleX:Number;
private var _scaleY:Number;
private var _scaleZ:Number;
public var geometry:GeometryObject3D;
public var interactiveSceneManager:InteractiveSceneManager;
public var screen:Number3D;
public var name:String;
public var container:Sprite;
public var world:Matrix3D;
public var parent:DisplayObjectContainer3D;
public var view:Matrix3D;
protected var _scene:SceneObject3D;// = null
public var faces:Array;
protected var _transformDirty:Boolean;// = false
private var _rotationDirty:Boolean;// = false
protected var _sorted:Array;
public static const MESH_SORT_CENTER:uint = 1;
public static const MESH_SORT_CLOSE:uint = 3;
public static const MESH_SORT_FAR:uint = 2;
private static var LEFT:Number3D = new Number3D(-1, 0, 0);
private static var _totalDisplayObjects:int = 0;
private static var UP:Number3D = new Number3D(0, 1, 0);
private static var BACKWARD:Number3D = new Number3D(0, 0, -1);
private static var FORWARD:Number3D = new Number3D(0, 0, 1);
private static var DOWN:Number3D = new Number3D(0, -1, 0);
public static var faceLevelMode:Boolean;
private static var toDEGREES:Number = (180 / Math.PI);
private static var toRADIANS:Number = (Math.PI / 180);
private static var RIGHT:Number3D = new Number3D(1, 0, 0);
public function DisplayObject3D(_arg1:String=null, _arg2:GeometryObject3D=null, _arg3:Object=null):void{
var _local4:Number;
screen = new Number3D();
_scene = null;
meshSort = MESH_SORT_CENTER;
faces = new Array();
_transformDirty = false;
_rotationDirty = false;
_scaleDirty = false;
super();
Papervision3D.log(("DisplayObject3D: " + _arg1));
this.transform = Matrix3D.IDENTITY;
this.world = Matrix3D.IDENTITY;
this.view = Matrix3D.IDENTITY;
this.x = (_arg3) ? ((_arg3.x) || (0)) : 0;
this.y = (_arg3) ? ((_arg3.y) || (0)) : 0;
this.z = (_arg3) ? ((_arg3.z) || (0)) : 0;
rotationX = (_arg3) ? ((_arg3.rotationX) || (0)) : 0;
rotationY = (_arg3) ? ((_arg3.rotationY) || (0)) : 0;
rotationZ = (_arg3) ? ((_arg3.rotationZ) || (0)) : 0;
_local4 = (Papervision3D.usePERCENT) ? 100 : 1;
scaleX = (_arg3) ? ((_arg3.scaleX) || (_local4)) : _local4;
scaleY = (_arg3) ? ((_arg3.scaleY) || (_local4)) : _local4;
scaleZ = (_arg3) ? ((_arg3.scaleZ) || (_local4)) : _local4;
if (((_arg3) && (_arg3.extra))){
this.extra = _arg3.extra;
};
if (((_arg3) && (_arg3.container))){
this.container = _arg3.container;
};
this.visible = true;
this.id = _totalDisplayObjects++;
this.name = ((_arg1) || (String(this.id)));
if (_arg2){
addGeometry(_arg2);
};
}
public function set z(_arg1:Number):void{
this.transform.n34 = _arg1;
}
override public function addChild(_arg1:DisplayObject3D, _arg2:String=null):DisplayObject3D{
_arg1 = super.addChild(_arg1, _arg2);
if (_arg1.scene == null){
_arg1.scene = scene;
};
return (_arg1);
}
public function moveDown(_arg1:Number):void{
translate(_arg1, DOWN);
}
public function set scene(_arg1:SceneObject3D):void{
var _local2:DisplayObject3D;
_scene = _arg1;
for each (_local2 in this._childrenByName) {
if (_local2.scene == null){
_local2.scene = _scene;
};
};
if ((_scene is InteractiveScene3D) == false){
return;
};
interactiveSceneManager = InteractiveScene3D(_scene).interactiveSceneManager;
}
public function project(_arg1:DisplayObject3D, _arg2:CameraObject3D, _arg3:Array=null):Number{
var _local4:Number;
var _local5:Number;
var _local6:DisplayObject3D;
if (this._transformDirty){
updateTransform();
};
this.view.calculateMultiply(_arg1.view, this.transform);
this.world.calculateMultiply(_arg1.world, this.transform);
calculateScreenCoords(_arg2);
_local4 = 0;
_local5 = 0;
if (!_arg3){
_arg3 = new Array();
this._sorted = _arg3;
};
for each (_local6 in this._childrenByName) {
if (_local6.visible){
_local4 = (_local4 + _local6.project(this, _arg2, _arg3));
_local5++;
};
};
return ((this.screenZ = (_local4 / _local5)));
}
private function calculateScreenCoords(_arg1:CameraObject3D):void{
var _local2:Number;
_local2 = ((_arg1.focus * _arg1.zoom) / (_arg1.focus + view.n34));
screen.x = (view.n14 * _local2);
screen.y = (view.n24 * _local2);
screen.z = view.n34;
}
public function lookAt(_arg1:DisplayObject3D, _arg2:Number3D=null):void{
var _local3:Number3D;
var _local4:Number3D;
var _local5:Number3D;
var _local6:Number3D;
var _local7:Number3D;
var _local8:Matrix3D;
var _local9:XrayLog;
_local3 = new Number3D(this.x, this.y, this.z);
_local4 = new Number3D(_arg1.x, _arg1.y, _arg1.z);
_local5 = Number3D.sub(_local4, _local3);
_local5.normalize();
if (_local5.modulo > 0.1){
_local6 = Number3D.cross(_local5, ((_arg2) || (UP)));
_local6.normalize();
_local7 = Number3D.cross(_local5, _local6);
_local7.normalize();
_local8 = this.transform;
_local8.n11 = (_local6.x * _scaleX);
_local8.n21 = (_local6.y * _scaleX);
_local8.n31 = (_local6.z * _scaleX);
_local8.n12 = (-(_local7.x) * _scaleY);
_local8.n22 = (-(_local7.y) * _scaleY);
_local8.n32 = (-(_local7.z) * _scaleY);
_local8.n13 = (_local5.x * _scaleZ);
_local8.n23 = (_local5.y * _scaleZ);
_local8.n33 = (_local5.z * _scaleZ);
this._transformDirty = false;
this._rotationDirty = true;
} else {
_local9 = new XrayLog();
_local9.debug("lookAt Error");
};
}
public function set rotationX(_arg1:Number):void{
this._rotationX = (Papervision3D.useDEGREES) ? (-(_arg1) * toRADIANS) : -(_arg1);
this._transformDirty = true;
}
public function set rotationY(_arg1:Number):void{
this._rotationY = (Papervision3D.useDEGREES) ? (-(_arg1) * toRADIANS) : -(_arg1);
this._transformDirty = true;
}
public function set rotationZ(_arg1:Number):void{
this._rotationZ = (Papervision3D.useDEGREES) ? (-(_arg1) * toRADIANS) : -(_arg1);
this._transformDirty = true;
}
public function addGeometry(_arg1:GeometryObject3D=null):void{
if (_arg1){
this.geometry = _arg1;
};
}
public function get sceneX():Number{
return (this.world.n14);
}
public function get scaleX():Number{
if (Papervision3D.usePERCENT){
return ((this._scaleX * 100));
};
return (this._scaleX);
}
public function get scaleY():Number{
if (Papervision3D.usePERCENT){
return ((this._scaleY * 100));
};
return (this._scaleY);
}
public function get scaleZ():Number{
if (Papervision3D.usePERCENT){
return ((this._scaleZ * 100));
};
return (this._scaleZ);
}
public function moveUp(_arg1:Number):void{
translate(_arg1, UP);
}
public function get sceneZ():Number{
return (this.world.n34);
}
public function distanceTo(_arg1:DisplayObject3D):Number{
var _local2:Number;
var _local3:Number;
var _local4:Number;
_local2 = (this.x - _arg1.x);
_local3 = (this.y - _arg1.y);
_local4 = (this.z - _arg1.z);
return (Math.sqrt((((_local2 * _local2) + (_local3 * _local3)) + (_local4 * _local4))));
}
public function get sceneY():Number{
return (this.world.n24);
}
public function get scale():Number{
if ((((this._scaleX == this._scaleY)) && ((this._scaleX == this._scaleZ)))){
if (Papervision3D.usePERCENT){
return ((this._scaleX * 100));
};
return (this._scaleX);
//unresolved jump
};
return (NaN);
}
public function hitTestObject(_arg1:DisplayObject3D, _arg2:Number=1):Boolean{
var _local3:Number;
var _local4:Number;
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:Number;
_local3 = (this.x - _arg1.x);
_local4 = (this.y - _arg1.y);
_local5 = (this.z - _arg1.z);
_local6 = (((_local3 * _local3) + (_local4 * _local4)) + (_local5 * _local5));
_local7 = (this.geometry) ? this.geometry.boundingSphere2 : 0;
_local8 = (_arg1.geometry) ? _arg1.geometry.boundingSphere2 : 0;
_local7 = (_local7 * _arg2);
return (((_local7 + _local8) > _local6));
}
public function translate(_arg1:Number, _arg2:Number3D):void{
var _local3:Number3D;
_local3 = _arg2.clone();
if (this._transformDirty){
updateTransform();
};
Matrix3D.rotateAxis(transform, _local3);
this.x = (this.x + (_arg1 * _local3.x));
this.y = (this.y + (_arg1 * _local3.y));
this.z = (this.z + (_arg1 * _local3.z));
}
private function updateRotation():void{
var _local1:Number3D;
_local1 = Matrix3D.matrix2euler(this.transform);
this._rotationX = (_local1.x * toRADIANS);
this._rotationY = (_local1.y * toRADIANS);
this._rotationZ = (_local1.z * toRADIANS);
this._rotationDirty = false;
}
public function pitch(_arg1:Number):void{
var _local2:Number3D;
var _local3:Matrix3D;
_arg1 = (Papervision3D.useDEGREES) ? (_arg1 * toRADIANS) : _arg1;
_local2 = RIGHT.clone();
if (this._transformDirty){
updateTransform();
};
Matrix3D.rotateAxis(transform, _local2);
_local3 = Matrix3D.rotationMatrix(_local2.x, _local2.y, _local2.z, _arg1);
this.transform.calculateMultiply3x3(_local3, transform);
this._rotationDirty = true;
}
public function yaw(_arg1:Number):void{
var _local2:Number3D;
var _local3:Matrix3D;
_arg1 = (Papervision3D.useDEGREES) ? (_arg1 * toRADIANS) : _arg1;
_local2 = UP.clone();
if (this._transformDirty){
updateTransform();
};
Matrix3D.rotateAxis(transform, _local2);
_local3 = Matrix3D.rotationMatrix(_local2.x, _local2.y, _local2.z, _arg1);
this.transform.calculateMultiply3x3(_local3, transform);
this._rotationDirty = true;
}
public function copyTransform(_arg1):void{
var _local2:Matrix3D;
var _local3:Matrix3D;
_local2 = this.transform;
_local3 = ((_arg1 is DisplayObject3D)) ? _arg1.transform : _arg1;
_local2.n11 = _local3.n11;
_local2.n12 = _local3.n12;
_local2.n13 = _local3.n13;
_local2.n14 = _local3.n14;
_local2.n21 = _local3.n21;
_local2.n22 = _local3.n22;
_local2.n23 = _local3.n23;
_local2.n24 = _local3.n24;
_local2.n31 = _local3.n31;
_local2.n32 = _local3.n32;
_local2.n33 = _local3.n33;
_local2.n34 = _local3.n34;
this._transformDirty = false;
this._rotationDirty = true;
}
public function get x():Number{
return (this.transform.n14);
}
public function get z():Number{
return (this.transform.n34);
}
override public function toString():String{
return (((((((this.name + ": x:") + Math.round(this.x)) + " y:") + Math.round(this.y)) + " z:") + Math.round(this.z)));
}
public function roll(_arg1:Number):void{
var _local2:Number3D;
var _local3:Matrix3D;
_arg1 = (Papervision3D.useDEGREES) ? (_arg1 * toRADIANS) : _arg1;
_local2 = FORWARD.clone();
if (this._transformDirty){
updateTransform();
};
Matrix3D.rotateAxis(transform, _local2);
_local3 = Matrix3D.rotationMatrix(_local2.x, _local2.y, _local2.z, _arg1);
this.transform.calculateMultiply3x3(_local3, transform);
this._rotationDirty = true;
}
public function getMaterialByName(_arg1:String):MaterialObject3D{
var _local2:MaterialObject3D;
var _local3:DisplayObject3D;
_local2 = this.materials.getMaterialByName(_arg1);
if (_local2){
return (_local2);
};
for each (_local3 in this._childrenByName) {
_local2 = _local3.getMaterialByName(_arg1);
if (_local2){
return (_local2);
};
};
return (null);
}
public function moveLeft(_arg1:Number):void{
translate(_arg1, LEFT);
}
public function get scene():SceneObject3D{
return (_scene);
}
public function get y():Number{
return (this.transform.n24);
}
public function set scale(_arg1:Number):void{
if (Papervision3D.usePERCENT){
_arg1 = (_arg1 / 100);
};
this._scaleX = (this._scaleY = (this._scaleZ = _arg1));
this._transformDirty = true;
}
public function render(_arg1:SceneObject3D):void{
var _local2:Array;
var _local3:Sprite;
var _local4:Number;
var _local5:Face3DInstance;
var _local6:Number;
var _local7:int;
_local2 = this._sorted;
_local2.sortOn("screenZ", (Array.DESCENDING | Array.NUMERIC));
_local3 = ((this.container) || (_arg1.container));
_local4 = 0;
_local6 = _local2.length;
_local7 = 0;
while (_local7 < _local6) {
_local5 = _local2[_local7];
if (faceLevelMode){
if (!_local5.container){
_local5.container = new InteractiveSprite(this);
_arg1.container.addChild(_local5.container);
} else {
_local5.container.graphics.clear();
};
if (_local5.visible){
_local4 = (_local4 + _local5.face.render(_local5.instance, _local5.container));
};
} else {
if (_local5.visible){
_local4 = (_local4 + _local5.face.render(_local5.instance, _local3));
};
};
_local7++;
};
_arg1.stats.rendered = (_arg1.stats.rendered + _local4);
}
public function get rotationY():Number{
if (this._rotationDirty){
updateRotation();
};
return ((Papervision3D.useDEGREES) ? (-(this._rotationY) * toDEGREES) : -(this._rotationY));
}
public function get rotationZ():Number{
if (this._rotationDirty){
updateRotation();
};
return ((Papervision3D.useDEGREES) ? (-(this._rotationZ) * toDEGREES) : -(this._rotationZ));
}
public function set scaleY(_arg1:Number):void{
if (Papervision3D.usePERCENT){
this._scaleY = (_arg1 / 100);
} else {
this._scaleY = _arg1;
};
this._transformDirty = true;
}
public function set scaleZ(_arg1:Number):void{
if (Papervision3D.usePERCENT){
this._scaleZ = (_arg1 / 100);
} else {
this._scaleZ = _arg1;
};
this._transformDirty = true;
}
public function get rotationX():Number{
if (this._rotationDirty){
updateRotation();
};
return ((Papervision3D.useDEGREES) ? (-(this._rotationX) * toDEGREES) : -(this._rotationX));
}
public function set scaleX(_arg1:Number):void{
if (Papervision3D.usePERCENT){
this._scaleX = (_arg1 / 100);
} else {
this._scaleX = _arg1;
};
this._transformDirty = true;
}
protected function updateTransform():void{
var _local1:Object;
var _local2:Matrix3D;
var _local3:Matrix3D;
var _local4:Matrix3D;
_local1 = Matrix3D.euler2quaternion(-(this._rotationY), -(this._rotationZ), this._rotationX);
_local2 = Matrix3D.quaternion2matrix(_local1.x, _local1.y, _local1.z, _local1.w);
_local3 = this.transform;
_local2.n14 = _local3.n14;
_local2.n24 = _local3.n24;
_local2.n34 = _local3.n34;
_local3.copy(_local2);
_local4 = Matrix3D.IDENTITY;
_local4.n11 = this._scaleX;
_local4.n22 = this._scaleY;
_local4.n33 = this._scaleZ;
this.transform.calculateMultiply(_local3, _local4);
this._transformDirty = false;
}
public function moveForward(_arg1:Number):void{
translate(_arg1, FORWARD);
}
public function copyPosition(_arg1):void{
var _local2:Matrix3D;
var _local3:Matrix3D;
_local2 = this.transform;
_local3 = ((_arg1 is DisplayObject3D)) ? _arg1.transform : _arg1;
_local2.n14 = _local3.n14;
_local2.n24 = _local3.n24;
_local2.n34 = _local3.n34;
}
public function hitTestPoint(_arg1:Number, _arg2:Number, _arg3:Number):Boolean{
var _local4:Number;
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:Number;
_local4 = (this.x - _arg1);
_local5 = (this.y - _arg2);
_local6 = (this.z - _arg3);
_local7 = (((_arg1 * _arg1) + (_arg2 * _arg2)) + (_arg3 * _arg3));
_local8 = (this.geometry) ? this.geometry.boundingSphere2 : 0;
return ((_local8 > _local7));
}
public function moveRight(_arg1:Number):void{
translate(_arg1, RIGHT);
}
public function moveBackward(_arg1:Number):void{
translate(_arg1, BACKWARD);
}
public function materialsList():String{
var _local1:String;
var _local2:String;
var _local3:DisplayObject3D;
_local1 = "";
for (_local2 in this.materials) {
_local1 = (_local1 + (_local2 + "\n"));
};
for each (_local3 in this._childrenByName) {
for (_local2 in _local3.materials.materialsByName) {
_local1 = (_local1 + (("+ " + _local2) + "\n"));
};
};
return (_local1);
}
public function set x(_arg1:Number):void{
this.transform.n14 = _arg1;
}
public function set y(_arg1:Number):void{
this.transform.n24 = _arg1;
}
public static function get ZERO():DisplayObject3D{
return (new (DisplayObject3D));
}
}
}//package org.papervision3d.objects
Section 94
//Plane (org.papervision3d.objects.Plane)
package org.papervision3d.objects {
import org.papervision3d.core.geom.*;
import org.papervision3d.core.proto.*;
import org.papervision3d.core.*;
public class Plane extends Mesh3D {
public var segmentsH:Number;
public var segmentsW:Number;
public static var DEFAULT_SCALE:Number = 1;
public static var DEFAULT_SEGMENTS:Number = 1;
public static var DEFAULT_SIZE:Number = 500;
public function Plane(_arg1:MaterialObject3D=null, _arg2:Number=0, _arg3:Number=0, _arg4:Number=0, _arg5:Number=0, _arg6:Object=null){
var _local7:Number;
super(_arg1, new Array(), new Array(), null, _arg6);
this.segmentsW = ((_arg4) || (DEFAULT_SEGMENTS));
this.segmentsH = ((_arg5) || (this.segmentsW));
_local7 = DEFAULT_SCALE;
if (!_arg3){
if (_arg2){
_local7 = _arg2;
};
if (((_arg1) && (_arg1.bitmap))){
_arg2 = (_arg1.bitmap.width * _local7);
_arg3 = (_arg1.bitmap.height * _local7);
} else {
_arg2 = (DEFAULT_SIZE * _local7);
_arg3 = (DEFAULT_SIZE * _local7);
};
};
buildPlane(_arg2, _arg3);
}
private function buildPlane(_arg1:Number, _arg2:Number):void{
var _local3:Number;
var _local4:Number;
var _local5:Number;
var _local6:Number;
var _local7:Array;
var _local8:Array;
var _local9:Number;
var _local10:Number;
var _local11:Number;
var _local12:Number;
var _local13:int;
var _local14:NumberUV;
var _local15:NumberUV;
var _local16:NumberUV;
var _local17:int;
var _local18:Number;
var _local19:Number;
var _local20:Vertex3D;
var _local21:Vertex3D;
var _local22:Vertex3D;
_local3 = this.segmentsW;
_local4 = this.segmentsH;
_local5 = (_local3 + 1);
_local6 = (_local4 + 1);
_local7 = this.geometry.vertices;
_local8 = this.geometry.faces;
_local9 = (_arg1 / 2);
_local10 = (_arg2 / 2);
_local11 = (_arg1 / _local3);
_local12 = (_arg2 / _local4);
_local13 = 0;
while (_local13 < (_local3 + 1)) {
_local17 = 0;
while (_local17 < _local6) {
_local18 = ((_local13 * _local11) - _local9);
_local19 = ((_local17 * _local12) - _local10);
_local7.push(new Vertex3D(_local18, _local19, 0));
_local17++;
};
_local13++;
};
_local13 = 0;
while (_local13 < _local3) {
_local17 = 0;
while (_local17 < _local4) {
_local20 = _local7[((_local13 * _local6) + _local17)];
_local21 = _local7[((_local13 * _local6) + (_local17 + 1))];
_local22 = _local7[(((_local13 + 1) * _local6) + _local17)];
_local14 = new NumberUV((_local13 / _local3), (_local17 / _local4));
_local15 = new NumberUV((_local13 / _local3), ((_local17 + 1) / _local4));
_local16 = new NumberUV(((_local13 + 1) / _local3), (_local17 / _local4));
_local8.push(new Face3D([_local20, _local22, _local21], null, [_local14, _local16, _local15]));
_local20 = _local7[(((_local13 + 1) * _local6) + (_local17 + 1))];
_local21 = _local7[(((_local13 + 1) * _local6) + _local17)];
_local22 = _local7[((_local13 * _local6) + (_local17 + 1))];
_local14 = new NumberUV(((_local13 + 1) / _local3), ((_local17 + 1) / _local4));
_local15 = new NumberUV(((_local13 + 1) / _local3), (_local17 / _local4));
_local16 = new NumberUV((_local13 / _local3), ((_local17 + 1) / _local4));
_local8.push(new Face3D([_local20, _local22, _local21], null, [_local14, _local16, _local15]));
_local17++;
};
_local13++;
};
this.geometry.ready = true;
}
}
}//package org.papervision3d.objects
Section 95
//InteractiveScene3D (org.papervision3d.scenes.InteractiveScene3D)
package org.papervision3d.scenes {
import flash.display.*;
import org.papervision3d.core.proto.*;
import org.papervision3d.utils.*;
public class InteractiveScene3D extends MovieScene3D {
public var interactiveSceneManager:InteractiveSceneManager;
public function InteractiveScene3D(_arg1:Sprite){
super(_arg1);
interactiveSceneManager = new InteractiveSceneManager(this);
}
override public function renderCamera(_arg1:CameraObject3D):void{
interactiveSceneManager.resetFaces();
super.renderCamera(_arg1);
interactiveSceneManager.sortObjects();
}
}
}//package org.papervision3d.scenes
Section 96
//MovieScene3D (org.papervision3d.scenes.MovieScene3D)
package org.papervision3d.scenes {
import flash.display.*;
import org.papervision3d.objects.*;
import org.papervision3d.core.proto.*;
import flash.utils.*;
public class MovieScene3D extends Scene3D {
private var spriteList:Dictionary;
private var containerList:Array;
public function MovieScene3D(_arg1:Sprite){
super(_arg1);
this.containerList = new Array();
spriteList = new Dictionary();
}
override public function addChild(_arg1:DisplayObject3D, _arg2:String=null):DisplayObject3D{
_arg1 = super.addChild(_arg1, _arg2);
_arg1.container = new Sprite();
container.addChild(_arg1.container);
this.containerList.push(_arg1.container);
spriteList[_arg1] = _arg1.container;
return (_arg1);
}
public function getSprite(_arg1:DisplayObject3D):Sprite{
return (spriteList[_arg1]);
}
override protected function renderObjects(_arg1:Boolean):void{
var _local2:Number;
var _local3:Sprite;
var _local4:Array;
var _local5:Number;
var _local6:DisplayObject3D;
var _local7:Array;
var _local8:Object;
_local2 = this.objects.length;
_local4 = this.containerList;
_local5 = 0;
while ((_local3 = _local4[_local5++])) {
_local3.graphics.clear();
};
_local7 = this.objects;
_local5 = _local7.length;
if (_arg1){
while ((_local6 = _local7[--_local5])) {
if (_local6.visible){
container.addChild(_local6.container);
_local6.render(this);
};
};
} else {
while ((_local6 = _local7[--_local5])) {
if (_local6.visible){
_local6.render(this);
};
};
};
_local8 = this.stats;
_local8.performance = (getTimer() - _local8.performance);
}
override public function removeChild(_arg1:DisplayObject3D):DisplayObject3D{
var _local2:DisplayObject3D;
var _local3:int;
_local2 = super.removeChild(_arg1);
_local3 = 0;
while (_local3 < containerList.length) {
if (_local2.container == containerList[_local3]){
this.containerList.splice(_local3, 1);
};
_local3++;
};
container.removeChild(_local2.container);
delete spriteList[_local2];
return (_local2);
}
}
}//package org.papervision3d.scenes
Section 97
//Scene3D (org.papervision3d.scenes.Scene3D)
package org.papervision3d.scenes {
import flash.display.*;
import org.papervision3d.objects.*;
import org.papervision3d.core.proto.*;
import flash.utils.*;
public class Scene3D extends SceneObject3D {
public function Scene3D(_arg1:Sprite){
super(_arg1);
}
override protected function renderObjects(_arg1:Boolean):void{
var _local2:DisplayObject3D;
var _local3:Array;
var _local4:Number;
var _local5:Object;
this.container.graphics.clear();
_local3 = this.objects;
_local4 = _local3.length;
while ((_local2 = _local3[--_local4])) {
if (_local2.visible){
_local2.render(this);
};
};
_local5 = this.stats;
_local5.performance = (getTimer() - _local5.performance);
}
}
}//package org.papervision3d.scenes
Section 98
//IVirtualMouseEvent (org.papervision3d.utils.virtualmouse.IVirtualMouseEvent)
package org.papervision3d.utils.virtualmouse {
public interface IVirtualMouseEvent {
}
}//package org.papervision3d.utils.virtualmouse
Section 99
//VirtualMouse (org.papervision3d.utils.virtualmouse.VirtualMouse)
package org.papervision3d.utils.virtualmouse {
import flash.display.*;
import flash.events.*;
import flash.geom.*;
import com.blitzagency.xray.logger.*;
import flash.utils.*;
public class VirtualMouse extends EventDispatcher {
private var _container:Sprite;
private var lastDownTarget:DisplayObject;
private var target:InteractiveObject;
private var updateMouseDown:Boolean;// = false
private var eventEvent:Class;
private var _lastEvent:Event;
private var mouseEventEvent:Class;
private var location:Point;
private var delta:int;// = 0
private var disabledEvents:Object;
private var log:XrayLog;
private var ignoredInstances:Dictionary;
private var isLocked:Boolean;// = false
private var lastWithinStage:Boolean;// = true
private var lastLocation:Point;
private var isDoubleClickEvent:Boolean;// = false
private var lastMouseDown:Boolean;// = false
private var altKey:Boolean;// = false
private var _useNativeEvents:Boolean;// = false
private var ctrlKey:Boolean;// = false
private var shiftKey:Boolean;// = false
private var _stage:Stage;
public static const UPDATE:String = "update";
private static var _mouseIsDown:Boolean = false;
public function VirtualMouse(_arg1:Stage=null, _arg2:Sprite=null, _arg3:Number=0, _arg4:Number=0){
altKey = false;
ctrlKey = false;
shiftKey = false;
delta = 0;
isLocked = false;
isDoubleClickEvent = false;
disabledEvents = new Object();
ignoredInstances = new Dictionary(true);
lastMouseDown = false;
updateMouseDown = false;
lastWithinStage = true;
_useNativeEvents = false;
eventEvent = VirtualMouseEvent;
mouseEventEvent = VirtualMouseMouseEvent;
log = new XrayLog();
super();
this.stage = _arg1;
this.container = _arg2;
location = new Point(_arg3, _arg4);
lastLocation = location.clone();
addEventListener(UPDATE, handleUpdate);
update();
}
public function get mouseIsDown():Boolean{
return (_mouseIsDown);
}
public function get stage():Stage{
return (_stage);
}
public function exitContainer():void{
var _local1:Point;
_local1 = target.globalToLocal(location);
if (!disabledEvents[MouseEvent.MOUSE_OUT]){
_lastEvent = new mouseEventEvent(MouseEvent.MOUSE_OUT, true, false, _local1.x, _local1.y, container, ctrlKey, altKey, shiftKey, _mouseIsDown, delta);
container.dispatchEvent(_lastEvent);
dispatchEvent(_lastEvent);
};
if (!disabledEvents[MouseEvent.ROLL_OUT]){
_lastEvent = new mouseEventEvent(MouseEvent.ROLL_OUT, false, false, _local1.x, _local1.y, container, ctrlKey, altKey, shiftKey, _mouseIsDown, delta);
container.dispatchEvent(_lastEvent);
dispatchEvent(_lastEvent);
};
if (target != container){
if (!disabledEvents[MouseEvent.MOUSE_OUT]){
_lastEvent = new mouseEventEvent(MouseEvent.MOUSE_OUT, true, false, _local1.x, _local1.y, container, ctrlKey, altKey, shiftKey, _mouseIsDown, delta);
target.dispatchEvent(_lastEvent);
dispatchEvent(_lastEvent);
};
if (!disabledEvents[MouseEvent.ROLL_OUT]){
_lastEvent = new mouseEventEvent(MouseEvent.ROLL_OUT, false, false, _local1.x, _local1.y, container, ctrlKey, altKey, shiftKey, _mouseIsDown, delta);
target.dispatchEvent(_lastEvent);
dispatchEvent(_lastEvent);
};
};
target = _stage;
}
public function release():void{
updateMouseDown = true;
_mouseIsDown = false;
if (!isLocked){
update();
};
}
public function click():void{
press();
release();
}
public function get container():Sprite{
return (_container);
}
public function set container(_arg1:Sprite):void{
_container = _arg1;
}
public function get y():Number{
return (location.y);
}
public function set x(_arg1:Number):void{
location.x = _arg1;
if (!isLocked){
update();
};
}
public function disableEvent(_arg1:String):void{
disabledEvents[_arg1] = true;
}
public function get lastEvent():Event{
return (_lastEvent);
}
private function handleUpdate(_arg1:Event):void{
var _local2:Array;
var _local3:InteractiveObject;
var _local4:DisplayObject;
var _local5:int;
var _local6:Point;
var _local7:Point;
var _local8:Boolean;
if (!container){
return;
};
_local2 = container.getObjectsUnderPoint(location);
_local5 = _local2.length;
while (_local5--) {
_local4 = _local2[_local5];
while (_local4) {
if (ignoredInstances[_local4]){
_local3 = null;
break;
};
if (((_local3) && ((_local4 is SimpleButton)))){
_local3 = null;
} else {
if (((_local3) && (!(DisplayObjectContainer(_local4).mouseChildren)))){
_local3 = null;
};
};
if (((((!(_local3)) && ((_local4 is InteractiveObject)))) && (InteractiveObject(_local4).mouseEnabled))){
_local3 = InteractiveObject(_local4);
};
_local4 = _local4.parent;
};
if (_local3){
break;
};
};
if (!_local3){
_local3 = _stage;
log.debug("no new target found, using stage");
};
_local6 = target.globalToLocal(location);
_local7 = _local3.globalToLocal(location);
if (((!((lastLocation.x == location.x))) || (!((lastLocation.y == location.y))))){
_local8 = false;
if (stage){
_local8 = (((((((location.x >= 0)) && ((location.y >= 0)))) && ((location.x <= stage.stageWidth)))) && ((location.y <= stage.stageHeight)));
};
if (((((!(_local8)) && (lastWithinStage))) && (!(disabledEvents[Event.MOUSE_LEAVE])))){
_lastEvent = new eventEvent(Event.MOUSE_LEAVE, false, false);
stage.dispatchEvent(_lastEvent);
dispatchEvent(_lastEvent);
};
if (((_local8) && (!(disabledEvents[MouseEvent.MOUSE_MOVE])))){
_lastEvent = new mouseEventEvent(MouseEvent.MOUSE_MOVE, true, false, _local7.x, _local7.y, _local3, ctrlKey, altKey, shiftKey, _mouseIsDown, delta);
_local3.dispatchEvent(_lastEvent);
dispatchEvent(_lastEvent);
};
lastWithinStage = _local8;
};
if (_local3 != target){
if (!disabledEvents[MouseEvent.MOUSE_OUT]){
_lastEvent = new mouseEventEvent(MouseEvent.MOUSE_OUT, true, false, _local6.x, _local6.y, _local3, ctrlKey, altKey, shiftKey, _mouseIsDown, delta);
target.dispatchEvent(_lastEvent);
dispatchEvent(_lastEvent);
};
if (!disabledEvents[MouseEvent.ROLL_OUT]){
_lastEvent = new mouseEventEvent(MouseEvent.ROLL_OUT, false, false, _local6.x, _local6.y, _local3, ctrlKey, altKey, shiftKey, _mouseIsDown, delta);
target.dispatchEvent(_lastEvent);
dispatchEvent(_lastEvent);
};
if (!disabledEvents[MouseEvent.MOUSE_OVER]){
_lastEvent = new mouseEventEvent(MouseEvent.MOUSE_OVER, true, false, _local7.x, _local7.y, target, ctrlKey, altKey, shiftKey, _mouseIsDown, delta);
_local3.dispatchEvent(_lastEvent);
dispatchEvent(_lastEvent);
};
if (!disabledEvents[MouseEvent.ROLL_OVER]){
_lastEvent = new mouseEventEvent(MouseEvent.ROLL_OVER, false, false, _local7.x, _local7.y, target, ctrlKey, altKey, shiftKey, _mouseIsDown, delta);
_local3.dispatchEvent(_lastEvent);
dispatchEvent(_lastEvent);
};
};
if (updateMouseDown){
if (_mouseIsDown){
if (!disabledEvents[MouseEvent.MOUSE_DOWN]){
_lastEvent = new mouseEventEvent(MouseEvent.MOUSE_DOWN, true, false, _local7.x, _local7.y, _local3, ctrlKey, altKey, shiftKey, _mouseIsDown, delta);
_local3.dispatchEvent(_lastEvent);
dispatchEvent(_lastEvent);
};
lastDownTarget = _local3;
updateMouseDown = false;
} else {
if (!disabledEvents[MouseEvent.MOUSE_UP]){
_lastEvent = new mouseEventEvent(MouseEvent.MOUSE_UP, true, false, _local7.x, _local7.y, _local3, ctrlKey, altKey, shiftKey, _mouseIsDown, delta);
_local3.dispatchEvent(_lastEvent);
dispatchEvent(_lastEvent);
};
if (((!(disabledEvents[MouseEvent.CLICK])) && ((_local3 == lastDownTarget)))){
_lastEvent = new mouseEventEvent(MouseEvent.CLICK, true, false, _local7.x, _local7.y, _local3, ctrlKey, altKey, shiftKey, _mouseIsDown, delta);
_local3.dispatchEvent(_lastEvent);
dispatchEvent(_lastEvent);
};
lastDownTarget = null;
updateMouseDown = false;
};
};
if (((((isDoubleClickEvent) && (!(disabledEvents[MouseEvent.DOUBLE_CLICK])))) && (_local3.doubleClickEnabled))){
_lastEvent = new mouseEventEvent(MouseEvent.DOUBLE_CLICK, true, false, _local7.x, _local7.y, _local3, ctrlKey, altKey, shiftKey, _mouseIsDown, delta);
_local3.dispatchEvent(_lastEvent);
dispatchEvent(_lastEvent);
};
lastLocation = location.clone();
lastMouseDown = _mouseIsDown;
target = _local3;
}
public function getLocation():Point{
return (location.clone());
}
public function get x():Number{
return (location.x);
}
public function lock():void{
isLocked = true;
}
public function get useNativeEvents():Boolean{
return (_useNativeEvents);
}
public function setLocation(_arg1, _arg2=null):void{
var _local3:Point;
if ((_arg1 is Point)){
_local3 = Point(_arg1);
location.x = _local3.x;
location.y = _local3.y;
} else {
location.x = Number(_arg1);
location.y = Number(_arg2);
};
if (!isLocked){
update();
};
}
private function keyHandler(_arg1:KeyboardEvent):void{
altKey = _arg1.altKey;
ctrlKey = _arg1.ctrlKey;
shiftKey = _arg1.shiftKey;
}
public function unignore(_arg1:DisplayObject):void{
if ((_arg1 in ignoredInstances)){
delete ignoredInstances[_arg1];
};
}
public function doubleClick():void{
if (isLocked){
release();
} else {
click();
press();
isDoubleClickEvent = true;
release();
isDoubleClickEvent = false;
};
}
public function update():void{
dispatchEvent(new Event(UPDATE, false, false));
}
public function ignore(_arg1:DisplayObject):void{
ignoredInstances[_arg1] = true;
}
public function unlock():void{
isLocked = false;
update();
}
public function enableEvent(_arg1:String):void{
if ((_arg1 in disabledEvents)){
delete disabledEvents[_arg1];
};
}
public function press():void{
updateMouseDown = true;
_mouseIsDown = true;
if (!isLocked){
update();
};
}
public function set useNativeEvents(_arg1:Boolean):void{
if (_arg1 == _useNativeEvents){
return;
};
_useNativeEvents = _arg1;
if (_useNativeEvents){
eventEvent = VirtualMouseEvent;
mouseEventEvent = VirtualMouseMouseEvent;
} else {
eventEvent = Event;
mouseEventEvent = MouseEvent;
};
}
public function set y(_arg1:Number):void{
location.y = _arg1;
if (!isLocked){
update();
};
}
public function set stage(_arg1:Stage):void{
var _local2:Boolean;
if (_stage){
_local2 = true;
_stage.removeEventListener(KeyboardEvent.KEY_DOWN, keyHandler);
_stage.removeEventListener(KeyboardEvent.KEY_UP, keyHandler);
} else {
_local2 = false;
};
_stage = _arg1;
if (_stage){
_stage.addEventListener(KeyboardEvent.KEY_DOWN, keyHandler);
_stage.addEventListener(KeyboardEvent.KEY_UP, keyHandler);
target = _stage;
if (!_local2){
update();
};
};
}
}
}//package org.papervision3d.utils.virtualmouse
Section 100
//VirtualMouseEvent (org.papervision3d.utils.virtualmouse.VirtualMouseEvent)
package org.papervision3d.utils.virtualmouse {
import flash.events.*;
public class VirtualMouseEvent extends Event implements IVirtualMouseEvent {
public function VirtualMouseEvent(_arg1:String, _arg2:Boolean=false, _arg3:Boolean=false){
super(_arg1, _arg2, _arg3);
}
}
}//package org.papervision3d.utils.virtualmouse
Section 101
//VirtualMouseMouseEvent (org.papervision3d.utils.virtualmouse.VirtualMouseMouseEvent)
package org.papervision3d.utils.virtualmouse {
import flash.display.*;
import flash.events.*;
public class VirtualMouseMouseEvent extends MouseEvent implements IVirtualMouseEvent {
public function VirtualMouseMouseEvent(_arg1:String, _arg2:Boolean=false, _arg3:Boolean=false, _arg4:Number=NaN, _arg5:Number=NaN, _arg6:InteractiveObject=null, _arg7:Boolean=false, _arg8:Boolean=false, _arg9:Boolean=false, _arg10:Boolean=false, _arg11:int=0){
super(_arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8, _arg9, _arg10, _arg11);
}
}
}//package org.papervision3d.utils.virtualmouse
Section 102
//InteractiveContainerData (org.papervision3d.utils.InteractiveContainerData)
package org.papervision3d.utils {
import flash.events.*;
import org.papervision3d.objects.*;
import org.papervision3d.core.geom.*;
public class InteractiveContainerData extends EventDispatcher {
public var container:InteractiveSprite;
public var displayObject3D:DisplayObject3D;// = null
public var lineColor:Number;
public var lineAlpha:Number;
public var fillAlpha:Number;
public var sort:Boolean;// = false
public var isDrawn:Boolean;// = false
public var color:Number;
public var lineSize:Number;
public var face3d:Face3D;
public function InteractiveContainerData(_arg1, _arg2:Number=0, _arg3:IEventDispatcher=null){
displayObject3D = null;
isDrawn = false;
sort = false;
color = InteractiveSceneManager.DEFAULT_FILL_COLOR;
fillAlpha = InteractiveSceneManager.DEFAULT_FILL_ALPHA;
lineColor = InteractiveSceneManager.DEFAULT_LINE_COLOR;
lineSize = InteractiveSceneManager.DEFAULT_LINE_SIZE;
lineAlpha = InteractiveSceneManager.DEFAULT_LINE_ALPHA;
super(_arg3);
displayObject3D = (((_arg1 is DisplayObject3D) == true)) ? _arg1 : null;
face3d = (((_arg1 is Face3D) == true)) ? _arg1 : null;
if (displayObject3D != null){
this.container = new InteractiveSprite(_arg1);
};
if (face3d != null){
if (face3d.face3DInstance.container != null){
this.container = InteractiveSprite(face3d.face3DInstance.container);
} else {
this.container = new InteractiveSprite();
};
};
color = _arg2;
container.alpha = InteractiveSceneManager.DEFAULT_SPRITE_ALPHA;
container.interactiveContainerData = this;
}
public function get screenZ():Number{
return (((displayObject3D)!=null) ? displayObject3D.screenZ : face3d.screenZ);
}
}
}//package org.papervision3d.utils
Section 103
//InteractiveSceneManager (org.papervision3d.utils.InteractiveSceneManager)
package org.papervision3d.utils {
import flash.display.*;
import flash.events.*;
import flash.geom.*;
import org.papervision3d.objects.*;
import org.papervision3d.core.geom.*;
import org.papervision3d.core.proto.*;
import org.papervision3d.materials.*;
import com.blitzagency.xray.logger.*;
import flash.utils.*;
import org.papervision3d.utils.virtualmouse.*;
import org.papervision3d.events.*;
public class InteractiveSceneManager extends EventDispatcher {
public var container:Sprite;
public var scene:SceneObject3D;
protected var allowDraw:Boolean;// = true
protected var log:XrayLog;
private var _mouseInteractionMode:Boolean;// = false
public var faceDictionary:Dictionary;
public var mouse3D:Mouse3D;
public var virtualMouse:VirtualMouse;
public var faceLevelMode:Boolean;// = false
public var debug:Boolean;// = false
protected var evaluateClick:Boolean;// = false
public var buttonMode:Boolean;// = false
public var containerDictionary:Dictionary;
public static var DEFAULT_FILL_ALPHA:Number = 1;
public static var DEFAULT_SPRITE_ALPHA:Number = 1;
public static var DEFAULT_FILL_COLOR:Number = 0xFFFFFF;
public static var DEFAULT_LINE_SIZE:Number = 1;
public static var DEFAULT_LINE_ALPHA:Number = 1;
public static var DEFAULT_LINE_COLOR:Number = -1;
public static var MOUSE_IS_DOWN:Boolean = false;
public static var SHOW_DRAWN_FACES:Boolean = false;
public function InteractiveSceneManager(_arg1:SceneObject3D):void{
buttonMode = false;
faceLevelMode = false;
_mouseInteractionMode = false;
faceDictionary = new Dictionary();
containerDictionary = new Dictionary();
container = new InteractiveSprite();
mouse3D = new Mouse3D();
virtualMouse = new VirtualMouse();
debug = false;
allowDraw = true;
evaluateClick = false;
log = new XrayLog();
super();
container.addEventListener(Event.ADDED_TO_STAGE, handleAddedToStage);
scene = _arg1;
scene.container.parent.addChild(container);
container.x = scene.container.x;
container.y = scene.container.y;
enableMouse = false;
}
protected function handleStageMouseMove(_arg1:MouseEvent):void{
allowDraw = true;
}
public function sortObjects():void{
var _local1:Array;
var _local2:InteractiveContainerData;
var _local3:uint;
var _local4:Number;
_local1 = [];
for each (_local2 in faceDictionary) {
if (!_local2.sort){
} else {
_local4 = ((_local2.face3d == null)) ? _local2.screenZ : _local2.face3d.face3DInstance.screenZ;
_local1.push({container:_local2.container, distance:_local4});
};
};
_local1.sortOn("distance", (Array.DESCENDING | Array.NUMERIC));
_local3 = 0;
while (_local3 < _local1.length) {
container.addChild(_local1[_local3].container);
_local3++;
};
if (mouseInteractionMode){
allowDraw = false;
};
}
public function setInteractivityDefaults():void{
SHOW_DRAWN_FACES = false;
DEFAULT_SPRITE_ALPHA = 1;
DEFAULT_FILL_ALPHA = 1;
BitmapMaterial.AUTO_MIP_MAPPING = false;
DisplayObject3D.faceLevelMode = false;
buttonMode = true;
faceLevelMode = true;
mouseInteractionMode = false;
}
public function addInteractiveObject(_arg1:Object):void{
var _local2:InteractiveContainerData;
var _local3:InteractiveSprite;
if (faceDictionary[_arg1] == null){
_local2 = (faceDictionary[_arg1] = new InteractiveContainerData(_arg1));
containerDictionary[_local2.container] = _arg1;
_local3 = _local2.container;
_local3.addEventListener(MouseEvent.MOUSE_DOWN, handleMousePress);
_local3.addEventListener(MouseEvent.MOUSE_UP, handleMouseRelease);
_local3.addEventListener(MouseEvent.CLICK, handleMouseClick);
_local3.addEventListener(MouseEvent.MOUSE_OVER, handleMouseOver);
_local3.addEventListener(MouseEvent.MOUSE_OUT, handleMouseOut);
_local3.addEventListener(MouseEvent.MOUSE_MOVE, handleMouseMove);
_local3.buttonMode = buttonMode;
if (((!(SHOW_DRAWN_FACES)) && (!(DisplayObject3D.faceLevelMode)))){
_local3.blendMode = BlendMode.ERASE;
};
virtualMouse.ignore(_local3);
dispatchEvent(new InteractiveScene3DEvent(InteractiveScene3DEvent.OBJECT_ADDED, null, _local3));
if (debug){
log.debug("addDisplayObject id", _arg1.id, _arg1.name, DEFAULT_SPRITE_ALPHA);
};
};
}
public function resetFaces():void{
var _local1:InteractiveContainerData;
for each (_local1 in faceDictionary) {
_local1.container.graphics.clear();
_local1.sort = _local1.isDrawn;
_local1.isDrawn = false;
};
resizeStage();
}
public function resizeStage():void{
container.x = scene.container.x;
container.y = scene.container.y;
}
protected function handleMouseClick(_arg1:MouseEvent):void{
dispatchObjectEvent(InteractiveScene3DEvent.OBJECT_CLICK, Sprite(_arg1.currentTarget));
}
protected function handleMouseOut(_arg1:MouseEvent):void{
var face3d:Face3D;
var p:Object;
var mat:InteractiveMovieMaterial;
var rect:Rectangle;
var contains:Boolean;
var e = _arg1;
if (((VirtualMouse) && (((faceLevelMode) || (DisplayObject3D.faceLevelMode))))){
try {
face3d = containerDictionary[e.currentTarget];
p = InteractiveUtils.getMapCoordAtPoint(face3d, container.mouseX, container.mouseY);
mat = InteractiveMovieMaterial(face3d.face3DInstance.instance.material);
rect = new Rectangle(0, 0, mat.movie.width, mat.movie.height);
contains = rect.contains(p.x, p.y);
if (!contains){
virtualMouse.exitContainer();
};
} catch(err:Error) {
log.error("material type is not Interactive. If you're using a Collada object, you may have to reassign the material to the object after the collada scene is loaded", err.message);
};
};
dispatchObjectEvent(InteractiveScene3DEvent.OBJECT_OUT, Sprite(e.currentTarget));
}
public function drawFace(_arg1:DisplayObject3D, _arg2:Face3D, _arg3:Number, _arg4:Number, _arg5:Number, _arg6:Number, _arg7:Number, _arg8:Number):void{
var _local9:Object;
var _local10:InteractiveContainerData;
var _local11:InteractiveSprite;
var _local12:Graphics;
_local9 = _arg1;
if (((faceLevelMode) || (DisplayObject3D.faceLevelMode))){
_local9 = _arg2;
};
if (faceDictionary[_local9] == null){
addInteractiveObject(_local9);
};
if (((allowDraw) && (!(DisplayObject3D.faceLevelMode)))){
_local10 = faceDictionary[_local9];
_local11 = _local10.container;
_local12 = _local11.graphics;
_local11.x0 = _arg3;
_local11.x1 = _arg4;
_local11.x2 = _arg5;
_local11.y0 = _arg6;
_local11.y1 = _arg7;
_local11.y2 = _arg8;
_local12.beginFill(_local10.color, _local10.fillAlpha);
if (((!((_local10.lineColor == -1))) && (SHOW_DRAWN_FACES))){
_local12.lineStyle(_local10.lineSize, _local10.lineColor, _local10.lineAlpha);
};
_local12.moveTo(_arg3, _arg6);
_local12.lineTo(_arg4, _arg7);
_local12.lineTo(_arg5, _arg8);
_local12.endFill();
_local10.isDrawn = true;
};
}
public function set enableMouse(_arg1:Boolean):void{
Mouse3D.enabled = _arg1;
}
protected function dispatchObjectEvent(_arg1:String, _arg2:Sprite):void{
var _local3:Face3D;
var _local4:InteractiveContainerData;
if (debug){
log.debug(_arg1, DisplayObject3D(containerDictionary[_arg2]).name);
};
if ((containerDictionary[_arg2] is DisplayObject3D)){
containerDictionary[_arg2].dispatchEvent(new InteractiveScene3DEvent(_arg1, containerDictionary[_arg2], InteractiveSprite(_arg2)));
dispatchEvent(new InteractiveScene3DEvent(_arg1, containerDictionary[_arg2], InteractiveSprite(_arg2), null, null));
} else {
if ((containerDictionary[_arg2] is Face3D)){
_local3 = containerDictionary[_arg2];
_local4 = faceDictionary[_local3];
dispatchEvent(new InteractiveScene3DEvent(_arg1, null, InteractiveSprite(_arg2), _local3, _local4));
};
};
}
protected function handleMouseMove(_arg1:MouseEvent):void{
var point:Object;
var face3d:Face3D;
var mat:MovieMaterial;
var e = _arg1;
if (((VirtualMouse) && (((faceLevelMode) || (DisplayObject3D.faceLevelMode))))){
face3d = containerDictionary[e.currentTarget];
point = InteractiveUtils.getMapCoordAtPoint(face3d, container.mouseX, container.mouseY);
try {
mat = (face3d.face3DInstance.instance.material as MovieMaterial);
virtualMouse.container = (mat.movie as Sprite);
if (virtualMouse.container){
virtualMouse.setLocation(point.x, point.y);
};
} catch(err:Error) {
log.error("material type is not Inter active. If you're using a Collada object, you may have to reassign the material to the object after the collada scene is loaded", err.message);
};
};
dispatchObjectEvent(InteractiveScene3DEvent.OBJECT_MOVE, Sprite(e.currentTarget));
if (((Mouse3D.enabled) && (((faceLevelMode) || (DisplayObject3D.faceLevelMode))))){
mouse3D.updatePosition(Face3D(containerDictionary[e.currentTarget]), (e.currentTarget as Sprite));
};
}
protected function handleMouseOver(_arg1:MouseEvent):void{
var _local2:String;
_local2 = (((!(evaluateClick)) || (!(mouseInteractionMode)))) ? InteractiveScene3DEvent.OBJECT_OVER : InteractiveScene3DEvent.OBJECT_CLICK;
evaluateClick = false;
if (((virtualMouse) && ((_local2 == InteractiveScene3DEvent.OBJECT_CLICK)))){
virtualMouse.click();
};
dispatchObjectEvent(_local2, Sprite(_arg1.currentTarget));
}
public function set mouseInteractionMode(_arg1:Boolean):void{
_mouseInteractionMode = _arg1;
allowDraw = !(_arg1);
if (_arg1){
container.stage.addEventListener(MouseEvent.MOUSE_MOVE, handleStageMouseMove);
};
if (!_arg1){
container.stage.removeEventListener(MouseEvent.MOUSE_MOVE, handleStageMouseMove);
};
}
public function get enableMouse():Boolean{
return (Mouse3D.enabled);
}
protected function handleMousePress(_arg1:MouseEvent):void{
MOUSE_IS_DOWN = true;
if (virtualMouse){
virtualMouse.press();
};
dispatchObjectEvent(InteractiveScene3DEvent.OBJECT_PRESS, Sprite(_arg1.currentTarget));
}
protected function handleReleaseOutside(_arg1:MouseEvent):void{
if (debug){
log.debug("releaseOutside");
};
dispatchEvent(new InteractiveScene3DEvent(InteractiveScene3DEvent.OBJECT_RELEASE_OUTSIDE));
MOUSE_IS_DOWN = false;
evaluateClick = true;
allowDraw = true;
}
public function get mouseInteractionMode():Boolean{
return (_mouseInteractionMode);
}
protected function handleAddedToStage(_arg1:Event):void{
container.stage.addEventListener(Event.RESIZE, handleResize);
container.stage.addEventListener(MouseEvent.MOUSE_UP, handleReleaseOutside);
virtualMouse.stage = container.stage;
}
protected function handleMouseRelease(_arg1:MouseEvent):void{
MOUSE_IS_DOWN = false;
if (virtualMouse){
virtualMouse.release();
};
dispatchObjectEvent(InteractiveScene3DEvent.OBJECT_RELEASE, Sprite(_arg1.currentTarget));
}
protected function handleResize(_arg1:Event):void{
resizeStage();
}
}
}//package org.papervision3d.utils
Section 104
//InteractiveSprite (org.papervision3d.utils.InteractiveSprite)
package org.papervision3d.utils {
import flash.display.*;
import org.papervision3d.objects.*;
public class InteractiveSprite extends Sprite {
public var interactiveContainerData:InteractiveContainerData;// = null
public var x1:Number;
public var x2:Number;
public var x0:Number;
public var y0:Number;
public var y2:Number;
public var obj:DisplayObject3D;// = null
public var y1:Number;
public function InteractiveSprite(_arg1:DisplayObject3D=null):void{
obj = null;
interactiveContainerData = null;
super();
this.obj = _arg1;
}
}
}//package org.papervision3d.utils
Section 105
//InteractiveUtils (org.papervision3d.utils.InteractiveUtils)
package org.papervision3d.utils {
import flash.display.*;
import org.papervision3d.objects.*;
import org.papervision3d.core.geom.*;
import org.papervision3d.core.proto.*;
import org.papervision3d.materials.*;
public class InteractiveUtils {
public static function getMapCoordAtPointDO3D(_arg1:DisplayObject3D, _arg2:Number, _arg3:Number):Object{
var _local4:Face3D;
_local4 = _arg1.geometry.faces[0];
return (getMapCoordAtPoint(_local4, _arg2, _arg3));
}
public static function UVatPoint(_arg1:Face3D, _arg2:Number, _arg3:Number):Object{
var _local4:Vertex3D;
var _local5:Vertex3D;
var _local6:Vertex3D;
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;
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;
_local4 = _arg1.v0;
_local5 = _arg1.v1;
_local6 = _arg1.v2;
_local7 = _local4.vertex2DInstance.x;
_local8 = _local4.vertex2DInstance.y;
_local9 = _local5.vertex2DInstance.x;
_local10 = _local5.vertex2DInstance.y;
_local11 = _local6.vertex2DInstance.x;
_local12 = _local6.vertex2DInstance.y;
_local13 = (_local11 - _local7);
_local14 = (_local12 - _local8);
_local15 = (_local9 - _local7);
_local16 = (_local10 - _local8);
_local17 = (_arg2 - _local7);
_local18 = (_arg3 - _local8);
_local19 = ((_local13 * _local13) + (_local14 * _local14));
_local20 = ((_local13 * _local15) + (_local14 * _local16));
_local21 = ((_local13 * _local17) + (_local14 * _local18));
_local22 = ((_local15 * _local15) + (_local16 * _local16));
_local23 = ((_local15 * _local17) + (_local16 * _local18));
_local24 = (1 / ((_local19 * _local22) - (_local20 * _local20)));
_local25 = (((_local22 * _local21) - (_local20 * _local23)) * _local24);
_local26 = (((_local19 * _local23) - (_local20 * _local21)) * _local24);
return ({u:_local25, v:_local26});
}
public static function getMapCoordAtPoint(_arg1:Face3D, _arg2:Number, _arg3:Number):Object{
var _local4:Array;
var _local5:Object;
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:MaterialObject3D;
var _local17:BitmapData;
var _local18:Number;
var _local19:Number;
_local4 = _arg1.uv;
_local5 = UVatPoint(_arg1, _arg2, _arg3);
_local6 = _local5.u;
_local7 = _local5.v;
_local8 = _local4[0].u;
_local9 = _local4[1].u;
_local10 = _local4[2].u;
_local11 = _local4[0].v;
_local12 = _local4[1].v;
_local13 = _local4[2].v;
_local14 = ((((_local9 - _local8) * _local7) + ((_local10 - _local8) * _local6)) + _local8);
_local15 = ((((_local12 - _local11) * _local7) + ((_local13 - _local11) * _local6)) + _local11);
_local16 = _arg1.face3DInstance.instance.material;
_local17 = _local16.bitmap;
_local18 = 1;
_local19 = 1;
if (_local17){
_local18 = (BitmapMaterial.AUTO_MIP_MAPPING) ? _local16.widthOffset : _local17.width;
_local19 = (BitmapMaterial.AUTO_MIP_MAPPING) ? _local16.heightOffset : _local17.height;
};
return ({x:(_local14 * _local18), y:(_local19 - (_local15 * _local19))});
}
public static function getCoordAtPoint(_arg1:Face3D, _arg2:Number, _arg3:Number):Vertex3D{
var _local4:Object;
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;
var _local17:Number;
var _local18:Number;
_local4 = UVatPoint(_arg1, _arg2, _arg3);
_local5 = _arg1.v0.x;
_local6 = _arg1.v0.y;
_local7 = _arg1.v0.z;
_local8 = _arg1.v1.x;
_local9 = _arg1.v1.y;
_local10 = _arg1.v1.z;
_local11 = _arg1.v2.x;
_local12 = _arg1.v2.y;
_local13 = _arg1.v2.z;
_local14 = _local4.u;
_local15 = _local4.v;
_local16 = ((_local5 + ((_local8 - _local5) * _local15)) + ((_local11 - _local5) * _local14));
_local17 = ((_local6 + ((_local9 - _local6) * _local15)) + ((_local12 - _local6) * _local14));
_local18 = ((_local7 + ((_local10 - _local7) * _local15)) + ((_local13 - _local7) * _local14));
return (new Vertex3D(_local16, _local17, _local18));
}
}
}//package org.papervision3d.utils
Section 106
//Mouse3D (org.papervision3d.utils.Mouse3D)
package org.papervision3d.utils {
import flash.display.*;
import org.papervision3d.objects.*;
import org.papervision3d.core.geom.*;
import org.papervision3d.core.*;
public class Mouse3D extends DisplayObject3D {
public static var enabled:Boolean = true;
private static var UP:Number3D = new Number3D(0, 1, 0);
public function Mouse3D(_arg1:Object=null):void{
}
public function updatePosition(_arg1:Face3D, _arg2:Sprite):void{
var _local3:Number3D;
var _local4:Number3D;
var _local5:Number3D;
var _local6:Matrix3D;
var _local7:Matrix3D;
var _local8:Number;
var _local9:Number;
var _local10:Number3D;
var _local11:Number3D;
var _local12:Matrix3D;
_local3 = new Number3D(0, 0, 0);
_local4 = new Number3D(_arg1.faceNormal.x, _arg1.faceNormal.y, _arg1.faceNormal.z);
_local5 = Number3D.sub(_local4, _local3);
_local5.normalize();
if (_local5.modulo > 0.1){
_local10 = Number3D.cross(_local5, UP);
_local10.normalize();
_local11 = Number3D.cross(_local5, _local10);
_local11.normalize();
_local12 = this.transform;
_local12.n11 = _local10.x;
_local12.n21 = _local10.y;
_local12.n31 = _local10.z;
_local12.n12 = -(_local11.x);
_local12.n22 = -(_local11.y);
_local12.n32 = -(_local11.z);
_local12.n13 = _local5.x;
_local12.n23 = _local5.y;
_local12.n33 = _local5.z;
};
_local6 = Matrix3D.IDENTITY;
this.transform = Matrix3D.multiply(_arg1.face3DInstance.instance.world, _local12);
_local7 = Matrix3D.IDENTITY;
_local8 = _arg2.mouseX;
_local9 = _arg2.mouseY;
_local7.n14 = InteractiveUtils.getCoordAtPoint(_arg1, _local8, _local9).x;
_local7.n24 = InteractiveUtils.getCoordAtPoint(_arg1, _local8, _local9).y;
_local7.n34 = InteractiveUtils.getCoordAtPoint(_arg1, _local8, _local9).z;
_local6.calculateMultiply(_arg1.face3DInstance.instance.world, _local7);
x = _local6.n14;
y = _local6.n24;
z = _local6.n34;
}
}
}//package org.papervision3d.utils
Section 107
//Papervision3D (org.papervision3d.Papervision3D)
package org.papervision3d {
public class Papervision3D {
public static var useDEGREES:Boolean = true;
public static var VERBOSE:Boolean = true;
public static var AUTHOR:String = "(c) 2006-2007 Copyright by Carlos Ulloa | papervision3d.org | carlos@papervision3d.org";
public static var DATE:String = "20.08.07";
public static var NAME:String = "Papervision3D";
public static var VERSION:String = "Beta 1.7";
public static var usePERCENT:Boolean = false;
public static function log(_arg1:String):void{
if (_slot1.VERBOSE){
trace(_arg1);
};
}
}
}//package org.papervision3d
Section 108
//Bamf (Bamf)
package {
import flash.media.*;
public dynamic class Bamf extends Sound {
}
}//package
Section 109
//Blam (Blam)
package {
import flash.media.*;
public dynamic class Blam extends Sound {
}
}//package
Section 110
//Cam (Cam)
package {
import flash.display.*;
public class Cam extends MovieClip {
public var EUpgradeInterval:int;// = 5100
public var TotalShots:int;// = 1000
public var EnemySpawnTimer:int;// = 0
public var EnemiesMC:MovieClip;
public var CalcToggle:int;// = 0
public var FirstUnit:Unit;
public var E6ShotsMC:MovieClip;
public var CurrentTarget:Unit;
public var Radians:Number;
public var Yellows:Array;
public var ScoreBase:int;// = 5
public var A6ShotsMC:MovieClip;
public var CalcToggleMax:int;// = 10
public var A4ShotsMC:MovieClip;
public var E4ShotsMC:MovieClip;
public var SinArray:Array;
public var AlliedUnitLevel:int;// = 1
public var HeroShotsMC:MovieClip;
public var AActive:Array;
public var TotalUnits:int;// = 80
public var RadLimit;
public var EnemySpawn:int;// = 70
public var Secondaries:Array;
public var BigReds:Array;
public var A7ShotsMC:MovieClip;
public var DeathShotsMC:MovieClip;
public var E7ShotsMC:MovieClip;
public var HeroMC:Hero;
public var CosArray:Array;
public var EUpgradeMultiplier:Number;// = 1.26
public var AllySpawn:int;// = 70
public var Height:int;
public var EtherShotsMC:MovieClip;
public var LifeCount:int;// = 0
public var A5ShotsMC:MovieClip;
public var E5ShotsMC:MovieClip;
public var ShotArray:Array;
public var EUpgradeTimer:int;// = 0
public var SecDist:Number;// = 25
public var AllySpawns:Array;
public var A3ShotsMC:MovieClip;
public var E3ShotsMC:MovieClip;
public var Width:int;
public var FirstShot:Shot;
public var RedDist:Number;// = 2200
public var EActive:Array;
public var AllySpawnTimer:int;// = 0
public var AlliesMC:MovieClip;
public var CamSpeed:Number;// = 0.25
public var RadarZoom:Number;// = 40
public var ScreenShake:int;// = 0
public var E1ShotsMC:MovieClip;
public var A1ShotsMC:MovieClip;
public var A8ShotsMC:MovieClip;
public var E8ShotsMC:MovieClip;
public var EventArray:Array;
public function Cam(){
var _local1:Unit;
var _local2:int;
var _local3:Shot;
RadarZoom = 40;
CamSpeed = 0.25;
Width = stage.stageWidth;
Height = stage.stageHeight;
ScreenShake = 0;
FirstUnit = new Unit();
EventArray = new Array();
CalcToggle = 0;
CalcToggleMax = 10;
BigReds = new Array();
Yellows = new Array();
AllySpawns = new Array();
Secondaries = new Array();
TotalUnits = 80;
RedDist = 2200;
SecDist = 25;
AllySpawn = 70;
EnemySpawn = 70;
AllySpawnTimer = 0;
EnemySpawnTimer = 0;
LifeCount = 0;
AlliedUnitLevel = 1;
EActive = new Array("E3", "E4", "E1", "Death");
AActive = new Array("A3", "A4", "A1", "Hero", "Death");
EUpgradeTimer = 0;
EUpgradeInterval = 5100;
EUpgradeMultiplier = 1.26;
ScoreBase = 5;
FirstShot = new Shot();
TotalShots = 1000;
ShotArray = new Array();
RadLimit = (Math.PI * 2);
CosArray = new Array();
SinArray = new Array();
Radians = (180 / Math.PI);
super();
_local1 = FirstUnit;
_local2 = 0;
while (_local2 < TotalUnits) {
_local1.NextUnit = new Unit();
_local2++;
_local1 = _local1.NextUnit;
};
HeroMC.NextUnit = FirstUnit;
_local3 = FirstShot;
_local2 = 0;
while (_local2 < TotalShots) {
_local3.NextShot = new Shot();
_local2++;
_local3 = _local3.NextShot;
};
_local2 = 0;
while (_local2 < 1400) {
CosArray[_local2] = Math.cos(((_local2 - 700) / 100));
SinArray[_local2] = Math.sin(((_local2 - 700) / 100));
_local2++;
};
newUnit(0, 0, "Secondary", true, 4);
newBuilding(0, 0, "A0", true);
newUnit(400, -165, "A1", true, 1, false);
newUnit(400, 165, "A1", true, 1, false);
newUnit(-400, 165, "A1", true, 1, false);
newUnit(-400, -165, "A1", true, 1, false);
newUnit(165, -400, "A1", true, 1, false);
newUnit(-165, -400, "A1", true, 1, false);
newUnit(-165, 400, "A1", true, 1, false);
newUnit(165, 400, "A1", true, 1, false);
newBuilding(RedDist, 0, "E0", false);
newUnit(RedDist, 0, "E1", false, 12, false);
newBuilding(0, 400, "A2", true);
newBuilding(0, -400, "A2", true);
newBuilding(400, 0, "A2", true);
newBuilding(-400, 0, "A2", true);
}
public function CamMain(){
var _local1:*;
var _local2:Number;
var _local3:Unit;
var _local4:Shot;
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:Number;
var _local9:Number;
var _local10:*;
var _local11:*;
var _local12:int;
var _local13:int;
var _local14:int;
var _local15:int;
var _local16:int;
if (MovieClip(root).Paused == false){
EUpgradeTimer++;
if (EUpgradeTimer >= EUpgradeInterval){
EUpgradeHandler();
EUpgradeInterval = (EUpgradeInterval * EUpgradeMultiplier);
EUpgradeTimer = 0;
};
if (!MovieClip(root).EndGame){
MovieClip(root).ParticleSystemMC.newEvent(0, 0, -1, 0, 5, 4, 4278255615, 100, 100);
};
_local2 = 0;
_local3 = FirstUnit;
_local4 = FirstShot;
_local8 = 99999;
_local9 = 99999;
_local10 = (((HeroMC.x + this.x) - (Width * 0.5)) * CamSpeed);
_local11 = (((HeroMC.y + this.y) - (Height * 0.5)) * CamSpeed);
if (ScreenShake > 0){
_local10 = (_local10 + (10 - (Math.random() * 20)));
_local11 = (_local11 + (10 - (Math.random() * 20)));
ScreenShake--;
};
if (ScreenShake > 10){
ScreenShake = 10;
};
this.x = (this.x - _local10);
this.y = (this.y - _local11);
MovieClip(root).ParticleSystemMC.DispX = this.x;
MovieClip(root).ParticleSystemMC.DispY = this.y;
MovieClip(root).BackgroundMC.x = this.x;
MovieClip(root).BackgroundMC.y = this.y;
if ((((LifeCount < (TotalUnits - 8))) && ((MovieClip(root).EndGame == false)))){
if (EnemySpawnTimer >= EnemySpawn){
if (BigReds[1].Active != false){
newUnit(BigReds[1].x, BigReds[1].y, EActive[0], false, 2, true);
newUnit(BigReds[1].x, BigReds[1].y, EActive[1], false, 2, true);
};
EnemySpawnTimer = 0;
} else {
EnemySpawnTimer++;
};
if (AllySpawnTimer >= AllySpawn){
if (AllySpawns[1].Active != false){
newUnit(AllySpawns[1].x, AllySpawns[1].y, AActive[0], true, 1, false);
};
if (AllySpawns[2].Active != false){
newUnit(AllySpawns[2].x, AllySpawns[2].y, AActive[0], true, 1, false);
};
if (AllySpawns[3].Active != false){
newUnit(AllySpawns[3].x, AllySpawns[3].y, AActive[1], true, 1, false);
};
if (AllySpawns[4].Active != false){
newUnit(AllySpawns[4].x, AllySpawns[4].y, AActive[1], true, 1, false);
};
AllySpawnTimer = 0;
} else {
AllySpawnTimer++;
};
};
_local12 = 0;
while (_local12 < TotalShots) {
if (_local4.Active){
if (_local4.hitTestObject(MovieClip(root).BackdropMC)){
_local4.visible = true;
} else {
_local4.visible = false;
};
if (_local4.TargetUnit != null){
_local5 = Math.atan2((_local4.TargetUnit.y - _local4.y), (_local4.TargetUnit.x - _local4.x));
if (_local4.Ether){
_local4.MoveAngle = _local5;
} else {
if (_local5 < 0){
_local6 = -(_local5);
} else {
_local6 = _local5;
};
if (_local3.MoveAngle < 0){
_local7 = -(_local4.MoveAngle);
} else {
_local7 = _local4.MoveAngle;
};
if ((((((_local6 < (_local7 + _local4.Turn))) && ((_local6 > (180 - _local4.Turn))))) || ((((_local5 < (_local4.MoveAngle + _local4.Turn))) && ((_local5 > (_local4.MoveAngle - _local4.Turn))))))){
_local4.MoveAngle = _local5;
} else {
if (_local5 < 0){
if ((((_local4.MoveAngle > _local5)) && ((_local4.MoveAngle < (Math.PI - _local6))))){
_local4.MoveAngle = (_local4.MoveAngle - _local4.Turn);
} else {
_local4.MoveAngle = (_local4.MoveAngle + _local4.Turn);
};
} else {
if ((((_local4.MoveAngle < _local5)) && ((_local4.MoveAngle > -((Math.PI - _local6)))))){
_local4.MoveAngle = (_local4.MoveAngle + _local4.Turn);
} else {
_local4.MoveAngle = (_local4.MoveAngle - _local4.Turn);
};
};
};
if (_local4.MoveAngle > RadLimit){
_local4.MoveAngle = (_local4.MoveAngle - RadLimit);
};
if (_local4.MoveAngle < -(RadLimit)){
_local4.MoveAngle = (_local4.MoveAngle + RadLimit);
};
};
_local4.rotation = (_local4.MoveAngle * Radians);
if (((((_local4.hitTestObject(_local4.TargetUnit)) || ((_local4.TargetUnit.Active == false)))) || ((_local4.TimeLimit == 0)))){
if (_local4.Ether){
MovieClip(root).Ether++;
MovieClip(root).ParticleSystemMC.newEvent(_local4.x, _local4.y, -1, 0, 25, 3, 4278255360, 1, 1);
_local4.Die();
} else {
newShot(_local4.x, _local4.y, "SmartDeath", _local4.Allied, 0);
_local4.Die();
};
};
_local4.TimeLimit--;
_local4.x = (_local4.x + (CosArray[int(((_local4.MoveAngle * 100) + 700))] * _local4.Speed));
_local4.y = (_local4.y + (SinArray[int(((_local4.MoveAngle * 100) + 700))] * _local4.Speed));
};
} else {
if (ShotArray.length > 0){
if ((((((ShotArray[0].Type == "SmartDeath")) || ((ShotArray[0].Type == "Smart")))) || ((ShotArray[0].Type == "Secondary")))){
MovieClip(getChildByName("HeroShotsMC")).addChild(_local4);
} else {
MovieClip(getChildByName((ShotArray[0].Type + "ShotsMC"))).addChild(_local4);
};
_local4.Active = true;
_local4.x = ShotArray[0].XPos;
_local4.y = ShotArray[0].YPos;
_local4.rotation = ShotArray[0].Rotation;
_local4.MoveAngle = (ShotArray[0].Rotation / Radians);
if (ShotArray[0].Type == "Hero"){
_local4.gotoAndPlay(("Hero" + HeroMC.CannonType));
} else {
if (ShotArray[0].Type == "Smart"){
_local1 = FirstUnit;
_local8 = 99999;
_local9 = 99999;
_local14 = 0;
while (_local14 <= TotalUnits) {
if (((_local1.Active) && (!(_local1.Allied)))){
_local10 = (_local4.x - _local1.x);
_local11 = (_local4.y - _local1.y);
_local8 = Math.sqrt(((_local10 * _local10) + (_local11 * _local11)));
if (_local8 < 0){
_local8 = -(_local8);
};
if (_local8 < _local9){
_local4.TargetUnit = _local1;
_local9 = _local8;
};
};
_local14++;
_local1 = _local1.NextUnit;
};
_local4.gotoAndPlay(ShotArray[0].Type);
_local4.Speed = 30;
_local4.TimeLimit = 90;
} else {
if (ShotArray[0].Type == "Ether"){
_local4.Ether = true;
_local4.TargetUnit = HeroMC;
_local4.gotoAndPlay(ShotArray[0].Type);
} else {
_local4.gotoAndPlay(ShotArray[0].Type);
};
};
};
ShotArray[0] = ShotArray[(ShotArray.length - 1)];
ShotArray.pop();
};
};
_local12++;
_local4 = _local4.NextShot;
};
LifeCount = 0;
_local13 = 0;
while (_local13 < TotalUnits) {
if (_local3.Active){
LifeCount++;
setRadar(_local3);
if (_local3.Range > 0){
if (_local3.Calc == 0){
if (((!((_local3.TargetUnit == null))) && (!((_local3.TargetUnit.Active == false))))){
_local10 = (_local3.x - _local3.TargetUnit.x);
_local11 = (_local3.y - _local3.TargetUnit.y);
_local8 = Math.sqrt(((_local10 * _local10) + (_local11 * _local11)));
_local3.TargetDist = _local8;
} else {
_local8 = 99999;
};
if (_local8 < 0){
_local8 = -(_local8);
};
if (_local8 > _local3.Range){
_local1 = HeroMC;
_local3.TargetDist = 99999;
_local15 = 0;
while (_local15 <= TotalUnits) {
if (((_local1.Active) && (!((_local1.Allied == _local3.Allied))))){
_local10 = (_local3.x - _local1.x);
_local11 = (_local3.y - _local1.y);
_local8 = Math.sqrt(((_local10 * _local10) + (_local11 * _local11)));
if (_local8 < 0){
_local8 = -(_local8);
};
if (_local8 < _local3.TargetDist){
if (_local3.TargetDist <= _local3.Range){
if (_local1.Priority >= _local3.TargetUnit.Priority){
_local3.TargetUnit = _local1;
_local3.TargetDist = _local8;
};
} else {
_local3.TargetUnit = _local1;
_local3.TargetDist = _local8;
};
};
};
_local15++;
_local1 = _local1.NextUnit;
};
};
_local3.Calc = CalcToggleMax;
} else {
_local3.Calc--;
};
};
if (_local3.Type == "E0"){
_local3.MoveAngle = (_local3.MoveAngle + 0.002);
_local3.x = (Math.sin(_local3.MoveAngle) * RedDist);
_local3.y = (Math.cos(_local3.MoveAngle) * RedDist);
MovieClip(root).ParticleSystemMC.newEvent(_local3.x, _local3.y, -1, 0, 2, 5, 4294901794, 400, 400);
MovieClip(root).ParticleSystemMC.newEvent(_local3.x, _local3.y, -1, 0, 2, 5, 4294901913, 400, 400);
MovieClip(root).ParticleSystemMC.newEvent(_local3.x, _local3.y, -1, 0, 2, 5, 4294901760, 400, 400);
} else {
if (_local3.Type == "E1"){
if (_local3.YellowTeir == 1){
_local3.MoveAngle = (_local3.MoveAngle + 0.05);
if (_local3.MoveAngle >= 3.141){
_local3.MoveAngle = (_local3.MoveAngle - 6.282);
};
_local3.x = (BigReds[_local3.FollowRed].x + (SinArray[int(((_local3.MoveAngle * 100) + 700))] * 300));
_local3.y = (BigReds[_local3.FollowRed].y + (CosArray[int(((_local3.MoveAngle * 100) + 700))] * 300));
MovieClip(root).ParticleSystemMC.newEvent(_local3.x, _local3.y, ((-(_local3.MoveAngle) * Radians) + 180), 10, 2, 5, 4294967040, 10, 10);
} else {
if (_local3.YellowTeir == 2){
_local3.MoveAngle = (_local3.MoveAngle - 0.025);
if (_local3.MoveAngle <= -3.141){
_local3.MoveAngle = (_local3.MoveAngle + 6.282);
};
_local3.x = (BigReds[_local3.FollowRed].x + (SinArray[int(((_local3.MoveAngle * 100) + 700))] * 600));
_local3.y = (BigReds[_local3.FollowRed].y + (CosArray[int(((_local3.MoveAngle * 100) + 700))] * 600));
MovieClip(root).ParticleSystemMC.newEvent(_local3.x, _local3.y, (-(_local3.MoveAngle) * Radians), 10, 2, 5, 4294967040, 10, 10);
} else {
_local3.MoveAngle = (_local3.MoveAngle + 0.01);
if (_local3.MoveAngle >= 3.141){
_local3.MoveAngle = (_local3.MoveAngle - 6.282);
};
_local3.x = (BigReds[_local3.FollowRed].x + (SinArray[int(((_local3.MoveAngle * 100) + 700))] * 900));
_local3.y = (BigReds[_local3.FollowRed].y + (CosArray[int(((_local3.MoveAngle * 100) + 700))] * 900));
MovieClip(root).ParticleSystemMC.newEvent(_local3.x, _local3.y, ((-(_local3.MoveAngle) * Radians) + 180), 10, 2, 5, 4294967040, 10, 10);
};
};
} else {
if (_local3.Type == "Secondary"){
if (HeroMC != null){
if (_local3 == Secondaries[0]){
_local3.x = (HeroMC.x + SecDist);
_local3.y = HeroMC.y;
};
if (_local3 == Secondaries[1]){
_local3.x = (HeroMC.x - SecDist);
_local3.y = HeroMC.y;
};
if (_local3 == Secondaries[2]){
_local3.x = HeroMC.x;
_local3.y = (HeroMC.y + SecDist);
};
if (_local3 == Secondaries[3]){
_local3.x = HeroMC.x;
_local3.y = (HeroMC.y - SecDist);
};
};
} else {
if (_local3.TargetUnit != null){
if (Math.random() < 0.1){
_local2 = _local3.Range;
_local3.DodgeX = (_local2 - (Math.random() * (_local2 * 2)));
_local3.DodgeY = (_local2 - (Math.random() * (_local2 * 2)));
};
_local5 = Math.atan2(((_local3.TargetUnit.y - _local3.y) + _local3.DodgeY), ((_local3.TargetUnit.x - _local3.x) + _local3.DodgeX));
if (_local3.Speed > 0){
if (_local5 < 0){
_local6 = -(_local5);
} else {
_local6 = _local5;
};
if (_local3.MoveAngle < 0){
_local7 = -(_local3.MoveAngle);
} else {
_local7 = _local3.MoveAngle;
};
if ((((((_local6 < (_local7 + _local3.Turn))) && ((_local6 > (180 - _local3.Turn))))) || ((((_local5 < (_local3.MoveAngle + _local3.Turn))) && ((_local5 > (_local3.MoveAngle - _local3.Turn))))))){
_local3.MoveAngle = _local5;
} else {
if (_local5 < 0){
if ((((_local3.MoveAngle > _local5)) && ((_local3.MoveAngle < (Math.PI - _local6))))){
_local3.MoveAngle = (_local3.MoveAngle - _local3.Turn);
} else {
_local3.MoveAngle = (_local3.MoveAngle + _local3.Turn);
};
} else {
if ((((_local3.MoveAngle < _local5)) && ((_local3.MoveAngle > -((Math.PI - _local6)))))){
_local3.MoveAngle = (_local3.MoveAngle + _local3.Turn);
} else {
_local3.MoveAngle = (_local3.MoveAngle - _local3.Turn);
};
};
};
if (_local3.MoveAngle > RadLimit){
_local3.MoveAngle = (_local3.MoveAngle - RadLimit);
};
if (_local3.MoveAngle < -(RadLimit)){
_local3.MoveAngle = (_local3.MoveAngle + RadLimit);
};
if (_local3.Rot != null){
_local3.Rot.rotation = (_local3.MoveAngle * Radians);
};
_local3.NextX = (CosArray[int(((_local3.MoveAngle * 100) + 700))] * _local3.Speed);
_local3.NextY = (SinArray[int(((_local3.MoveAngle * 100) + 700))] * _local3.Speed);
};
};
};
};
};
if (_local3.TargetUnit != null){
_local5 = (Math.atan2((_local3.TargetUnit.y - _local3.y), (_local3.TargetUnit.x - _local3.x)) * Radians);
if (((!((_local3.Aim == null))) || (!((_local3.Gun == null))))){
if (_local5 < 0){
_local6 = -(_local5);
} else {
_local6 = _local5;
};
if (_local3.AimAngle < 0){
_local7 = -(_local3.AimAngle);
} else {
_local7 = _local3.AimAngle;
};
if ((((((_local6 < (_local7 + _local3.AimSpeed))) && ((_local6 > (180 - _local3.AimSpeed))))) || ((((_local5 < (_local3.AimAngle + _local3.AimSpeed))) && ((_local5 > (_local3.AimAngle - _local3.AimSpeed))))))){
_local3.AimAngle = _local5;
} else {
if (_local5 < 0){
if ((((_local3.AimAngle > _local5)) && ((_local3.AimAngle < (180 - _local6))))){
_local3.AimAngle = (_local3.AimAngle - _local3.AimSpeed);
} else {
_local3.AimAngle = (_local3.AimAngle + _local3.AimSpeed);
};
} else {
if ((((_local3.AimAngle < _local5)) && ((_local3.AimAngle > -((180 - _local6)))))){
_local3.AimAngle = (_local3.AimAngle + _local3.AimSpeed);
} else {
_local3.AimAngle = (_local3.AimAngle - _local3.AimSpeed);
};
};
};
if (_local3.Aim != null){
_local3.Aim.rotation = _local3.AimAngle;
};
if (_local3.Gun != null){
_local3.Gun.rotation = _local3.AimAngle;
};
} else {
_local3.AimAngle = _local5;
};
if (_local3.ShotTimer == 0){
if (_local3.TargetDist <= _local3.Range){
newShot(_local3.x, _local3.y, _local3.Type, _local3.Allied, _local3.AimAngle);
_local3.ShotTimer = _local3.ShotSpace;
if (_local3.Gun != null){
_local3.Gun.gotoAndPlay("Shoot");
};
if (_local3.visible){
switch (_local3.Type){
case "A1":
case "E1":
MovieClip(root).LongLazerVar.play();
break;
case "A3":
case "A4":
case "A5":
case "A6":
case "A7":
case "A8":
case "Secondary":
case "E3":
case "E5":
case "E6":
case "E8":
if (Math.random() < 0.33){
MovieClip(root).Lazer1Var.play();
} else {
if (Math.random() < 0.33){
MovieClip(root).Lazer2Var.play();
} else {
MovieClip(root).Lazer3Var.play();
};
};
break;
case "E4":
case "E7":
MovieClip(root).BamfVar.play();
break;
};
};
};
} else {
_local3.ShotTimer--;
};
};
_local3.HeroLastHit = false;
if (_local3.Damage > 0){
_local3.Damage = (_local3.Damage - _local3.Revive);
};
if ((((_local3.DelayCount <= 0)) && (!((_local3.Type == "Secondary"))))){
if (_local3.Allied){
_local16 = 0;
while (_local16 < EActive.length) {
if (getChildByName((EActive[_local16] + "ShotsMC")).hitTestPoint((_local3.x + MovieClip(root).CamMC.x), (_local3.y + MovieClip(root).CamMC.y), true)){
MovieClip(root).Hit(EActive[_local16], _local3);
_local3.HitPopMC.play();
_local3.DelayCount = _local3.Delay;
if ((((_local3.Damage > (_local3.Shield * 0.75))) && ((((((_local3.Type == "A0")) || ((_local3.Type == "A1")))) || ((_local3.Type == "A2")))))){
MovieClip(root).WarningsMC.gotoAndPlay("Allies");
};
};
_local16++;
};
} else {
_local16 = 0;
while (_local16 < AActive.length) {
if (getChildByName((AActive[_local16] + "ShotsMC")).hitTestPoint((_local3.x + MovieClip(root).CamMC.x), (_local3.y + MovieClip(root).CamMC.y), true)){
if (((!((_local3.Type == "E0"))) || ((_local3.YellowCount >= 12)))){
MovieClip(root).Hit(AActive[_local16], _local3);
_local3.HitPopMC.play();
if ((((AActive[_local16] == "Hero")) || ((AActive[_local16] == "Secondary")))){
_local3.HeroHit = true;
_local3.HeroLastHit = true;
CurrentTarget = _local3;
};
} else {
_local3.MissPopMC.play();
};
_local3.DelayCount = _local3.Delay;
};
_local16++;
};
};
if (_local3.HealthBar != null){
if (_local3 == CurrentTarget){
_local3.HealthBar.visible = true;
} else {
_local3.HealthBar.visible = false;
};
_local3.HealthBar.Bar.scaleX = ((_local3.Shield - _local3.Damage) / _local3.Shield);
};
if (_local3.Damage > _local3.Shield){
if (_local3.Type == "E1"){
MovieClip(root).Score = (MovieClip(root).Score + (ScoreBase * 100));
} else {
if (_local3.Type == "E0"){
MovieClip(root).Score = (MovieClip(root).Score + (ScoreBase * 200));
} else {
if (_local3.HeroLastHit){
MovieClip(root).Score = (MovieClip(root).Score + ScoreBase);
};
};
};
if (_local3.HeroHit){
newShot(_local3.x, _local3.y, "Ether", true, _local3.rotation);
};
newShot(_local3.x, _local3.y, "Death", _local3.Allied, 0);
if (_local3.Type == "E1"){
BigReds[_local3.FollowRed].YellowCount++;
};
_local3.Die();
};
} else {
_local3.DelayCount--;
};
if (_local3.hitTestObject(MovieClip(root).BackdropMC)){
_local3.visible = true;
if (_local3.Ani != null){
_local3.Ani.play();
};
} else {
_local3.visible = false;
if (_local3.Ani != null){
_local3.Ani.stop();
};
};
if (((!((_local3.TargetUnit == null))) && ((_local3.Speed > 0)))){
_local3.x = (_local3.x + _local3.NextX);
_local3.y = (_local3.y + _local3.NextY);
};
MovieClip(root).EnginePTCs(_local3.Type, _local3);
} else {
if (_local3.Perm == false){
if (_local3.Type == "Secondary"){
} else {
if (EventArray.length > 0){
if (EventArray[0].Building){
MovieClip(root).BackgroundMC.UnitsMC.addChild(_local3);
} else {
if (EventArray[0].Allied){
AlliesMC.addChild(_local3);
} else {
EnemiesMC.addChild(_local3);
};
};
MovieClip(root).RadarMC.DotsMC.addChild(_local3.RadarDot);
_local3.gotoAndStop(EventArray[0].Type);
_local3.RadarDot.gotoAndStop(EventArray[0].Type);
_local3.Type = EventArray[0].Type;
_local3.Calc = CalcToggle;
CalcToggle--;
if (CalcToggle <= 0){
CalcToggle = CalcToggleMax;
};
_local3.Allied = EventArray[0].Allied;
if (EventArray[0].Offset){
_local3.x = ((EventArray[0].XPos + (Math.random() * 50)) - (Math.random() * 50));
_local3.y = ((EventArray[0].YPos + (Math.random() * 50)) - (Math.random() * 50));
} else {
_local3.x = EventArray[0].XPos;
_local3.y = EventArray[0].YPos;
};
setRadar(_local3);
_local3.Active = true;
MovieClip(root).UnitVars(EventArray[0].Type, _local3);
if (_local3.Type == "Secondary"){
Secondaries[Secondaries.length] = _local3;
_local3.Active = false;
_local3.visible = false;
};
EventArray[0].Num--;
if (EventArray[0].Num <= 0){
EventArray[0] = EventArray[(EventArray.length - 1)];
EventArray.pop();
};
};
};
};
};
_local13++;
_local3 = _local3.NextUnit;
};
};
}
public function setAlliedUnits(){
switch (AlliedUnitLevel){
case 1:
if (MovieClip(root).Ether >= 40){
MovieClip(root).Ether = (MovieClip(root).Ether - 40);
AActive[0] = "A4";
AActive[1] = "A5";
MovieClip(root).PauseMenuMC.UpgradesPanelMC.AlliedUnitsCostTxt.text = "Ether: 60";
AlliedUnitLevel++;
MovieClip(root).PauseMenuMC.UpgradesPanelMC.AlliedUnitsDisplayMC.gotoAndStop((AlliedUnitLevel + 1));
} else {
MovieClip(root).PauseMenuMC.UpgradesPanelMC.Popup.gotoAndPlay("FadeIn");
};
break;
case 2:
if (MovieClip(root).Ether >= 60){
MovieClip(root).Ether = (MovieClip(root).Ether - 60);
AActive[0] = "A5";
AActive[1] = "A6";
MovieClip(root).PauseMenuMC.UpgradesPanelMC.AlliedUnitsCostTxt.text = "Ether: 80";
AlliedUnitLevel++;
MovieClip(root).PauseMenuMC.UpgradesPanelMC.AlliedUnitsDisplayMC.gotoAndStop((AlliedUnitLevel + 1));
} else {
MovieClip(root).PauseMenuMC.UpgradesPanelMC.Popup.gotoAndPlay("FadeIn");
};
break;
case 3:
if (MovieClip(root).Ether >= 80){
MovieClip(root).Ether = (MovieClip(root).Ether - 80);
AActive[0] = "A6";
AActive[1] = "A7";
MovieClip(root).PauseMenuMC.UpgradesPanelMC.AlliedUnitsCostTxt.text = "Ether: 100";
AlliedUnitLevel++;
MovieClip(root).PauseMenuMC.UpgradesPanelMC.AlliedUnitsDisplayMC.gotoAndStop((AlliedUnitLevel + 1));
} else {
MovieClip(root).PauseMenuMC.UpgradesPanelMC.Popup.gotoAndPlay("FadeIn");
};
break;
case 4:
if (MovieClip(root).Ether >= 100){
MovieClip(root).Ether = (MovieClip(root).Ether - 100);
AActive[0] = "A7";
AActive[1] = "A8";
AlliedUnitLevel++;
MovieClip(root).PauseMenuMC.UpgradesPanelMC.AlliedUnitsDisplayMC.gotoAndStop((AlliedUnitLevel + 1));
MovieClip(root).PauseMenuMC.UpgradesPanelMC.AlliedUnitsBtn.enabled = false;
MovieClip(root).PauseMenuMC.UpgradesPanelMC.AlliedUnitsBtn.visible = false;
MovieClip(root).PauseMenuMC.UpgradesPanelMC.AlliedUnitsCostTxt.text = "N/A";
} else {
MovieClip(root).PauseMenuMC.UpgradesPanelMC.Popup.gotoAndPlay("FadeIn");
};
break;
};
}
public function newBuilding(_arg1:Number, _arg2:Number, _arg3:String, _arg4:Boolean){
var _local5:UnitEvent;
_local5 = (EventArray[EventArray.length] = new UnitEvent());
_local5.XPos = _arg1;
_local5.YPos = _arg2;
_local5.Type = _arg3;
_local5.Allied = _arg4;
_local5.Num = 1;
_local5.Offset = false;
_local5.Building = true;
}
public function newShot(_arg1:Number, _arg2:Number, _arg3:String, _arg4:Boolean, _arg5:Number){
var _local6:ShotEvent;
_local6 = (ShotArray[ShotArray.length] = new ShotEvent());
_local6.XPos = _arg1;
_local6.YPos = _arg2;
_local6.Allied = _arg4;
_local6.Rotation = _arg5;
_local6.Type = _arg3;
}
public function EUpgradeHandler(){
MovieClip(root).WarningsMC.gotoAndPlay("EnemyUpgrade");
switch (EActive[0]){
case "E3":
EActive[0] = "E4";
EActive[1] = "E5";
break;
case "E4":
EActive[0] = "E5";
EActive[1] = "E6";
break;
case "E5":
EActive[0] = "E6";
EActive[1] = "E7";
break;
case "E6":
EActive[0] = "E7";
EActive[1] = "E8";
break;
};
}
public function newUnit(_arg1:Number, _arg2:Number, _arg3:String, _arg4:Boolean, _arg5:int=1, _arg6:Boolean=false){
var _local7:UnitEvent;
_local7 = (EventArray[EventArray.length] = new UnitEvent());
_local7.XPos = _arg1;
_local7.YPos = _arg2;
_local7.Type = _arg3;
_local7.Allied = _arg4;
_local7.Num = _arg5;
_local7.Offset = _arg6;
_local7.Building = false;
}
public function setRadar(_arg1){
_arg1.RadarDot.x = (((_arg1.x - (Width * 0.5)) + this.x) / RadarZoom);
_arg1.RadarDot.y = (((_arg1.y - (Height * 0.5)) + this.y) / RadarZoom);
}
}
}//package
Section 111
//cs_audio (cs_audio)
package {
import flash.media.*;
public dynamic class cs_audio extends Sound {
}
}//package
Section 112
//CSSet1Image0 (CSSet1Image0)
package {
import flash.display.*;
public dynamic class CSSet1Image0 extends BitmapData {
public function CSSet1Image0(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 113
//CSSet1Image1 (CSSet1Image1)
package {
import flash.display.*;
public dynamic class CSSet1Image1 extends BitmapData {
public function CSSet1Image1(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 114
//CSSet1Image10 (CSSet1Image10)
package {
import flash.display.*;
public dynamic class CSSet1Image10 extends BitmapData {
public function CSSet1Image10(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 115
//CSSet1Image11 (CSSet1Image11)
package {
import flash.display.*;
public dynamic class CSSet1Image11 extends BitmapData {
public function CSSet1Image11(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 116
//CSSet1Image12 (CSSet1Image12)
package {
import flash.display.*;
public dynamic class CSSet1Image12 extends BitmapData {
public function CSSet1Image12(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 117
//CSSet1Image13 (CSSet1Image13)
package {
import flash.display.*;
public dynamic class CSSet1Image13 extends BitmapData {
public function CSSet1Image13(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 118
//CSSet1Image14 (CSSet1Image14)
package {
import flash.display.*;
public dynamic class CSSet1Image14 extends BitmapData {
public function CSSet1Image14(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 119
//CSSet1Image15 (CSSet1Image15)
package {
import flash.display.*;
public dynamic class CSSet1Image15 extends BitmapData {
public function CSSet1Image15(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 120
//CSSet1Image16 (CSSet1Image16)
package {
import flash.display.*;
public dynamic class CSSet1Image16 extends BitmapData {
public function CSSet1Image16(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 121
//CSSet1Image17 (CSSet1Image17)
package {
import flash.display.*;
public dynamic class CSSet1Image17 extends BitmapData {
public function CSSet1Image17(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 122
//CSSet1Image18 (CSSet1Image18)
package {
import flash.display.*;
public dynamic class CSSet1Image18 extends BitmapData {
public function CSSet1Image18(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 123
//CSSet1Image19 (CSSet1Image19)
package {
import flash.display.*;
public dynamic class CSSet1Image19 extends BitmapData {
public function CSSet1Image19(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 124
//CSSet1Image2 (CSSet1Image2)
package {
import flash.display.*;
public dynamic class CSSet1Image2 extends BitmapData {
public function CSSet1Image2(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 125
//CSSet1Image3 (CSSet1Image3)
package {
import flash.display.*;
public dynamic class CSSet1Image3 extends BitmapData {
public function CSSet1Image3(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 126
//CSSet1Image4 (CSSet1Image4)
package {
import flash.display.*;
public dynamic class CSSet1Image4 extends BitmapData {
public function CSSet1Image4(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 127
//CSSet1Image5 (CSSet1Image5)
package {
import flash.display.*;
public dynamic class CSSet1Image5 extends BitmapData {
public function CSSet1Image5(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 128
//CSSet1Image6 (CSSet1Image6)
package {
import flash.display.*;
public dynamic class CSSet1Image6 extends BitmapData {
public function CSSet1Image6(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 129
//CSSet1Image7 (CSSet1Image7)
package {
import flash.display.*;
public dynamic class CSSet1Image7 extends BitmapData {
public function CSSet1Image7(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 130
//CSSet1Image8 (CSSet1Image8)
package {
import flash.display.*;
public dynamic class CSSet1Image8 extends BitmapData {
public function CSSet1Image8(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 131
//CSSet1Image9 (CSSet1Image9)
package {
import flash.display.*;
public dynamic class CSSet1Image9 extends BitmapData {
public function CSSet1Image9(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 132
//Dot (Dot)
package {
import flash.display.*;
import flash.events.*;
import flash.geom.*;
import flash.utils.*;
import flash.media.*;
import flash.text.*;
import flash.ui.*;
import flash.filters.*;
import flash.net.*;
import flash.system.*;
import flash.accessibility.*;
import flash.errors.*;
public dynamic class Dot extends MovieClip {
public function Dot(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package
Section 133
//EpicBoom (EpicBoom)
package {
import flash.media.*;
public dynamic class EpicBoom extends Sound {
}
}//package
Section 134
//GameMusic (GameMusic)
package {
import flash.media.*;
public dynamic class GameMusic extends Sound {
}
}//package
Section 135
//Hero (Hero)
package {
import flash.display.*;
import flash.events.*;
import flash.utils.*;
public class Hero extends MovieClip {
public var ShotSpace:int;// = 5
public var RebirthCounter:Timer;
public var SmartTime:int;// = 0
public var Radians:Number;
public var ShieldType:int;// = 1
public var Attack:Number;// = 1.75
public var Moving:Boolean;// = false
public var Thrust:Number;// = 2
public var ASpeed:Number;// = 0
public var Repulsion:Boolean;// = false
public var RebirthDelay:int;// = 10
public var Angle:Number;// = 0
public var EngineType:int;// = 1
public var XSpeed:Number;// = 0
public var BodyMC:MovieClip;
public var SmartSpace:int;// = 15
public var ShieldMC:MovieClip;
public var KeyLeft:Boolean;// = false
public var Degrees:Number;
public var Friction:Number;// = 0.95
public var Aim:Number;// = 0
public var Active:Boolean;// = true
public var ShotTime:int;// = 0
public var TriShot:Boolean;// = false
public var KeyRight:Boolean;// = false
public var KeyUp:Boolean;// = false
public var NextUnit:Unit;
public var Secondary:Boolean;// = false
public var IntervalCounter:Timer;
public var Type:String;// = "Hero"
public var MaxSpeed:Number;// = 14
public var Delay:Number;// = 3
public var YSpeed:Number;// = 0
public var MSDown:Boolean;// = false
public var CannonMC:MovieClip;
public var Revive:Number;// = 0.15
public var EngineMC:MovieClip;
public var DelayCount:Number;// = 0
public var KeyDown:Boolean;// = false
public var Shooting:Boolean;// = false
public var Shield:Number;// = 7
public var TriShotTime:Number;// = 0
public var NextY:Number;// = 0
public var Allied:Boolean;// = true
public var Smart:Boolean;// = false
public var NextX:Number;// = 0
public var Damage:Number;// = 0
public var IntervalCounter2:Timer;
public var Priority:int;// = 0
public var SecondaryMC:MovieClip;
public var CannonType:int;// = 1
public function Hero():void{
Thrust = 2;
XSpeed = 0;
YSpeed = 0;
ASpeed = 0;
NextX = 0;
NextY = 0;
Angle = 0;
Moving = false;
MaxSpeed = 14;
Friction = 0.95;
Radians = (Math.PI / 180);
Degrees = (180 / Math.PI);
Type = "Hero";
Active = true;
Priority = 0;
Allied = true;
Aim = 0;
Shooting = false;
ShotSpace = 5;
ShotTime = 0;
Attack = 1.75;
Shield = 7;
Damage = 0;
Revive = 0.15;
TriShot = false;
TriShotTime = 0;
Repulsion = false;
Secondary = false;
Smart = false;
SmartSpace = 15;
SmartTime = 0;
Delay = 3;
DelayCount = 0;
EngineType = 1;
CannonType = 1;
ShieldType = 1;
KeyLeft = false;
KeyUp = false;
KeyRight = false;
KeyDown = false;
MSDown = false;
RebirthDelay = 10;
RebirthCounter = new Timer(1000, 0);
IntervalCounter = new Timer(5, 40);
IntervalCounter2 = new Timer(50, 15);
super();
CannonMC.TriShotMC.visible = false;
CannonMC.SmartMC.visible = false;
SecondaryMC.visible = false;
stage.addEventListener(MouseEvent.MOUSE_DOWN, StartShoot);
stage.addEventListener(MouseEvent.MOUSE_UP, StopShoot);
stage.addEventListener(KeyboardEvent.KEY_DOWN, CheckKeysDown);
stage.addEventListener(KeyboardEvent.KEY_UP, CheckKeysUp);
IntervalCounter.addEventListener(TimerEvent.TIMER, completeHandler);
IntervalCounter2.addEventListener(TimerEvent.TIMER, completeHandler2);
RebirthCounter.addEventListener(TimerEvent.TIMER, Rebirth);
}
public function setEngineHelper():void{
EngineType++;
EngineMC.gotoAndStop(EngineType);
MovieClip(root).PauseMenuMC.UpgradesPanelMC.EngineDisplayMC.gotoAndStop((EngineType + 1));
}
public function KillEvents():void{
stage.removeEventListener(MouseEvent.MOUSE_DOWN, StartShoot);
stage.removeEventListener(MouseEvent.MOUSE_UP, StopShoot);
stage.removeEventListener(KeyboardEvent.KEY_DOWN, CheckKeysDown);
stage.removeEventListener(KeyboardEvent.KEY_UP, CheckKeysUp);
IntervalCounter.removeEventListener(TimerEvent.TIMER, completeHandler);
IntervalCounter2.removeEventListener(TimerEvent.TIMER, completeHandler2);
RebirthCounter.removeEventListener(TimerEvent.TIMER, Rebirth);
}
public function Rebirth(_arg1:Event):void{
var _local2:int;
if ((((RebirthCounter.currentCount == RebirthDelay)) && ((MovieClip(root).EndGame == false)))){
MovieClip(root).RestartVar.play();
if (Secondary){
_local2 = 0;
while (_local2 < 4) {
MovieClip(root).CamMC.Secondaries[_local2].visible = true;
MovieClip(root).CamMC.Secondaries[_local2].Active = true;
_local2++;
};
};
this.x = 0;
this.y = 0;
MovieClip(root).CamMC.x = (this.x + 350);
MovieClip(root).CamMC.y = (this.y + 250);
MovieClip(root).CamMC.ScreenShake = 20;
Damage = 0;
MovieClip(root).ParticleSystemMC.newEvent(this.x, this.y, -1, 0, 1000, 20, 4278242559, 30, 20);
this.visible = true;
Active = true;
RebirthCounter.reset();
IntervalCounter.reset();
IntervalCounter2.reset();
MovieClip(root).RebirthTxt.visible = false;
} else {
MovieClip(root).RebirthTxt.text = (("Rebuilding Ship\r" + (RebirthDelay - RebirthCounter.currentCount)) + "\r(Pause Disabled)");
};
}
public function setShield():void{
switch (ShieldType){
case 1:
if (MovieClip(root).Ether >= 20){
MovieClip(root).Ether = (MovieClip(root).Ether - 20);
Shield = (Shield + 1.25);
Revive = 0.16;
setShieldHelper();
MovieClip(root).PauseMenuMC.UpgradesPanelMC.ShieldCostTxt.text = "Ether: 40";
} else {
MovieClip(root).PauseMenuMC.UpgradesPanelMC.Popup.gotoAndPlay("FadeIn");
};
break;
case 2:
if (MovieClip(root).Ether >= 40){
MovieClip(root).Ether = (MovieClip(root).Ether - 40);
Shield = (Shield + 1.25);
Revive = 0.17;
setShieldHelper();
MovieClip(root).PauseMenuMC.UpgradesPanelMC.ShieldCostTxt.text = "Ether: 70";
} else {
MovieClip(root).PauseMenuMC.UpgradesPanelMC.Popup.gotoAndPlay("FadeIn");
};
break;
case 3:
if (MovieClip(root).Ether >= 70){
MovieClip(root).Ether = (MovieClip(root).Ether - 70);
Shield = (Shield + 1.25);
Revive = 0.18;
setShieldHelper();
MovieClip(root).PauseMenuMC.UpgradesPanelMC.ShieldCostTxt.text = "Ether: 100";
} else {
MovieClip(root).PauseMenuMC.UpgradesPanelMC.Popup.gotoAndPlay("FadeIn");
};
break;
case 4:
if (MovieClip(root).Ether >= 100){
MovieClip(root).Ether = (MovieClip(root).Ether - 100);
Shield = (Shield + 1.25);
Revive = 0.2;
setShieldHelper();
MovieClip(root).PauseMenuMC.UpgradesPanelMC.ShieldBtn.enabled = false;
MovieClip(root).PauseMenuMC.UpgradesPanelMC.ShieldBtn.visible = false;
MovieClip(root).PauseMenuMC.UpgradesPanelMC.ShieldCostTxt.text = "N/A";
} else {
MovieClip(root).PauseMenuMC.UpgradesPanelMC.Popup.gotoAndPlay("FadeIn");
};
break;
};
}
public function Death():void{
var _local1:int;
if (MovieClip(root).EndGame == false){
if (Secondary){
_local1 = 0;
while (_local1 < 4) {
MovieClip(root).CamMC.Secondaries[_local1].visible = false;
MovieClip(root).CamMC.Secondaries[_local1].Active = false;
_local1++;
};
};
MovieClip(root).CamMC.newShot(this.x, this.y, "Death", false, 0);
MovieClip(root).CamMC.ScreenShake = (MovieClip(root).CamMC.ScreenShake + 6);
MovieClip(root).ParticleSystemMC.newEvent(this.x, this.y, -1, 0, 250, 5, 4294967295, 40, 40);
IntervalCounter.start();
IntervalCounter2.start();
RebirthCounter.start();
this.visible = false;
Active = false;
XSpeed = 0;
YSpeed = 0;
ASpeed = 0;
MovieClip(root).EpicBoomVar.play();
MovieClip(root).RebirthTxt.visible = true;
MovieClip(root).RebirthTxt.text = (("Rebuilding Ship\r" + (RebirthDelay - RebirthCounter.currentCount)) + "\r(Pause Disabled)");
};
}
public function setCannonHelper():void{
CannonType++;
CannonMC.gotoAndStop(CannonType);
MovieClip(root).PauseMenuMC.UpgradesPanelMC.CannonDisplayMC.gotoAndStop((CannonType + 1));
}
private function completeHandler2(_arg1:Event):void{
var _local2:Number;
if (MovieClip(root).EndGame == false){
_local2 = (Math.random() * 360);
MovieClip(root).ParticleSystemMC.newEvent(this.x, this.y, _local2, 8, 50, 50, 4278255615, 0, 0);
MovieClip(root).ParticleSystemMC.newEvent(this.x, this.y, _local2, 2, 50, 50, 4294967295, 0, 0);
MovieClip(root).ParticleSystemMC.newEvent(this.x, this.y, -1, 0, 50, 10, 4294967295, 40, 40);
};
}
private function CheckKeysUp(_arg1:KeyboardEvent):void{
switch (_arg1.keyCode){
case 37:
case 65:
KeyLeft = false;
break;
case 38:
case 87:
KeyUp = false;
break;
case 39:
case 68:
KeyRight = false;
break;
case 40:
case 83:
KeyDown = false;
break;
};
}
public function HeroMain():void{
var _local1:Number;
var _local2:int;
var _local3:int;
if (MovieClip(root).Paused == false){
if (Active){
YSpeed = (YSpeed * Friction);
XSpeed = (XSpeed * Friction);
ASpeed = (ASpeed * Friction);
Moving = false;
if (((KeyUp) && (!(KeyDown)))){
if (YSpeed > -(MaxSpeed)){
YSpeed = (YSpeed - Thrust);
};
Moving = true;
};
if (((KeyDown) && (!(KeyUp)))){
if (YSpeed < MaxSpeed){
YSpeed = (YSpeed + Thrust);
};
Moving = true;
};
if (((KeyLeft) && (!(KeyRight)))){
if (XSpeed > -(MaxSpeed)){
XSpeed = (XSpeed - Thrust);
};
Moving = true;
};
if (((KeyRight) && (!(KeyLeft)))){
if (XSpeed < MaxSpeed){
XSpeed = (XSpeed + Thrust);
};
Moving = true;
};
if (((((((KeyRight) || (KeyLeft))) || (KeyUp))) || (KeyDown))){
if (ASpeed < MaxSpeed){
ASpeed = (ASpeed + Thrust);
};
};
Aim = Math.atan2(mouseY, mouseX);
CannonMC.rotation = (Aim * Degrees);
Angle = Math.atan2(YSpeed, XSpeed);
if ((((ASpeed > 1)) || ((ASpeed < -1)))){
this.x = (this.x + (Math.cos(Angle) * ASpeed));
this.y = (this.y + (Math.sin(Angle) * ASpeed));
};
Angle = ((Angle * Degrees) + 180);
if (Moving){
EngineMC.rotation = Angle;
};
if (Moving){
switch (EngineType){
case 1:
MovieClip(root).ParticleSystemMC.newEvent(this.x, this.y, Angle, 10, 5, 5, 4278255615, 2, 2);
MovieClip(root).ParticleSystemMC.newEvent(this.x, this.y, Angle, 30, 7, 5, 4278225151, 2, 2);
break;
case 2:
MovieClip(root).ParticleSystemMC.newEvent(this.x, this.y, Angle, 30, 5, 5, 4294967040, 2, 2);
MovieClip(root).ParticleSystemMC.newEvent(this.x, this.y, Angle, 70, 7, 5, 4294901760, 5, 5);
break;
case 3:
MovieClip(root).ParticleSystemMC.newEvent(this.x, this.y, Angle, 50, 5, 5, 4294967040, 8, 8);
MovieClip(root).ParticleSystemMC.newEvent(this.x, this.y, Angle, 100, 7, 5, 4278255360, 15, 15);
break;
case 4:
MovieClip(root).ParticleSystemMC.newEvent(this.x, this.y, Angle, 15, 5, 5, 4293787903, 2, 2);
MovieClip(root).ParticleSystemMC.newEvent(this.x, this.y, Angle, 40, 7, 5, 4288217343, 2, 2);
break;
case 5:
MovieClip(root).ParticleSystemMC.newEvent(this.x, this.y, Angle, 15, 3, 5, 4294967295, 2, 2);
MovieClip(root).ParticleSystemMC.newEvent(this.x, this.y, Angle, 40, 10, 5, 4288256409, 2, 2);
break;
};
};
if (Damage > Revive){
Damage = (Damage - Revive);
} else {
Damage = 0;
};
if (DelayCount <= 0){
_local2 = 0;
while (_local2 < MovieClip(root).CamMC.EActive.length) {
if (MovieClip(this.parent).getChildByName((MovieClip(root).CamMC.EActive[_local2] + "ShotsMC")).hitTestPoint((this.x + MovieClip(this.parent).x), (this.y + MovieClip(this.parent).y), true)){
MovieClip(root).CamMC.ScreenShake = (MovieClip(root).CamMC.ScreenShake + 3);
DelayCount = Delay;
ShieldMC.Gfx.gotoAndPlay("Start");
MovieClip(root).Hit(MovieClip(root).CamMC.EActive[_local2], this);
if (Repulsion){
_local3 = 0;
while (_local3 < 3) {
MovieClip(root).CamMC.newShot(this.x, this.y, "Secondary", true, (Math.random() * 359));
_local3++;
};
};
};
_local2++;
};
} else {
DelayCount--;
};
if (Damage > Shield){
Death();
};
_local1 = (1 - (Damage / Shield));
if (_local1 > 0){
MovieClip(root).ShieldBarMC.scaleX = _local1;
} else {
MovieClip(root).ShieldBarMC.scaleX = 0;
};
if (Shooting){
if (Smart){
if (SmartTime <= 0){
MovieClip(root).CamMC.newShot((this.x + (Math.cos((Aim + 1.5)) * 20)), (this.y + (Math.sin((Aim + 1.5)) * 20)), "Smart", true, CannonMC.rotation);
MovieClip(root).CamMC.newShot((this.x + (Math.cos((Aim - 1.5)) * 20)), (this.y + (Math.sin((Aim - 1.5)) * 20)), "Smart", true, CannonMC.rotation);
SmartTime = SmartSpace;
} else {
SmartTime--;
};
};
if (ShotTime <= 0){
MovieClip(root).CamMC.newShot(this.x, this.y, "Hero", true, CannonMC.rotation);
if (Math.random() < 0.33){
MovieClip(root).Lazer1Var.play();
} else {
if (Math.random() < 0.33){
MovieClip(root).Lazer2Var.play();
} else {
MovieClip(root).Lazer3Var.play();
};
};
if (((TriShot) && ((TriShotTime >= 1)))){
MovieClip(root).CamMC.newShot(this.x, this.y, "Hero", true, (CannonMC.rotation + 15));
MovieClip(root).CamMC.newShot(this.x, this.y, "Hero", true, (CannonMC.rotation - 15));
TriShotTime = 0;
} else {
TriShotTime++;
};
ShotTime = ShotSpace;
} else {
ShotTime--;
};
};
};
};
}
public function StartShoot(_arg1:MouseEvent):void{
Shooting = true;
if (MovieClip(root).Paused == false){
MSDown = true;
};
}
public function StopShoot(_arg1:MouseEvent):void{
Shooting = false;
MSDown = false;
}
public function setEngine():void{
switch (EngineType){
case 1:
if (MovieClip(root).Ether >= 20){
MovieClip(root).Ether = (MovieClip(root).Ether - 20);
MaxSpeed = 15;
setEngineHelper();
MovieClip(root).PauseMenuMC.UpgradesPanelMC.EngineCostTxt.text = "Ether: 40";
} else {
MovieClip(root).PauseMenuMC.UpgradesPanelMC.Popup.gotoAndPlay("FadeIn");
};
break;
case 2:
if (MovieClip(root).Ether >= 40){
MovieClip(root).Ether = (MovieClip(root).Ether - 40);
MaxSpeed = 16;
setEngineHelper();
MovieClip(root).PauseMenuMC.UpgradesPanelMC.EngineCostTxt.text = "Ether: 70";
} else {
MovieClip(root).PauseMenuMC.UpgradesPanelMC.Popup.gotoAndPlay("FadeIn");
};
break;
case 3:
if (MovieClip(root).Ether >= 70){
MovieClip(root).Ether = (MovieClip(root).Ether - 70);
MaxSpeed = 17;
setEngineHelper();
MovieClip(root).PauseMenuMC.UpgradesPanelMC.EngineCostTxt.text = "Ether: 100";
} else {
MovieClip(root).PauseMenuMC.UpgradesPanelMC.Popup.gotoAndPlay("FadeIn");
};
break;
case 4:
if (MovieClip(root).Ether >= 100){
MovieClip(root).Ether = (MovieClip(root).Ether - 100);
MaxSpeed = 18;
setEngineHelper();
MovieClip(root).PauseMenuMC.UpgradesPanelMC.EngineBtn.enabled = false;
MovieClip(root).PauseMenuMC.UpgradesPanelMC.EngineBtn.visible = false;
MovieClip(root).PauseMenuMC.UpgradesPanelMC.EngineCostTxt.text = "N/A";
} else {
MovieClip(root).PauseMenuMC.UpgradesPanelMC.Popup.gotoAndPlay("FadeIn");
};
break;
};
}
public function setPowerUp(_arg1:String):void{
var _local2:int;
switch (_arg1){
case "TriShot":
if (MovieClip(root).Ether >= 120){
MovieClip(root).Ether = (MovieClip(root).Ether - 120);
CannonMC.TriShotMC.visible = true;
TriShot = true;
MovieClip(root).PauseMenuMC.UpgradesPanelMC.TripleShotDisplayMC.gotoAndStop(3);
MovieClip(root).PauseMenuMC.UpgradesPanelMC.TripleShotBtn.enabled = false;
MovieClip(root).PauseMenuMC.UpgradesPanelMC.TripleShotBtn.visible = false;
MovieClip(root).PauseMenuMC.UpgradesPanelMC.TripleShotCostTxt.text = "N/A";
} else {
MovieClip(root).PauseMenuMC.UpgradesPanelMC.Popup.gotoAndPlay("FadeIn");
};
break;
case "Secondary":
if (MovieClip(root).Ether >= 120){
MovieClip(root).Ether = (MovieClip(root).Ether - 120);
SecondaryMC.visible = true;
Secondary = true;
MovieClip(root).PauseMenuMC.UpgradesPanelMC.SecondaryCannonsDisplayMC.gotoAndStop(3);
MovieClip(root).PauseMenuMC.UpgradesPanelMC.SecondaryCannonsBtn.enabled = false;
MovieClip(root).PauseMenuMC.UpgradesPanelMC.SecondaryCannonsBtn.visible = false;
MovieClip(root).PauseMenuMC.UpgradesPanelMC.SecondaryCostTxt.text = "N/A";
_local2 = 0;
while (_local2 < 4) {
MovieClip(root).CamMC.Secondaries[_local2].visible = true;
MovieClip(root).CamMC.Secondaries[_local2].Active = true;
_local2++;
};
} else {
MovieClip(root).PauseMenuMC.UpgradesPanelMC.Popup.gotoAndPlay("FadeIn");
};
break;
case "Smart":
if (MovieClip(root).Ether >= 120){
MovieClip(root).Ether = (MovieClip(root).Ether - 120);
CannonMC.SmartMC.visible = true;
Smart = true;
MovieClip(root).PauseMenuMC.UpgradesPanelMC.SmartMissilesDisplayMC.gotoAndStop(3);
MovieClip(root).PauseMenuMC.UpgradesPanelMC.SmartMissilesBtn.enabled = false;
MovieClip(root).PauseMenuMC.UpgradesPanelMC.SmartMissilesBtn.visible = false;
MovieClip(root).PauseMenuMC.UpgradesPanelMC.SmartCostTxt.text = "N/A";
} else {
MovieClip(root).PauseMenuMC.UpgradesPanelMC.Popup.gotoAndPlay("FadeIn");
};
break;
case "Repulsion":
if (MovieClip(root).Ether >= 120){
MovieClip(root).Ether = (MovieClip(root).Ether - 120);
Repulsion = true;
MovieClip(root).PauseMenuMC.UpgradesPanelMC.RepulsionShieldDisplayMC.gotoAndStop(3);
MovieClip(root).PauseMenuMC.UpgradesPanelMC.RepulsionShieldBtn.enabled = false;
MovieClip(root).PauseMenuMC.UpgradesPanelMC.RepulsionShieldBtn.visible = false;
MovieClip(root).PauseMenuMC.UpgradesPanelMC.RepulsionCostTxt.text = "N/A";
} else {
MovieClip(root).PauseMenuMC.UpgradesPanelMC.Popup.gotoAndPlay("FadeIn");
};
break;
};
}
private function CheckKeysDown(_arg1:KeyboardEvent):void{
switch (_arg1.keyCode){
case 37:
case 65:
KeyLeft = true;
break;
case 38:
case 87:
KeyUp = true;
break;
case 39:
case 68:
KeyRight = true;
break;
case 40:
case 83:
KeyDown = true;
break;
case 77:
MovieClip(root).Mute();
break;
case 32:
MovieClip(root).Pause();
break;
};
}
private function completeHandler(_arg1:Event):void{
var _local2:Number;
var _local3:Number;
if (MovieClip(root).EndGame == false){
MovieClip(root).CamMC.ScreenShake = (MovieClip(root).CamMC.ScreenShake + 6);
_local2 = ((this.x + (Math.random() * 400)) - (Math.random() * 400));
_local3 = ((this.y + (Math.random() * 400)) - (Math.random() * 400));
if (Math.random() < 0.2){
MovieClip(root).Pop1Var.play();
} else {
if (Math.random() < 0.2){
MovieClip(root).Pop2Var.play();
} else {
if (Math.random() < 0.2){
MovieClip(root).Pop3Var.play();
} else {
if (Math.random() < 0.2){
MovieClip(root).BlamVar.play();
};
};
};
};
if (Math.random() < 0.5){
MovieClip(root).ParticleSystemMC.newEvent(_local2, _local3, -1, 0, 100, 10, 4294901760, 5, 5);
MovieClip(root).ParticleSystemMC.newEvent(_local2, _local3, -1, 0, 100, 5, 4294967040, 5, 5);
} else {
MovieClip(root).ParticleSystemMC.newEvent(_local2, _local3, -1, 0, 50, 3, 4278255360, 0, 0);
MovieClip(root).ParticleSystemMC.newEvent(_local2, _local3, -1, 0, 50, 2, 4278255615, 0, 0);
};
};
}
public function setShieldHelper():void{
ShieldType++;
ShieldMC.gotoAndStop(ShieldType);
MovieClip(root).PauseMenuMC.UpgradesPanelMC.ShieldDisplayMC.gotoAndStop((ShieldType + 1));
}
public function setCannon():void{
switch (CannonType){
case 1:
if (MovieClip(root).Ether >= 20){
MovieClip(root).Ether = (MovieClip(root).Ether - 20);
Attack = 2;
setCannonHelper();
MovieClip(root).PauseMenuMC.UpgradesPanelMC.CannonCostTxt.text = "Ether: 40";
} else {
MovieClip(root).PauseMenuMC.UpgradesPanelMC.Popup.gotoAndPlay("FadeIn");
};
break;
case 2:
if (MovieClip(root).Ether >= 40){
MovieClip(root).Ether = (MovieClip(root).Ether - 40);
Attack = 2.25;
setCannonHelper();
MovieClip(root).PauseMenuMC.UpgradesPanelMC.CannonCostTxt.text = "Ether: 70";
} else {
MovieClip(root).PauseMenuMC.UpgradesPanelMC.Popup.gotoAndPlay("FadeIn");
};
break;
case 3:
if (MovieClip(root).Ether >= 70){
MovieClip(root).Ether = (MovieClip(root).Ether - 70);
Attack = 2.5;
setCannonHelper();
MovieClip(root).PauseMenuMC.UpgradesPanelMC.CannonCostTxt.text = "Ether: 100";
} else {
MovieClip(root).PauseMenuMC.UpgradesPanelMC.Popup.gotoAndPlay("FadeIn");
};
break;
case 4:
if (MovieClip(root).Ether >= 100){
MovieClip(root).Ether = (MovieClip(root).Ether - 100);
Attack = 2.75;
setCannonHelper();
MovieClip(root).PauseMenuMC.UpgradesPanelMC.CannonBtn.enabled = false;
MovieClip(root).PauseMenuMC.UpgradesPanelMC.CannonBtn.visible = false;
MovieClip(root).PauseMenuMC.UpgradesPanelMC.CannonCostTxt.text = "N/A";
} else {
MovieClip(root).PauseMenuMC.UpgradesPanelMC.Popup.gotoAndPlay("FadeIn");
};
break;
};
}
}
}//package
Section 136
//Lazer1 (Lazer1)
package {
import flash.media.*;
public dynamic class Lazer1 extends Sound {
}
}//package
Section 137
//Lazer2 (Lazer2)
package {
import flash.media.*;
public dynamic class Lazer2 extends Sound {
}
}//package
Section 138
//Lazer3 (Lazer3)
package {
import flash.media.*;
public dynamic class Lazer3 extends Sound {
}
}//package
Section 139
//LogoParticle (LogoParticle)
package {
import flash.display.*;
import flash.events.*;
import flash.geom.*;
import flash.utils.*;
import flash.media.*;
import flash.text.*;
import flash.ui.*;
import flash.filters.*;
import flash.net.*;
import flash.system.*;
import flash.accessibility.*;
import flash.errors.*;
public dynamic class LogoParticle extends MovieClip {
public function LogoParticle(){
addFrameScript(80, frame81);
}
function frame81(){
stop();
}
}
}//package
Section 140
//LogoSound (LogoSound)
package {
import flash.media.*;
public dynamic class LogoSound extends Sound {
}
}//package
Section 141
//LongLazer (LongLazer)
package {
import flash.media.*;
public dynamic class LongLazer extends Sound {
}
}//package
Section 142
//Main (Main)
package {
import flash.display.*;
import flash.events.*;
import flash.utils.*;
import flash.media.*;
import flash.text.*;
import com.candystand.Stinger.*;
import flash.ui.*;
import flash.net.*;
public dynamic class Main extends MovieClip {
public var TutDone:Boolean;// = false
public var Playing:Boolean;// = false
public var PalyBtn:SimpleButton;
public var NextBtn:SimpleButton;
public var Radians:Number;
public var FixCounter:Timer;
public var WarningsMC:MovieClip;
public var PlayBtn:SimpleButton;
public var MaxTimeBonus:int;// = 36000
public var MoreGamesBtn:SimpleButton;
public var SpawnCount:int;// = 0
public var RedDead:Number;// = 0
public var RebirthTxt:TextField;
public var Score:int;// = 0
public var BackdropMC:MovieClip;
public var Animes:Array;
public var ScoreTxt:TextField;
public var PauseMenuMC:MovieClip;
public var EtherTxt:TextField;
public var RestartVar;
public var ParticleSystemMC:ParticleSystem;
public var YellowCount:int;// = 0
public var Pop1Var;
public var ShieldBarMC:MovieClip;
public var BackdropOn:Boolean;// = false
public var GameMusicVar;
public var RadarMC:MovieClip;
public var RedCount:int;// = 0
public var Degrees:Number;
public var VolControl:SoundTransform;
public var BlamVar;
public var TimeBonus:int;// = 0
public var stinger3D:Stinger3D;
public var Height:int;
public var Pop2Var;
public var Paused:Boolean;// = true
public var Lazer1Var;
public var EpicBoomVar;
public var Fader:MovieClip;
public var BackgroundMC:MovieClip;
public var HardMode:Boolean;// = false
public var EndGame:Boolean;// = false
public var MenuMusicVar;
public var LongLazerVar;
public var Cursor:MovieClip;
public var PlayHardBtn:SimpleButton;
public var CamMC:Cam;
public var Lazer2Var;
public var playButton:MovieClip;
public var StarsMC:MovieClip;
public var TutorialMC:MovieClip;
public var GameOverPanel:MovieClip;
public var Width:int;
public var StartingEther:int;// = 0
public var Pop3Var;
public var VictoryCine:MovieClip;
public var Contexual:ContextMenu;
public var CSBtn:SimpleButton;
public var BamfVar;
public var Lazer3Var;
public var Ether:int;
public function Main(){
Radians = (Math.PI / 180);
Degrees = (180 / Math.PI);
Paused = true;
Width = stage.stageWidth;
Height = stage.stageHeight;
Animes = new Array();
BackdropOn = false;
YellowCount = 0;
SpawnCount = 0;
RedCount = 0;
StartingEther = 0;
Ether = StartingEther;
TutDone = false;
RedDead = 0;
EndGame = false;
Score = 0;
TimeBonus = 0;
MaxTimeBonus = 36000;
Playing = false;
HardMode = false;
FixCounter = new Timer(33);
VolControl = new SoundTransform();
super();
addFrameScript(1, frame2, 2, frame3, 3, frame4, 4, frame5, 5, frame6, 8, frame9, 9, frame10, 11, frame12, 12, frame13, 13, frame14);
}
public function GameOver(){
PauseMenuMC.x = -2000;
PauseMenuMC.visible = false;
EndGame = true;
CamMC.HeroMC.Active = false;
CamMC.HeroMC.x = 0;
CamMC.HeroMC.y = 0;
CamMC.HeroMC.visible = false;
CamMC.HeroMC.XSpeed = 0;
CamMC.HeroMC.YSpeed = 0;
CamMC.HeroMC.ASpeed = 0;
RebirthTxt.visible = false;
Cursor.visible = false;
GameOverPanel.x = 375;
}
public function Mute(){
if (VolControl.volume != 0){
VolControl.volume = 0;
SoundMixer.soundTransform = VolControl;
} else {
VolControl.volume = 1;
SoundMixer.soundTransform = VolControl;
};
}
function frame10(){
NextBtn.addEventListener(MouseEvent.MOUSE_UP, function (_arg1:MouseEvent):void{
nextFrame();
});
stop();
}
function frame14(){
stop();
}
function frame12(){
PalyBtn.addEventListener(MouseEvent.MOUSE_UP, function (_arg1:MouseEvent):void{
nextFrame();
});
stop();
}
function frame3(){
MochiBot.track(this, "f611e3b8");
}
function frame4(){
MochiBot.track(this, "4d8b9e08");
}
function frame6(){
Contexual = new ContextMenu();
Contexual.hideBuiltInItems();
this.contextMenu = Contexual;
}
public function SetAurora(){
if (BackdropOn){
BackdropMC.gotoAndStop(1);
BackdropOn = false;
} else {
BackdropMC.gotoAndStop(2);
BackdropOn = true;
};
}
function frame13(){
SoundMixer.stopAll();
GameMusicVar.play(0, 99999);
this.Begin();
stop();
}
function frame9(){
SoundMixer.stopAll();
GameMusicVar = new GameMusic();
MenuMusicVar = new MenuMusic();
EpicBoomVar = new EpicBoom();
BlamVar = new Blam();
Pop1Var = new Pop1();
Pop2Var = new Pop2();
Pop3Var = new Pop3();
Lazer1Var = new Lazer1();
Lazer2Var = new Lazer2();
Lazer3Var = new Lazer3();
LongLazerVar = new LongLazer();
BamfVar = new Bamf();
RestartVar = new Restart();
MenuMusicVar.play(0, 99999);
PlayBtn.addEventListener(MouseEvent.MOUSE_UP, function (_arg1:MouseEvent):void{
nextFrame();
});
PlayHardBtn.addEventListener(MouseEvent.MOUSE_UP, function (_arg1:MouseEvent):void{
navigateToURL(new URLRequest("http://www.candystand.com/play.do?id=18347&vgid=18347"), "_blank");
});
MoreGamesBtn.addEventListener(MouseEvent.MOUSE_UP, function (_arg1:MouseEvent):void{
navigateToURL(new URLRequest("http://www.candystand.com/index.do?vgid=18347"), "_blank");
});
CSBtn.addEventListener(MouseEvent.MOUSE_UP, function (_arg1:MouseEvent):void{
navigateToURL(new URLRequest("http://www.candystand.com/index.do?vgid=18347"), "_blank");
});
stop();
}
function frame5(){
MochiAd.showPreGameAd({clip:root, id:"936969931405c30d", res:"750x550", background:0, color:0xFFFF, outline:39423, no_bg:true});
}
function frame2(){
}
public function Begin(){
FixCounter.start();
Playing = true;
Ether = StartingEther;
YellowCount = 0;
RedCount = 0;
SpawnCount = 0;
TimeBonus = MaxTimeBonus;
Score = 0;
RebirthTxt.visible = false;
Paused = false;
PauseMenuMC.x = -2000;
PauseMenuMC.visible = false;
this.addEventListener(Event.ENTER_FRAME, MainMain);
if (HardMode){
TimeBonus = (TimeBonus + 5000);
CamMC.EUpgradeInterval = 4000;
CamMC.EUpgradeMultiplier = 1.2;
CamMC.AllySpawn = 85;
CamMC.HeroMC.Shield = 5;
CamMC.ScoreBase = 10;
};
}
public function EnginePTCs(_arg1:String, _arg2:MovieClip){
switch (_arg1){
case "A3":
ParticleSystemMC.newEvent(_arg2.x, _arg2.y, ((_arg2.MoveAngle * Degrees) + 180), 0, 1, 5, 4294967295, 3, 3);
break;
case "A4":
ParticleSystemMC.newEvent(_arg2.x, _arg2.y, ((_arg2.MoveAngle * Degrees) + 180), 0, 1, 5, 4294953984, 3, 3);
break;
case "A5":
ParticleSystemMC.newEvent(_arg2.x, _arg2.y, ((_arg2.MoveAngle * Degrees) + 180), 0, 1, 5, 4280483584, 3, 3);
break;
case "A6":
ParticleSystemMC.newEvent(_arg2.x, _arg2.y, ((_arg2.MoveAngle * Degrees) + 180), 0, 1, 5, 4278255547, 3, 3);
break;
case "A7":
ParticleSystemMC.newEvent(_arg2.x, _arg2.y, ((_arg2.MoveAngle * Degrees) + 180), 0, 1, 5, 4294901760, 3, 3);
break;
case "A8":
ParticleSystemMC.newEvent(_arg2.x, _arg2.y, ((_arg2.MoveAngle * Degrees) + 180), 0, 1, 5, 4294967295, 3, 3);
break;
case "E3":
ParticleSystemMC.newEvent(_arg2.x, _arg2.y, -1, 0, 2, 3, 4278233855);
break;
case "E4":
ParticleSystemMC.newEvent(_arg2.x, _arg2.y, -1, 0, 2, 5, 4278255360);
break;
case "E5":
ParticleSystemMC.newEvent(_arg2.x, _arg2.y, -1, 0, 2, 5, 4294901794);
break;
case "E6":
ParticleSystemMC.newEvent(_arg2.x, _arg2.y, -1, 0, 2, 5, 4294901862);
break;
case "E8":
ParticleSystemMC.newEvent(_arg2.x, _arg2.y, -1, 0, 2, 5, 4294967295);
break;
};
}
public function MainMain(_arg1:Event):void{
EtherTxt.text = ("Ether: " + String(Ether));
ScoreTxt.text = ("Score: " + String(Score));
ParticleSystemMC.PTCMain();
CamMC.HeroMC.HeroMain();
CamMC.CamMain();
if ((((TimeBonus > 0)) && (Playing))){
TimeBonus--;
};
}
public function Hit(_arg1:String, _arg2:MovieClip){
if (_arg2.visible){
if (Math.random() < 0.33){
MovieClip(root).Pop1Var.play();
} else {
if (Math.random() < 0.33){
MovieClip(root).Pop2Var.play();
} else {
MovieClip(root).Pop3Var.play();
};
};
};
switch (_arg1){
case "E1":
_arg2.Damage = (_arg2.Damage + 2);
break;
case "E3":
_arg2.Damage = (_arg2.Damage + 1.3);
break;
case "E4":
_arg2.Damage = (_arg2.Damage + 1);
break;
case "E5":
_arg2.Damage = (_arg2.Damage + 1.5);
break;
case "E6":
_arg2.Damage = (_arg2.Damage + 2);
break;
case "E7":
_arg2.Damage = (_arg2.Damage + 2);
break;
case "E8":
_arg2.Damage = (_arg2.Damage + 3);
break;
case "A1":
_arg2.Damage = (_arg2.Damage + 3);
break;
case "A3":
_arg2.Damage = (_arg2.Damage + 1);
break;
case "A4":
_arg2.Damage = (_arg2.Damage + 0.5);
break;
case "A5":
_arg2.Damage = (_arg2.Damage + 0.5);
break;
case "A6":
_arg2.Damage = (_arg2.Damage + 1);
break;
case "A7":
_arg2.Damage = (_arg2.Damage + 2);
break;
case "A8":
_arg2.Damage = (_arg2.Damage + 2);
break;
case "Death":
_arg2.Damage = (_arg2.Damage + 1);
break;
case "Hero":
case "Secondary":
case "Smart":
_arg2.Damage = (_arg2.Damage + CamMC.HeroMC.Attack);
break;
};
switch (_arg2.Type){
case "A0":
MovieClip(root).ParticleSystemMC.newEvent(_arg2.x, _arg2.y, -1, 30, 100, 10, 4278255615, 100, 100);
break;
case "A1":
MovieClip(root).ParticleSystemMC.newEvent(_arg2.x, _arg2.y, -1, 30, 25, 5, 4278255615, 20, 20);
break;
case "A3":
MovieClip(root).ParticleSystemMC.newEvent(_arg2.x, _arg2.y, -1, 30, 10, 5, 4294967295, 10, 10);
break;
case "A4":
MovieClip(root).ParticleSystemMC.newEvent(_arg2.x, _arg2.y, -1, 30, 10, 5, 4294901760, 10, 10);
break;
case "A5":
MovieClip(root).ParticleSystemMC.newEvent(_arg2.x, _arg2.y, -1, 30, 10, 5, 4294967040, 10, 10);
break;
case "A6":
MovieClip(root).ParticleSystemMC.newEvent(_arg2.x, _arg2.y, -1, 30, 10, 5, 4278255360, 10, 10);
break;
case "A7":
MovieClip(root).ParticleSystemMC.newEvent(_arg2.x, _arg2.y, -1, 30, 10, 5, 4294901760, 10, 10);
break;
case "A8":
MovieClip(root).ParticleSystemMC.newEvent(_arg2.x, _arg2.y, -1, 30, 10, 5, 4294967295, 10, 10);
break;
case "E0":
MovieClip(root).ParticleSystemMC.newEvent(_arg2.x, _arg2.y, -1, 30, 100, 10, 4294967040, 200, 200);
break;
case "E1":
MovieClip(root).ParticleSystemMC.newEvent(_arg2.x, _arg2.y, -1, 30, 50, 5, 4294967040, 100, 100);
break;
case "E3":
MovieClip(root).ParticleSystemMC.newEvent(_arg2.x, _arg2.y, -1, 30, 10, 5, 4278255615, 20, 20);
break;
case "E4":
MovieClip(root).ParticleSystemMC.newEvent(_arg2.x, _arg2.y, -1, 30, 10, 5, 4283825920, 30, 30);
break;
case "E5":
MovieClip(root).ParticleSystemMC.newEvent(_arg2.x, _arg2.y, -1, 30, 10, 5, 4294901811, 20, 20);
break;
case "E6":
MovieClip(root).ParticleSystemMC.newEvent(_arg2.x, _arg2.y, -1, 30, 10, 5, 4294901896, 20, 20);
break;
case "E8":
MovieClip(root).ParticleSystemMC.newEvent(_arg2.x, _arg2.y, -1, 30, 10, 5, 4294967295, 20, 20);
break;
};
}
public function ResetGame(_arg1:String="MainMenu"){
var _local2:*;
var _local3:int;
FixCounter.stop();
Animes = new Array();
stage.quality = "HIGH";
BackdropOn = false;
Playing = false;
ParticleSystemMC.First = null;
CamMC.FirstUnit = null;
_local2 = (MovieClip(root).numChildren - 1);
_local3 = _local2;
while (_local3 > 0) {
MovieClip(root).removeChildAt(_local3);
_local3--;
};
EndGame = false;
HardMode = false;
this.removeEventListener(Event.ENTER_FRAME, MainMain);
if (_arg1 == "Victory"){
Score = (Score + TimeBonus);
};
gotoAndPlay(_arg1);
}
public function Pause(){
var _local1:Shot;
var _local2:int;
if ((((CamMC.HeroMC.RebirthCounter.running == false)) && ((EndGame == false)))){
if (((TutorialMC.visible) && (TutDone))){
TutorialMC.visible = false;
TutorialMC.gotoAndStop("Done");
};
if (Paused){
Cursor.visible = true;
Paused = false;
PauseMenuMC.x = -2000;
PauseMenuMC.visible = false;
PauseMenuMC.UpgradesPanelMC.AlliedUnitsDisplayMC.gotoAndStop(1);
PauseMenuMC.UpgradesPanelMC.CannonDisplayMC.gotoAndStop(1);
PauseMenuMC.UpgradesPanelMC.ShieldDisplayMC.gotoAndStop(1);
PauseMenuMC.UpgradesPanelMC.EngineDisplayMC.gotoAndStop(1);
PauseMenuMC.UpgradesPanelMC.TripleShotDisplayMC.gotoAndStop(1);
PauseMenuMC.UpgradesPanelMC.SecondaryCannonsDisplayMC.gotoAndStop(1);
PauseMenuMC.UpgradesPanelMC.SmartMissilesDisplayMC.gotoAndStop(1);
PauseMenuMC.UpgradesPanelMC.RepulsionShieldDisplayMC.gotoAndStop(1);
if (BackdropOn){
BackdropMC.Gfx.play();
BackdropMC.Gfx2.play();
BackdropMC.Gfx3.play();
};
WarningsMC.play();
CamMC.HeroMC.ShieldMC.Gfx.play();
_local1 = CamMC.FirstShot;
_local2 = 0;
while (_local2 < CamMC.TotalShots) {
if (Animes[_local2] != null){
Animes[_local2].play();
};
if (_local1.Active){
MovieClip(_local1).play();
};
_local2++;
_local1 = _local1.NextShot;
};
} else {
Cursor.visible = false;
Paused = true;
PauseMenuMC.x = (Width * 0.5);
PauseMenuMC.visible = true;
PauseMenuMC.UpgradesPanelMC.AlliedUnitsDisplayMC.gotoAndStop((CamMC.AlliedUnitLevel + 1));
PauseMenuMC.UpgradesPanelMC.CannonDisplayMC.gotoAndStop((CamMC.HeroMC.CannonType + 1));
PauseMenuMC.UpgradesPanelMC.ShieldDisplayMC.gotoAndStop((CamMC.HeroMC.ShieldType + 1));
PauseMenuMC.UpgradesPanelMC.EngineDisplayMC.gotoAndStop((CamMC.HeroMC.EngineType + 1));
if (CamMC.HeroMC.TriShot){
PauseMenuMC.UpgradesPanelMC.TripleShotDisplayMC.gotoAndStop(3);
} else {
PauseMenuMC.UpgradesPanelMC.TripleShotDisplayMC.gotoAndStop(2);
};
if (CamMC.HeroMC.Secondary){
PauseMenuMC.UpgradesPanelMC.SecondaryCannonsDisplayMC.gotoAndStop(3);
} else {
PauseMenuMC.UpgradesPanelMC.SecondaryCannonsDisplayMC.gotoAndStop(2);
};
if (CamMC.HeroMC.Smart){
PauseMenuMC.UpgradesPanelMC.SmartMissilesDisplayMC.gotoAndStop(3);
} else {
PauseMenuMC.UpgradesPanelMC.SmartMissilesDisplayMC.gotoAndStop(2);
};
if (CamMC.HeroMC.Repulsion){
PauseMenuMC.UpgradesPanelMC.RepulsionShieldDisplayMC.gotoAndStop(3);
} else {
PauseMenuMC.UpgradesPanelMC.RepulsionShieldDisplayMC.gotoAndStop(2);
};
if (BackdropOn){
BackdropMC.Gfx.stop();
BackdropMC.Gfx2.stop();
BackdropMC.Gfx3.stop();
};
WarningsMC.stop();
CamMC.HeroMC.ShieldMC.Gfx.stop();
_local1 = CamMC.FirstShot;
_local2 = 0;
while (_local2 < CamMC.TotalShots) {
if (Animes[_local2] != null){
Animes[_local2].stop();
};
MovieClip(_local1).stop();
_local2++;
_local1 = _local1.NextShot;
};
};
};
}
public function UnitVars(_arg1:String, _arg2:Unit){
switch (_arg1){
case "A0":
_arg2.Perm = true;
_arg2.Priority = 1;
_arg2.Speed = 0;
_arg2.Shield = 200;
_arg2.Revive = 0.1;
break;
case "A1":
_arg2.Priority = 3;
_arg2.Speed = 0;
_arg2.Range = 700;
_arg2.AimSpeed = 5;
_arg2.ShotSpace = 35;
_arg2.Shield = 75;
_arg2.Revive = 0.05;
break;
case "A2":
SpawnCount++;
MovieClip(CamMC).AllySpawns[SpawnCount] = _arg2;
_arg2.Perm = true;
_arg2.Priority = 2;
_arg2.Speed = 0;
_arg2.Shield = 50;
_arg2.Revive = 0.1;
break;
case "A3":
_arg2.Priority = 4;
_arg2.Speed = 12;
_arg2.Range = 300;
_arg2.Turn = 0.1;
_arg2.ShotSpace = 10;
_arg2.Shield = 2.5;
_arg2.Revive = 0;
break;
case "A4":
_arg2.Priority = 5;
_arg2.Speed = 13;
_arg2.Range = 300;
_arg2.Turn = 0.1;
_arg2.ShotSpace = 8;
_arg2.Shield = 3;
_arg2.Revive = 0;
break;
case "A5":
_arg2.Priority = 6;
_arg2.Speed = 14;
_arg2.Range = 300;
_arg2.Turn = 0.1;
_arg2.ShotSpace = 5;
_arg2.Shield = 4;
_arg2.Revive = 0;
break;
case "A6":
_arg2.Priority = 7;
_arg2.Speed = 13;
_arg2.Range = 300;
_arg2.Turn = 0.05;
_arg2.ShotSpace = 5;
_arg2.Shield = 4;
_arg2.Revive = 0;
break;
case "A7":
_arg2.Priority = 8;
_arg2.Speed = 14;
_arg2.Range = 300;
_arg2.Turn = 0.1;
_arg2.ShotSpace = 10;
_arg2.Shield = 4;
_arg2.Revive = 0;
break;
case "A8":
_arg2.Priority = 9;
_arg2.Speed = 15;
_arg2.Range = 300;
_arg2.Turn = 0.1;
_arg2.ShotSpace = 5;
_arg2.Shield = 5;
_arg2.Revive = 0;
break;
case "Secondary":
_arg2.Priority = 0;
_arg2.Speed = 0;
_arg2.Range = 300;
_arg2.ShotSpace = 15;
_arg2.Shield = 9999;
_arg2.Revive = 50;
break;
case "E0":
RedCount++;
_arg2.Perm = true;
_arg2.Priority = 1;
_arg2.Speed = 0;
CamMC.BigReds[RedCount] = _arg2;
_arg2.MoveAngle = (Math.PI * RedCount);
_arg2.Shield = 100;
_arg2.Revive = 0.1;
break;
case "E1":
YellowCount++;
switch (YellowCount){
case 1:
case 5:
case 9:
_arg2.MoveAngle = (Math.PI * 0.5);
break;
case 2:
case 6:
case 10:
_arg2.MoveAngle = Math.PI;
break;
case 3:
case 7:
case 11:
_arg2.MoveAngle = (-(Math.PI) * 0.5);
break;
case 4:
case 8:
case 12:
_arg2.MoveAngle = 0;
break;
};
CamMC.Yellows[YellowCount] = _arg2;
_arg2.FollowRed = 1;
_arg2.YellowTeir = Math.ceil((YellowCount / 4));
_arg2.Priority = 3;
_arg2.Speed = 0;
_arg2.Range = 300;
_arg2.ShotSpace = 20;
_arg2.Shield = 60;
_arg2.Revive = 0.2;
break;
case "E3":
_arg2.Priority = 4;
_arg2.Speed = 16;
_arg2.Range = 300;
_arg2.Turn = 0.1;
_arg2.ShotSpace = 8;
_arg2.Shield = 3;
_arg2.Revive = 0;
break;
case "E4":
_arg2.Priority = 5;
_arg2.Speed = 17;
_arg2.Range = 200;
_arg2.Turn = 0.05;
_arg2.ShotSpace = 10;
_arg2.Shield = 4;
_arg2.Revive = 0;
break;
case "E5":
_arg2.Priority = 6;
_arg2.Speed = 15;
_arg2.Range = 400;
_arg2.Turn = 0.1;
_arg2.ShotSpace = 6;
_arg2.Shield = 4;
_arg2.Revive = 0.01;
break;
case "E6":
_arg2.Priority = 7;
_arg2.Speed = 17;
_arg2.Range = 200;
_arg2.Turn = 0.09;
_arg2.ShotSpace = 5;
_arg2.Shield = 4;
_arg2.Revive = 0.03;
break;
case "E7":
_arg2.Priority = 10;
_arg2.Speed = 20;
_arg2.Range = 400;
_arg2.Turn = 0.1;
_arg2.ShotSpace = 20;
_arg2.Shield = 4;
_arg2.Revive = 0.04;
break;
case "E8":
_arg2.Priority = 9;
_arg2.Speed = 14;
_arg2.Range = 300;
_arg2.Turn = 0.05;
_arg2.ShotSpace = 10;
_arg2.Shield = 8;
_arg2.Revive = 0.02;
break;
};
}
}
}//package
Section 143
//MenuMusic (MenuMusic)
package {
import flash.media.*;
public dynamic class MenuMusic extends Sound {
}
}//package
Section 144
//MochiAd (MochiAd)
package {
import flash.display.*;
import flash.events.*;
import flash.utils.*;
import flash.net.*;
import flash.system.*;
public class MochiAd {
public static function getVersion():String{
return ("2.6");
}
public static function showClickAwayAd(_arg1:Object):void{
var DEFAULTS:Object;
var clip:Object;
var ad_timeout:Number;
var mc:MovieClip;
var wh:Array;
var w:Number;
var h:Number;
var chk:MovieClip;
var sendHostProgress:Boolean;
var options = _arg1;
DEFAULTS = {ad_timeout:2000, regpt:"o", method:"showClickAwayAd", res:"300x250", no_bg:true, ad_started:function ():void{
}, ad_finished:function ():void{
}, ad_loaded:function (_arg1:Number, _arg2:Number):void{
}, ad_failed:function ():void{
trace("[MochiAd] Couldn't load an ad, make sure your game's local security sandbox is configured for Access Network Only and that you are not using ad blocking software");
}, ad_skipped:function ():void{
}};
options = _slot1._parseOptions(options, DEFAULTS);
clip = options.clip;
ad_timeout = options.ad_timeout;
delete options.ad_timeout;
if (!_slot1.load(options)){
options.ad_failed();
options.ad_finished();
return;
};
options.ad_started();
mc = clip._mochiad;
mc["onUnload"] = function ():void{
_slot1._cleanup(mc);
options.ad_finished();
};
wh = _slot1._getRes(options, clip);
w = wh[0];
h = wh[1];
mc.x = (w * 0.5);
mc.y = (h * 0.5);
chk = createEmptyMovieClip(mc, "_mochiad_wait", 3);
chk.ad_timeout = ad_timeout;
chk.started = getTimer();
chk.showing = false;
mc.unloadAd = function ():void{
_slot1.unload(clip);
};
mc.adLoaded = options.ad_loaded;
mc.adSkipped = options.ad_skipped;
mc.rpc = function (_arg1:Number, _arg2:Object):void{
_slot1.rpc(clip, _arg1, _arg2);
};
sendHostProgress = false;
mc.regContLC = function (_arg1:String):void{
mc._containerLCName = _arg1;
};
chk["onEnterFrame"] = function ():void{
var _local1:Object;
var _local2:Number;
var _local3:Boolean;
var _local4:Number;
if (!this.parent){
delete this.onEnterFrame;
return;
};
_local1 = this.parent._mochiad_ctr;
_local2 = (getTimer() - this.started);
_local3 = false;
if (!chk.showing){
_local4 = this.parent._mochiad_ctr.contentLoaderInfo.bytesTotal;
if (_local4 > 0){
chk.showing = true;
_local3 = true;
chk.started = getTimer();
} else {
if (_local2 > chk.ad_timeout){
options.ad_failed();
_local3 = true;
};
};
};
if (this.root == null){
_local3 = true;
};
if (_local3){
delete this.onEnterFrame;
};
};
doOnEnterFrame(chk);
}
public static function _isNetworkAvailable():Boolean{
return (!((Security.sandboxType == "localWithFile")));
}
public static function _allowDomains(_arg1:String):String{
var _local2:String;
_local2 = _arg1.split("/")[2].split(":")[0];
Security.allowDomain("*");
Security.allowDomain(_local2);
Security.allowInsecureDomain("*");
Security.allowInsecureDomain(_local2);
return (_local2);
}
public static function unload(_arg1:Object):Boolean{
if (((_arg1.clip) && (_arg1.clip._mochiad))){
_arg1 = _arg1.clip;
};
if (_arg1.origFrameRate != undefined){
_arg1.stage.frameRate = _arg1.origFrameRate;
};
if (!_arg1._mochiad){
return (false);
};
if (_arg1._mochiad._containerLCName != undefined){
_arg1._mochiad.lc.send(_arg1._mochiad._containerLCName, "notify", {id:"unload"});
};
if (_arg1._mochiad.onUnload){
_arg1._mochiad.onUnload();
};
delete _arg1._mochiad_loaded;
delete _arg1._mochiad;
return (true);
}
public static function showInterLevelAd(_arg1:Object):void{
var DEFAULTS:Object;
var clip:Object;
var ad_msec:Number;
var ad_timeout:Number;
var fadeout_time:Number;
var mc:MovieClip;
var wh:Array;
var w:Number;
var h:Number;
var chk:MovieClip;
var options = _arg1;
DEFAULTS = {ad_timeout:2000, fadeout_time:250, regpt:"o", method:"showTimedAd", ad_started:function ():void{
if ((this.clip is MovieClip)){
this.clip.stop();
} else {
throw (new Error("MochiAd.showInterLevelAd requires a clip that is a MovieClip or is an instance of a class that extends MovieClip. If your clip is a Sprite, then you must provide custom ad_started and ad_finished handlers."));
};
}, ad_finished:function ():void{
if ((this.clip is MovieClip)){
this.clip.play();
} else {
throw (new Error("MochiAd.showInterLevelAd requires a clip that is a MovieClip or is an instance of a class that extends MovieClip. If your clip is a Sprite, then you must provide custom ad_started and ad_finished handlers."));
};
}, ad_loaded:function (_arg1:Number, _arg2:Number):void{
}, ad_failed:function ():void{
trace("[MochiAd] Couldn't load an ad, make sure your game's local security sandbox is configured for Access Network Only and that you are not using ad blocking software");
}, ad_skipped:function ():void{
}};
options = _slot1._parseOptions(options, DEFAULTS);
clip = options.clip;
ad_msec = 11000;
ad_timeout = options.ad_timeout;
delete options.ad_timeout;
fadeout_time = options.fadeout_time;
delete options.fadeout_time;
if (!_slot1.load(options)){
options.ad_failed();
options.ad_finished();
return;
};
options.ad_started();
mc = clip._mochiad;
mc["onUnload"] = function ():void{
_slot1._cleanup(mc);
options.ad_finished();
};
wh = _slot1._getRes(options, clip);
w = wh[0];
h = wh[1];
mc.x = (w * 0.5);
mc.y = (h * 0.5);
chk = createEmptyMovieClip(mc, "_mochiad_wait", 3);
chk.ad_msec = ad_msec;
chk.ad_timeout = ad_timeout;
chk.started = getTimer();
chk.showing = false;
chk.fadeout_time = fadeout_time;
chk.fadeFunction = function ():void{
var _local1:Number;
if (!this.parent){
delete this.onEnterFrame;
delete this.fadeFunction;
return;
};
_local1 = (100 * (1 - ((getTimer() - this.fadeout_start) / this.fadeout_time)));
if (_local1 > 0){
this.parent.alpha = (_local1 * 0.01);
} else {
_slot1.unload(clip);
delete this["onEnterFrame"];
};
};
mc.unloadAd = function ():void{
_slot1.unload(clip);
};
mc.adLoaded = options.ad_loaded;
mc.adSkipped = options.ad_skipped;
mc.adjustProgress = function (_arg1:Number):void{
var _local2:Object;
_local2 = mc._mochiad_wait;
_local2.server_control = true;
_local2.showing = true;
_local2.started = getTimer();
_local2.ad_msec = (_arg1 - 250);
};
mc.rpc = function (_arg1:Number, _arg2:Object):void{
_slot1.rpc(clip, _arg1, _arg2);
};
chk["onEnterFrame"] = function ():void{
var _local1:Object;
var _local2:Number;
var _local3:Boolean;
var _local4:Number;
if (!this.parent){
delete this.onEnterFrame;
delete this.fadeFunction;
return;
};
_local1 = this.parent._mochiad_ctr;
_local2 = (getTimer() - this.started);
_local3 = false;
if (!chk.showing){
_local4 = this.parent._mochiad_ctr.contentLoaderInfo.bytesTotal;
if (_local4 > 0){
chk.showing = true;
chk.started = getTimer();
_slot1.adShowing(clip);
} else {
if (_local2 > chk.ad_timeout){
options.ad_failed();
_local3 = true;
};
};
};
if (_local2 > chk.ad_msec){
_local3 = true;
};
if (_local3){
if (this.server_control){
delete this.onEnterFrame;
} else {
this.fadeout_start = getTimer();
this.onEnterFrame = this.fadeFunction;
};
};
};
doOnEnterFrame(chk);
}
public static function _parseOptions(_arg1:Object, _arg2:Object):Object{
var _local3:Object;
var _local4:String;
var _local5:Array;
var _local6:Number;
var _local7:Array;
_local3 = {};
for (_local4 in _arg2) {
_local3[_local4] = _arg2[_local4];
};
if (_arg1){
for (_local4 in _arg1) {
_local3[_local4] = _arg1[_local4];
};
};
if (_local3.clip == undefined){
throw (new Error("MochiAd is missing the 'clip' parameter. This should be a MovieClip, Sprite or an instance of a class that extends MovieClip or Sprite."));
};
_arg1 = _local3.clip.loaderInfo.parameters.mochiad_options;
if (_arg1){
_local5 = _arg1.split("&");
_local6 = 0;
while (_local6 < _local5.length) {
_local7 = _local5[_local6].split("=");
_local3[unescape(_local7[0])] = unescape(_local7[1]);
_local6++;
};
};
if (_local3.id == "test"){
trace("[MochiAd] WARNING: Using the MochiAds test identifier, make sure to use the code from your dashboard, not this example!");
};
return (_local3);
}
public static function _cleanup(_arg1:Object):void{
var idx:Number;
var k:String;
var lc:LocalConnection;
var f:Function;
var mc = _arg1;
if (("lc" in mc)){
lc = mc.lc;
f = function ():void{
try {
lc.client = null;
lc.close();
} catch(e:Error) {
};
};
setTimeout(f, 0);
};
idx = DisplayObjectContainer(mc).numChildren;
while (idx > 0) {
idx = (idx - 1);
DisplayObjectContainer(mc).removeChildAt(idx);
};
for (k in mc) {
delete mc[k];
};
}
public static function load(_arg1:Object):MovieClip{
var DEFAULTS:Object;
var clip:Object;
var depth:Number;
var mc:MovieClip;
var wh:Array;
var lv:URLVariables;
var k:String;
var server:String;
var hostname:String;
var lc:LocalConnection;
var name:String;
var loader:Loader;
var g:Function;
var req:URLRequest;
var v:Object;
var options = _arg1;
DEFAULTS = {server:"http://x.mochiads.com/srv/1/", method:"load", depth:10333, id:"_UNKNOWN_"};
options = _slot1._parseOptions(options, DEFAULTS);
options.swfv = 9;
options.mav = _slot1.getVersion();
clip = options.clip;
if (!_slot1._isNetworkAvailable()){
return (null);
};
try {
if (clip._mochiad_loaded){
return (null);
};
} catch(e:Error) {
throw (new Error("MochiAd requires a clip that is an instance of a dynamic class. If your class extends Sprite or MovieClip, you must make it dynamic."));
};
depth = options.depth;
delete options.depth;
mc = createEmptyMovieClip(clip, "_mochiad", depth);
wh = _slot1._getRes(options, clip);
options.res = ((wh[0] + "x") + wh[1]);
options.server = (options.server + options.id);
delete options.id;
clip._mochiad_loaded = true;
if (clip.loaderInfo.loaderURL.indexOf("http") == 0){
options.as3_swf = clip.loaderInfo.loaderURL;
};
lv = new URLVariables();
for (k in options) {
v = options[k];
if (!(v is Function)){
lv[k] = v;
};
};
server = lv.server;
delete lv.server;
hostname = _allowDomains(server);
lc = new LocalConnection();
lc.client = mc;
name = ["", Math.floor(new Date().getTime()), Math.floor((Math.random() * 999999))].join("_");
lc.allowDomain("*", "localhost");
lc.allowInsecureDomain("*", "localhost");
lc.connect(name);
mc.lc = lc;
mc.lcName = name;
lv.lc = name;
lv.st = getTimer();
loader = new Loader();
g = function (_arg1:Object):void{
_arg1.target.removeEventListener(_arg1.type, arguments.callee);
_slot1.unload(clip);
};
loader.contentLoaderInfo.addEventListener(Event.UNLOAD, g);
req = new URLRequest((server + ".swf"));
req.contentType = "application/x-www-form-urlencoded";
req.method = URLRequestMethod.POST;
req.data = lv;
loader.load(req);
mc.addChild(loader);
mc._mochiad_ctr = loader;
return (mc);
}
public static function runMethod(_arg1:Object, _arg2:String, _arg3:Array):Object{
var _local4:Array;
var _local5:Number;
_local4 = _arg2.split(".");
_local5 = 0;
while (_local5 < (_local4.length - 1)) {
if ((((_arg1[_local4[_local5]] == undefined)) || ((_arg1[_local4[_local5]] == null)))){
return (undefined);
};
_arg1 = _arg1[_local4[_local5]];
_local5++;
};
if (typeof(_arg1[_local4[_local5]]) == "function"){
return (_arg1[_local4[_local5]].apply(_arg1, _arg3));
};
return (undefined);
}
public static function createEmptyMovieClip(_arg1:Object, _arg2:String, _arg3:Number):MovieClip{
var _local4:MovieClip;
_local4 = new MovieClip();
if (((false) && (_arg3))){
_arg1.addChildAt(_local4, _arg3);
} else {
_arg1.addChild(_local4);
};
_arg1[_arg2] = _local4;
_local4["_name"] = _arg2;
return (_local4);
}
public static function _getRes(_arg1:Object, _arg2:Object):Array{
var _local3:Object;
var _local4:Number;
var _local5:Number;
var _local6:Array;
_local3 = _arg2.getBounds(_arg2.root);
_local4 = 0;
_local5 = 0;
if (typeof(_arg1.res) != "undefined"){
_local6 = _arg1.res.split("x");
_local4 = parseFloat(_local6[0]);
_local5 = parseFloat(_local6[1]);
} else {
_local4 = (_local3.xMax - _local3.xMin);
_local5 = (_local3.yMax - _local3.yMin);
};
if ((((_local4 == 0)) || ((_local5 == 0)))){
_local4 = _arg2.stage.stageWidth;
_local5 = _arg2.stage.stageHeight;
};
return ([_local4, _local5]);
}
public static function adShowing(_arg1:Object):void{
_arg1.origFrameRate = _arg1.stage.frameRate;
_arg1.stage.frameRate = 30;
}
public static function getValue(_arg1:Object, _arg2:String):Object{
var _local3:Array;
var _local4:Number;
_local3 = _arg2.split(".");
_local4 = 0;
while (_local4 < (_local3.length - 1)) {
if ((((_arg1[_local3[_local4]] == undefined)) || ((_arg1[_local3[_local4]] == null)))){
return (undefined);
};
_arg1 = _arg1[_local3[_local4]];
_local4++;
};
return (_arg1[_local3[_local4]]);
}
public static function rpc(_arg1:Object, _arg2:Number, _arg3:Object):void{
var _local4:Object;
var _local5:Object;
switch (_arg3.id){
case "setValue":
_slot1.setValue(_arg1, _arg3.objectName, _arg3.value);
break;
case "getValue":
_local4 = _slot1.getValue(_arg1, _arg3.objectName);
_arg1._mochiad.lc.send(_arg1._mochiad._containerLCName, "rpcResult", _arg2, _local4);
break;
case "runMethod":
_local5 = _slot1.runMethod(_arg1, _arg3.method, _arg3.args);
_arg1._mochiad.lc.send(_arg1._mochiad._containerLCName, "rpcResult", _arg2, _local5);
break;
default:
trace(("[mochiads rpc] unknown rpc id: " + _arg3.id));
};
}
public static function setValue(_arg1:Object, _arg2:String, _arg3:Object):void{
var _local4:Array;
var _local5:Number;
_local4 = _arg2.split(".");
_local5 = 0;
while (_local5 < (_local4.length - 1)) {
if ((((_arg1[_local4[_local5]] == undefined)) || ((_arg1[_local4[_local5]] == null)))){
return;
};
_arg1 = _arg1[_local4[_local5]];
_local5++;
};
_arg1[_local4[_local5]] = _arg3;
}
public static function showPreGameAd(_arg1:Object):void{
var DEFAULTS:Object;
var clip:Object;
var ad_msec:Number;
var ad_timeout:Number;
var fadeout_time:Number;
var mc:MovieClip;
var wh:Array;
var w:Number;
var h:Number;
var chk:MovieClip;
var bar:MovieClip;
var bar_color:Number;
var bar_background:Number;
var bar_outline:Number;
var backing_mc:MovieClip;
var backing:Object;
var inside_mc:MovieClip;
var inside:Object;
var outline_mc:MovieClip;
var outline:Object;
var complete:Boolean;
var unloaded:Boolean;
var f:Function;
var sendHostProgress:Boolean;
var fn:Function;
var r:MovieClip;
var options = _arg1;
DEFAULTS = {ad_timeout:3000, fadeout_time:250, regpt:"o", method:"showPreloaderAd", color:0xFF8A00, background:16777161, outline:13994812, no_progress_bar:false, ad_started:function ():void{
if ((this.clip is MovieClip)){
this.clip.stop();
} else {
throw (new Error("MochiAd.showPreGameAd requires a clip that is a MovieClip or is an instance of a class that extends MovieClip. If your clip is a Sprite, then you must provide custom ad_started and ad_finished handlers."));
};
}, ad_finished:function ():void{
if ((this.clip is MovieClip)){
this.clip.play();
} else {
throw (new Error("MochiAd.showPreGameAd requires a clip that is a MovieClip or is an instance of a class that extends MovieClip. If your clip is a Sprite, then you must provide custom ad_started and ad_finished handlers."));
};
}, ad_loaded:function (_arg1:Number, _arg2:Number):void{
}, ad_failed:function ():void{
trace("[MochiAd] Couldn't load an ad, make sure your game's local security sandbox is configured for Access Network Only and that you are not using ad blocking software");
}, ad_skipped:function ():void{
}, ad_progress:function (_arg1:Number):void{
}};
options = _slot1._parseOptions(options, DEFAULTS);
if ("c862232051e0a94e1c3609b3916ddb17".substr(0) == "dfeada81ac97cde83665f81c12da7def"){
options.ad_started();
fn = function ():void{
options.ad_finished();
};
setTimeout(fn, 100);
return;
};
clip = options.clip;
ad_msec = 11000;
ad_timeout = options.ad_timeout;
delete options.ad_timeout;
fadeout_time = options.fadeout_time;
delete options.fadeout_time;
if (!_slot1.load(options)){
options.ad_failed();
options.ad_finished();
return;
};
options.ad_started();
mc = clip._mochiad;
mc["onUnload"] = function ():void{
var fn:Function;
_slot1._cleanup(mc);
fn = function ():void{
options.ad_finished();
};
setTimeout(fn, 100);
};
wh = _slot1._getRes(options, clip);
w = wh[0];
h = wh[1];
mc.x = (w * 0.5);
mc.y = (h * 0.5);
chk = createEmptyMovieClip(mc, "_mochiad_wait", 3);
chk.x = (w * -0.5);
chk.y = (h * -0.5);
bar = createEmptyMovieClip(chk, "_mochiad_bar", 4);
if (options.no_progress_bar){
bar.visible = false;
delete options.no_progress_bar;
} else {
bar.x = 10;
bar.y = (h - 20);
};
bar_color = options.color;
delete options.color;
bar_background = options.background;
delete options.background;
bar_outline = options.outline;
delete options.outline;
backing_mc = createEmptyMovieClip(bar, "_outline", 1);
backing = backing_mc.graphics;
backing.beginFill(bar_background);
backing.moveTo(0, 0);
backing.lineTo((w - 20), 0);
backing.lineTo((w - 20), 10);
backing.lineTo(0, 10);
backing.lineTo(0, 0);
backing.endFill();
inside_mc = createEmptyMovieClip(bar, "_inside", 2);
inside = inside_mc.graphics;
inside.beginFill(bar_color);
inside.moveTo(0, 0);
inside.lineTo((w - 20), 0);
inside.lineTo((w - 20), 10);
inside.lineTo(0, 10);
inside.lineTo(0, 0);
inside.endFill();
inside_mc.scaleX = 0;
outline_mc = createEmptyMovieClip(bar, "_outline", 3);
outline = outline_mc.graphics;
outline.lineStyle(0, bar_outline, 100);
outline.moveTo(0, 0);
outline.lineTo((w - 20), 0);
outline.lineTo((w - 20), 10);
outline.lineTo(0, 10);
outline.lineTo(0, 0);
chk.ad_msec = ad_msec;
chk.ad_timeout = ad_timeout;
chk.started = getTimer();
chk.showing = false;
chk.last_pcnt = 0;
chk.fadeout_time = fadeout_time;
chk.fadeFunction = function ():void{
var _local1:Number;
_local1 = (100 * (1 - ((getTimer() - this.fadeout_start) / this.fadeout_time)));
if (_local1 > 0){
this.parent.alpha = (_local1 * 0.01);
} else {
_slot1.unload(clip);
delete this["onEnterFrame"];
};
};
complete = false;
unloaded = false;
f = function (_arg1:Event):void{
_arg1.target.removeEventListener(_arg1.type, arguments.callee);
complete = true;
if (unloaded){
_slot1.unload(clip);
};
};
clip.loaderInfo.addEventListener(Event.COMPLETE, f);
if ((clip.root is MovieClip)){
r = (clip.root as MovieClip);
if (r.framesLoaded >= r.totalFrames){
complete = true;
};
};
mc.unloadAd = function ():void{
unloaded = true;
if (complete){
_slot1.unload(clip);
};
};
mc.adLoaded = options.ad_loaded;
mc.adSkipped = options.ad_skipped;
mc.adjustProgress = function (_arg1:Number):void{
var _local2:Object;
_local2 = mc._mochiad_wait;
_local2.server_control = true;
_local2.showing = true;
_local2.started = getTimer();
_local2.ad_msec = _arg1;
};
mc.rpc = function (_arg1:Number, _arg2:Object):void{
_slot1.rpc(clip, _arg1, _arg2);
};
mc.rpcTestFn = function (_arg1:String):Object{
trace(("[MOCHIAD rpcTestFn] " + _arg1));
return (_arg1);
};
mc.regContLC = function (_arg1:String):void{
mc._containerLCName = _arg1;
};
sendHostProgress = false;
mc.sendHostLoadProgress = function (_arg1:String):void{
sendHostProgress = true;
};
chk["onEnterFrame"] = function ():void{
var _local1:Object;
var _local2:Object;
var _local3:Number;
var _local4:Boolean;
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:Number;
var _local9:Object;
var _local10:Number;
var _local11:Number;
if (((!(this.parent)) || (!(this.parent.parent)))){
delete this["onEnterFrame"];
return;
};
_local1 = this.parent.parent.root;
_local2 = this.parent._mochiad_ctr;
_local3 = (getTimer() - this.started);
_local4 = false;
_local5 = _local1.loaderInfo.bytesTotal;
_local6 = _local1.loaderInfo.bytesLoaded;
if (complete){
_local6 = Math.max(1, _local6);
_local5 = _local6;
};
_local7 = ((100 * _local6) / _local5);
_local8 = ((100 * _local3) / chk.ad_msec);
_local9 = this._mochiad_bar._inside;
_local10 = Math.min(100, Math.min(((_local7) || (0)), _local8));
_local10 = Math.max(this.last_pcnt, _local10);
this.last_pcnt = _local10;
_local9.scaleX = (_local10 * 0.01);
options.ad_progress(_local10);
if (sendHostProgress){
clip._mochiad.lc.send(clip._mochiad._containerLCName, "notify", {id:"hostLoadPcnt", pcnt:_local7});
if (_local7 == 100){
sendHostProgress = false;
};
};
if (!chk.showing){
_local11 = this.parent._mochiad_ctr.contentLoaderInfo.bytesTotal;
if (_local11 > 0){
chk.showing = true;
chk.started = getTimer();
_slot1.adShowing(clip);
} else {
if ((((_local3 > chk.ad_timeout)) && ((_local7 == 100)))){
options.ad_failed();
_local4 = true;
};
};
};
if (_local3 > chk.ad_msec){
_local4 = true;
};
if (((complete) && (_local4))){
if (this.server_control){
delete this.onEnterFrame;
} else {
this.fadeout_start = getTimer();
this.onEnterFrame = chk.fadeFunction;
};
};
};
doOnEnterFrame(chk);
}
public static function showPreloaderAd(_arg1:Object):void{
trace("[MochiAd] DEPRECATED: showPreloaderAd was renamed to showPreGameAd in 2.0");
_slot1.showPreGameAd(_arg1);
}
public static function showTimedAd(_arg1:Object):void{
trace("[MochiAd] DEPRECATED: showTimedAd was renamed to showInterLevelAd in 2.0");
_slot1.showInterLevelAd(_arg1);
}
public static function doOnEnterFrame(_arg1:MovieClip):void{
var f:Function;
var mc = _arg1;
f = function (_arg1:Object):void{
if (((("onEnterFrame" in mc)) && (mc.onEnterFrame))){
mc.onEnterFrame();
} else {
_arg1.target.removeEventListener(_arg1.type, arguments.callee);
};
};
mc.addEventListener(Event.ENTER_FRAME, f);
}
}
}//package
Section 145
//MochiBot (MochiBot)
package {
import flash.display.*;
import flash.net.*;
import flash.system.*;
public dynamic class MochiBot extends Sprite {
public static function track(_arg1:Sprite, _arg2:String):MochiBot{
var _local3:MochiBot;
var _local4:String;
var _local5:URLVariables;
var _local6:String;
var _local7:URLRequest;
var _local8:Loader;
if (Security.sandboxType == "localWithFile"){
return (null);
};
_local3 = new (MochiBot);
_arg1.addChild(_local3);
Security.allowDomain("*");
Security.allowInsecureDomain("*");
_local4 = "http://core.mochibot.com/my/core.swf";
_local5 = new URLVariables();
_local5["sb"] = Security.sandboxType;
_local5["v"] = Capabilities.version;
_local5["swfid"] = _arg2;
_local5["mv"] = "8";
_local5["fv"] = "9";
_local6 = _local3.root.loaderInfo.loaderURL;
if (_local6.indexOf("http") == 0){
_local5["url"] = _local6;
} else {
_local5["url"] = "local";
};
_local7 = new URLRequest(_local4);
_local7.contentType = "application/x-www-form-urlencoded";
_local7.method = URLRequestMethod.POST;
_local7.data = _local5;
_local8 = new Loader();
_local3.addChild(_local8);
_local8.load(_local7);
return (_local3);
}
}
}//package
Section 146
//Particle (Particle)
package {
public class Particle {
public var Active:Boolean;// = false
public var XThrust:Number;// = 0
public var YThrust:Number;// = 0
public var Star:Boolean;// = false
public var Next:Particle;
public var Thrust:Number;// = 0
public var Col:uint;// = 4294967295
public var YPos:Number;// = 0
public var XPos:Number;// = 0
public function Particle(){
XPos = 0;
YPos = 0;
XThrust = 0;
YThrust = 0;
Thrust = 0;
Active = false;
Col = 4294967295;
Star = false;
super();
}
}
}//package
Section 147
//ParticleEvent (ParticleEvent)
package {
public class ParticleEvent {
public var NextEvent:ParticleEvent;
public var XDisp:Number;// = 0
public var YDisp:Number;// = 0
public var XPos:Number;
public var Col:uint;
public var Life:Number;
public var Star:Boolean;// = false
public var Angle:Number;
public var Num:int;
public var Offset:Number;
public var YPos:Number;
public function ParticleEvent(){
XDisp = 0;
YDisp = 0;
Star = false;
super();
}
public function ResetVars():void{
XPos = 0;
YPos = 0;
Angle = 0;
Offset = 0;
Life = 0;
Num = 0;
Col = 0;
XDisp = 0;
YDisp = 0;
Star = false;
}
}
}//package
Section 148
//ParticleSystem (ParticleSystem)
package {
import flash.display.*;
import flash.geom.*;
import flash.filters.*;
public class ParticleSystem extends MovieClip {
public var AngArrX:Array;
public var SmokeyPTCs:Boolean;// = false
public var Rect:Rectangle;
public var TempPart:Particle;
public var FadeTran2:ColorTransform;
public var CurX:Number;// = 0
public var CurY:Number;// = 0
public var StarBitmap:BitmapData;
public var Height:Number;
public var MainEvent:ParticleEvent;
public var Radians:Number;
public var PTCCount:uint;// = 0
public var First:Particle;
public var Width:Number;
public var AddPTC:uint;// = 0
public var BlurFilt:BlurFilter;
public var TrailBitmap:BitmapData;
public var LowPTCs:Boolean;// = false
public var DispX:Number;// = 50
public var DispY:Number;// = 50
public var TotalParticles:uint;// = 20000
public var FadeTran:ColorTransform;
public var FirstEvent:ParticleEvent;
public var AngArrY:Array;
public var EventArray:Array;
public function ParticleSystem():void{
var _local1:uint;
DispX = 50;
DispY = 50;
CurX = 0;
CurY = 0;
Width = stage.stageWidth;
Height = stage.stageHeight;
Rect = new Rectangle(0, 0, Width, Height);
TrailBitmap = new BitmapData(Width, Height, true, 0);
StarBitmap = new BitmapData(Width, Height, true, 0);
TotalParticles = 20000;
PTCCount = 0;
AddPTC = 0;
First = new Particle();
TempPart = First;
EventArray = new Array();
MainEvent = new ParticleEvent();
FirstEvent = new ParticleEvent();
LowPTCs = false;
SmokeyPTCs = false;
Radians = (Math.PI / 180);
AngArrX = new Array();
AngArrY = new Array();
FadeTran = new ColorTransform(1, 1, 1, 0.9, 0, 0, 0, 0);
FadeTran2 = new ColorTransform(1, 1, 1, 0.8, 0, 0, 0, 0);
BlurFilt = new BlurFilter(2, 2, 1);
super();
MovieClip(root).StarsMC.addChild(new Bitmap(StarBitmap));
addChild(new Bitmap(TrailBitmap));
_local1 = 0;
while (_local1 < TotalParticles) {
TempPart.Next = new Particle();
_local1++;
TempPart = TempPart.Next;
};
_local1 = 0;
while (_local1 < 360) {
AngArrX[_local1] = Math.cos((_local1 * Radians));
AngArrY[_local1] = Math.sin((_local1 * Radians));
_local1++;
};
FirstEvent.Num = 500;
FirstEvent.Star = true;
}
public function PTCMain():void{
var _local1:Number;
var _local2:Number;
var _local3:int;
var _local4:uint;
var _local5:ParticleEvent;
if (MovieClip(root).Paused == false){
TrailBitmap.lock();
StarBitmap.lock();
if (DispX != CurX){
TrailBitmap.scroll((DispX - CurX), 0);
};
if (DispY != CurY){
TrailBitmap.scroll(0, (DispY - CurY));
};
if (SmokeyPTCs == false){
TrailBitmap.colorTransform(Rect, FadeTran2);
};
StarBitmap.fillRect(StarBitmap.rect, 0);
TempPart = First;
_local1 = 0;
_local2 = 0;
_local4 = 0;
for (;_local4 < TotalParticles;_local4++, (TempPart = TempPart.Next)) {
if (TempPart.Active == false){
if (FirstEvent != null){
if (FirstEvent.Star == false){
if (FirstEvent.Angle == -1){
_local3 = (Math.random() * 360);
} else {
_local3 = ((FirstEvent.Angle - FirstEvent.Offset) + (Math.random() * (FirstEvent.Offset << 1)));
while (_local3 < 0) {
_local3 = (_local3 + 360);
};
while (_local3 > 360) {
_local3 = (_local3 - 360);
};
};
TempPart.XThrust = AngArrX[_local3];
TempPart.YThrust = AngArrY[_local3];
TempPart.Thrust = (Math.random() * FirstEvent.Life);
TempPart.XPos = ((FirstEvent.XPos - FirstEvent.XDisp) + (Math.random() * (FirstEvent.XDisp << 1)));
TempPart.YPos = ((FirstEvent.YPos - FirstEvent.YDisp) + (Math.random() * (FirstEvent.YDisp << 1)));
TempPart.Col = FirstEvent.Col;
} else {
TempPart.XPos = (Math.random() * Width);
TempPart.YPos = (Math.random() * Height);
TempPart.Thrust = (0.1 + (Math.random() * 0.5));
TempPart.Star = true;
};
TempPart.Active = true;
PTCCount = (PTCCount + 1);
FirstEvent.Num--;
if (FirstEvent.Num <= 0){
_local5 = FirstEvent;
FirstEvent = FirstEvent.NextEvent;
_local5.NextEvent = MainEvent;
MainEvent = _local5;
MainEvent.ResetVars();
};
} else {
continue;
};
};
};
if (SmokeyPTCs){
TrailBitmap.applyFilter(TrailBitmap, Rect, new Point(0, 0), BlurFilt);
TrailBitmap.colorTransform(Rect, FadeTran);
};
TrailBitmap.unlock();
StarBitmap.unlock();
AddPTC = 0;
CurX = DispX;
CurY = DispY;
EventArray = new Array();
};
}
public function setSmokeyPTCs():void{
if (SmokeyPTCs){
SmokeyPTCs = false;
TrailBitmap.fillRect(TrailBitmap.rect, 0);
} else {
SmokeyPTCs = true;
};
}
public function newEvent(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:int, _arg6:Number, _arg7:uint, _arg8:Number=0, _arg9:Number=0):void{
var _local10:ParticleEvent;
_local10 = MainEvent;
_local10.XPos = _arg1;
_local10.YPos = _arg2;
_local10.Angle = _arg3;
_local10.Offset = _arg4;
_local10.Life = _arg6;
_local10.Num = _arg5;
_local10.Col = _arg7;
_local10.XDisp = _arg8;
_local10.YDisp = _arg9;
if (MainEvent.NextEvent != null){
MainEvent = MainEvent.NextEvent;
} else {
MainEvent = new ParticleEvent();
};
_local10.NextEvent = FirstEvent;
FirstEvent = _local10;
if (LowPTCs){
_local10.Num = (_local10.Num * 0.5);
};
}
public function SetPTCs():void{
if (LowPTCs){
LowPTCs = false;
} else {
LowPTCs = true;
};
}
}
}//package
Section 149
//PlaneLabel (PlaneLabel)
package {
import flash.display.*;
import flash.text.*;
public dynamic class PlaneLabel extends MovieClip {
public var labelText:TextField;
}
}//package
Section 150
//Pop1 (Pop1)
package {
import flash.media.*;
public dynamic class Pop1 extends Sound {
}
}//package
Section 151
//Pop2 (Pop2)
package {
import flash.media.*;
public dynamic class Pop2 extends Sound {
}
}//package
Section 152
//Pop3 (Pop3)
package {
import flash.media.*;
public dynamic class Pop3 extends Sound {
}
}//package
Section 153
//Restart (Restart)
package {
import flash.media.*;
public dynamic class Restart extends Sound {
}
}//package
Section 154
//Shot (Shot)
package {
import flash.display.*;
public class Shot extends MovieClip {
public var Active:Boolean;// = false
public var Speed:Number;// = 18
public var Countz:int;// = 0
public var MoveAngle:Number;// = 0
public var Turn:Number;// = 0.1
public var Allied:Boolean;// = true
public var NextShot:Shot;// = null
public var TimeLimit:int;// = -1
public var TargetUnit;
public var Ether:Boolean;// = false
public function Shot(){
NextShot = null;
Active = false;
Ether = false;
MoveAngle = 0;
Speed = 18;
Turn = 0.1;
Allied = true;
TimeLimit = -1;
Countz = 0;
super();
addFrameScript(0, frame1, 10, frame11, 12, frame13, 19, frame20, 26, frame27, 33, frame34, 40, frame41, 48, frame49, 50, frame51, 56, frame57, 66, frame67, 68, frame69, 75, frame76, 79, frame80, 87, frame88, 92, frame93, 96, frame97, 102, frame103, 103, frame104, 117, frame118, 124, frame125, 132, frame133, 140, frame141, 148, frame149, 156, frame157, 166, frame167, 170, frame171, 173, frame174, 176, frame177);
}
function frame157(){
this.Die();
}
function frame76(){
this.Die();
}
function frame80(){
this.Die();
}
function frame167(){
this.Die();
}
function frame88(){
this.Die();
}
function frame171(){
this.Die();
}
function frame177(){
gotoAndPlay("Smart");
}
function frame174(){
gotoAndPlay("Ether");
}
function frame93(){
this.Die();
}
function frame97(){
this.Die();
}
function frame103(){
if (this.visible){
MovieClip(root).BamfVar.play();
};
}
function frame104(){
this.Die();
}
function frame1(){
stop();
}
function frame20(){
this.Die();
}
function frame27(){
this.Die();
}
function frame13(){
this.Die();
}
public function Die(){
if (Active){
Active = false;
Countz = 0;
Ether = false;
Allied = true;
TargetUnit = null;
Speed = 18;
TimeLimit = -1;
MovieClip(this.parent).removeChild(this);
stop();
};
}
function frame118(){
this.Die();
}
function frame11(){
if (this.visible){
MovieClip(root).BamfVar.play();
};
}
function frame34(){
this.Die();
}
function frame41(){
this.Die();
}
function frame49(){
if (this.visible){
MovieClip(root).BamfVar.play();
};
}
function frame57(){
this.Die();
}
function frame51(){
this.Die();
}
function frame125(){
this.Die();
}
function frame141(){
this.Die();
}
function frame149(){
this.Die();
}
function frame67(){
if (this.visible){
MovieClip(root).BamfVar.play();
};
}
function frame133(){
this.Die();
}
function frame69(){
this.Die();
}
}
}//package
Section 155
//ShotEvent (ShotEvent)
package {
public class ShotEvent {
public var XPos:Number;// = 0
public var Allied:Boolean;
public var Type:String;
public var YPos:Number;// = 0
public var Rotation:Number;// = 0
public function ShotEvent(){
XPos = 0;
YPos = 0;
Rotation = 0;
super();
}
}
}//package
Section 156
//StingerHelper (StingerHelper)
package {
import flash.display.*;
import flash.events.*;
import com.caurina.transitions.*;
import flash.utils.*;
import flash.media.*;
import flash.text.*;
import flash.ui.*;
public dynamic class StingerHelper extends MovieClip {
private static var GAME_NAMES:Array = ["Vector TD2", "Headcase", "Insurgo", "Jetboost", "Linegolfer", "Good Ol' Poker", "Polarity", "Pow Pool", "Streetball Jam", "Slipstream", "GP Team Challenge", "Hockey Face-Off", "Candystand Baseball", "Flash Circle TD", "Gemworks", "Monster Trucks", "RC Rally Reloaded", "Roaring Waves", "Spherez", "Ultimate Raceway"];
private static var GAME_LINKS:Array = ["http://www.candystand.com/play.do?id=18281", "http://www.candystand.com/play.do?id=18252", "http://www.candystand.com/play.do?id=18303", "http://www.candystand.com/play.do?id=18189", "http://www.candystand.com/play.do?id=18253", "http://www.candystand.com/play.do?id=18316", "http://www.candystand.com/play.do?id=17986", "http://www.candystand.com/play.do?id=18201", "http://www.candystand.com/play.do?id=18309", "http://www.candystand.com/play.do?id=18290", "http://www.candystand.com/play.do?id=18049", "http://www.candystand.com/play.do?id=18209", "http://www.candystand.com/play.do?id=18210", "http://www.candystand.com/play.do?id=17995", "http://www.candystand.com/play.do?id=18317", "http://www.candystand.com/play.do?id=17974", "http://www.candystand.com/play.do?id=18193", "http://www.candystand.com/play.do?id=18286", "http://www.candystand.com/play.do?id=17994", "http://www.candystand.com/play.do?id=18254"];
private static var GAME_ID:Number = 18347;
public function StingerHelper():void{
var _local1:*;
super();
MovieClip(root).stop();
_local1 = new cs_audio();
_local1.play(0);
MovieClip(root).stinger3D.onAddedToStage(GAME_NAMES, GAME_LINKS, GAME_ID);
MovieClip(root).playButton.tabEnabled = false;
MovieClip(root).playButton.buttonMode = false;
MovieClip(root).playButton.addEventListener(MouseEvent.ROLL_OVER, onRollOverHandler, false, 0, true);
MovieClip(root).playButton.addEventListener(MouseEvent.ROLL_OUT, onRollOutHandler, false, 0, true);
MovieClip(root).playButton.addEventListener(MouseEvent.CLICK, onReleaseHandler, false, 0, true);
}
private function onReleaseHandler(_arg1:MouseEvent):void{
MovieClip(root).stinger3D.destroy();
MovieClip(root).play();
}
private function onRollOutHandler(_arg1:MouseEvent):void{
Tweener.addTween(_arg1.target, {scaleX:1.45, scaleY:1.45, time:0.5, transition:"easeOutExpo"});
}
private function onRollOverHandler(_arg1:MouseEvent):void{
Tweener.addTween(_arg1.target, {scaleX:1.75, scaleY:1.75, time:0.5, transition:"easeOutExpo"});
}
}
}//package
Section 157
//Unit (Unit)
package {
import flash.display.*;
public class Unit extends MovieClip {
public var ShotSpace:int;// = 0
public var YellowTeir:int;// = 0
public var AimSpeed:Number;// = 360
public var Speed:Number;
public var ShotTimer:int;// = 0
public var Calc:int;
public var RadarDot:Dot;
public var Turn:Number;// = 0
public var AimAngle:Number;// = 0
public var TargetX:Number;// = 0
public var TargetY:Number;// = 0
public var TargetUnit;
public var Accel:Number;// = 1
public var YellowCount:Number;// = 0
public var TargetDist:Number;// = 9999
public var FollowRed:int;// = 0
public var Perm:Boolean;// = false
public var HeroHit:Boolean;// = false
public var Gun:MovieClip;
public var Aim:MovieClip;
public var Active:Boolean;// = false
public var Range:Number;// = 0
public var NextUnit:Unit;
public var Type:String;
public var MoveAngle:Number;
public var Delay:Number;// = 3
public var DelayCount:Number;// = 0
public var Revive:Number;// = 0
public var DodgeX:Number;// = 0
public var DodgeY:Number;// = 0
public var Shield:Number;// = 0
public var Damage:Number;// = 0
public var NextY:Number;// = 0
public var Allied:Boolean;
public var NextX:Number;// = 0
public var HeroLastHit:Boolean;// = false
public var Rot:MovieClip;
public var Ani:MovieClip;
public var Priority:int;
public var MissPopMC:MovieClip;
public var HitPopMC:MovieClip;
public var HealthBar:MovieClip;
public function Unit(){
Active = false;
Range = 0;
Perm = false;
Shield = 0;
Damage = 0;
Revive = 0;
Delay = 3;
DelayCount = 0;
HeroHit = false;
HeroLastHit = false;
TargetX = 0;
TargetY = 0;
TargetDist = 9999;
AimSpeed = 360;
AimAngle = 0;
ShotTimer = 0;
ShotSpace = 0;
YellowTeir = 0;
FollowRed = 0;
YellowCount = 0;
NextX = 0;
NextY = 0;
DodgeX = 0;
DodgeY = 0;
MoveAngle = (-(Math.PI) + ((Math.random() * Math.PI) * 2));
Accel = 1;
Turn = 0;
RadarDot = new Dot();
super();
addFrameScript(0, frame1);
}
public function Die(){
var _local1:int;
if (this.visible){
MovieClip(root).BlamVar.play();
MovieClip(root).CamMC.ScreenShake = (MovieClip(root).CamMC.ScreenShake + 5);
};
_local1 = 0;
while (_local1 < MovieClip(root).CamMC.Yellows.length) {
if (this == MovieClip(root).CamMC.Yellows[_local1]){
MovieClip(root).CamMC.Yellows[_local1] = null;
};
_local1++;
};
MovieClip(root).RadarMC.DotsMC.removeChild(RadarDot);
switch (Type){
case "A0":
MovieClip(root).EpicBoomVar.play();
MovieClip(root).GameOver();
MovieClip(root).ParticleSystemMC.newEvent(this.x, this.y, -1, 30, 2000, 20, 4278255615, 50, 50);
break;
case "A1":
MovieClip(root).ParticleSystemMC.newEvent(this.x, this.y, -1, 30, 300, 5, 4278233855, 20, 20);
break;
case "A3":
MovieClip(root).ParticleSystemMC.newEvent(this.x, this.y, -1, 30, 150, 8, 4294902015, 20, 20);
MovieClip(root).ParticleSystemMC.newEvent(this.x, this.y, -1, 30, 150, 6, 4294901845, 20, 20);
break;
case "A4":
MovieClip(root).ParticleSystemMC.newEvent(this.x, this.y, -1, 30, 150, 8, 4294936576, 20, 20);
MovieClip(root).ParticleSystemMC.newEvent(this.x, this.y, -1, 30, 150, 6, 4294967040, 20, 20);
break;
case "A5":
MovieClip(root).ParticleSystemMC.newEvent(this.x, this.y, -1, 30, 150, 8, 4294936576, 20, 20);
MovieClip(root).ParticleSystemMC.newEvent(this.x, this.y, -1, 30, 150, 6, 4281597696, 20, 20);
break;
case "A6":
MovieClip(root).ParticleSystemMC.newEvent(this.x, this.y, -1, 30, 150, 8, 4278255615, 20, 20);
MovieClip(root).ParticleSystemMC.newEvent(this.x, this.y, -1, 30, 150, 6, 4278255496, 20, 20);
break;
case "A7":
MovieClip(root).ParticleSystemMC.newEvent(this.x, this.y, -1, 30, 150, 8, 4294945280, 20, 20);
MovieClip(root).ParticleSystemMC.newEvent(this.x, this.y, -1, 30, 150, 6, 4294901760, 20, 20);
break;
case "A8":
MovieClip(root).ParticleSystemMC.newEvent(this.x, this.y, -1, 30, 150, 8, 4294967295, 20, 20);
MovieClip(root).ParticleSystemMC.newEvent(this.x, this.y, -1, 30, 150, 6, 4288256409, 20, 20);
break;
case "E0":
MovieClip(root).RedDead++;
if (MovieClip(root).RedDead >= 1){
MovieClip(root).Fader.gotoAndPlay("FadeIn");
} else {
MovieClip(root).ParticleSystemMC.newEvent(this.x, this.y, -1, 15, 5000, 20, 4294901760, 50, 50);
MovieClip(root).ParticleSystemMC.newEvent(this.x, this.y, -1, 15, 5000, 20, 4294901811, 50, 50);
};
MovieClip(root).EpicBoomVar.play();
break;
case "E1":
MovieClip(root).ParticleSystemMC.newEvent(this.x, this.y, -1, 30, 1000, 10, 4294967040, 25, 25);
MovieClip(root).ParticleSystemMC.newEvent(this.x, this.y, -1, 30, 1000, 10, 4294914816, 25, 25);
MovieClip(root).EpicBoomVar.play();
break;
case "E3":
MovieClip(root).ParticleSystemMC.newEvent(this.x, this.y, -1, 30, 150, 8, 4278216447, 20, 20);
MovieClip(root).ParticleSystemMC.newEvent(this.x, this.y, -1, 30, 150, 6, 4278242559, 20, 20);
break;
case "E4":
MovieClip(root).ParticleSystemMC.newEvent(this.x, this.y, -1, 30, 200, 10, 4289396480, 40, 40);
MovieClip(root).ParticleSystemMC.newEvent(this.x, this.y, -1, 30, 200, 8, 4278255360, 40, 40);
break;
case "E5":
MovieClip(root).ParticleSystemMC.newEvent(this.x, this.y, -1, 30, 200, 10, 4294901760, 40, 40);
MovieClip(root).ParticleSystemMC.newEvent(this.x, this.y, -1, 30, 200, 8, 4294901845, 40, 40);
break;
case "E6":
MovieClip(root).ParticleSystemMC.newEvent(this.x, this.y, -1, 30, 200, 10, 4294967040, 40, 40);
MovieClip(root).ParticleSystemMC.newEvent(this.x, this.y, -1, 30, 200, 8, 4294901862, 40, 40);
break;
case "E7":
MovieClip(root).ParticleSystemMC.newEvent(this.x, this.y, -1, 30, 200, 10, 4289374890, 40, 40);
break;
};
HeroHit = false;
Active = false;
Range = 0;
Type = "";
Shield = 0;
Damage = 0;
Revive = 0;
TargetUnit = null;
TargetX = 0;
TargetY = 0;
TargetDist = 9999;
DelayCount = 0;
AimSpeed = 360;
AimAngle = 0;
ShotTimer = 0;
ShotSpace = 0;
NextX = 0;
NextY = 0;
DodgeX = 0;
DodgeY = 0;
MoveAngle = (-(Math.PI) + ((Math.random() * Math.PI) * 2));
Speed = 0;
Accel = 1;
Turn = 0;
this.parent.removeChild(this);
}
function frame1(){
stop();
}
}
}//package
Section 158
//UnitEvent (UnitEvent)
package {
public class UnitEvent {
public var Building:Boolean;
public var Num:int;
public var Offset:Boolean;
public var Type:String;
public var YPos:Number;
public var XPos:Number;
public var Allied:Boolean;
}
}//package