Section 1
//FreeCamera3D (org.papervision3d.cameras.FreeCamera3D)
package org.papervision3d.cameras {
import org.papervision3d.core.proto.*;
public class FreeCamera3D extends CameraObject3D {
public function FreeCamera3D(_arg1:Number=2, _arg2:Number=100, _arg3:Object=null){
super(_arg1, _arg2, _arg3);
}
}
}//package org.papervision3d.cameras
Section 2
//Face3D (org.papervision3d.core.geom.Face3D)
package org.papervision3d.core.geom {
import flash.display.*;
import flash.geom.*;
import org.papervision3d.core.proto.*;
import org.papervision3d.*;
import org.papervision3d.core.*;
public class Face3D {
public var vertices:Array;
public var id:Number;
public var uv:Array;
private var _a:Number;
private var _b:Number;
private var _d:Number;
public var material:MaterialObject3D;
private var _tx:Number;
private var _c:Number;
public var screenZ:Number;
public var visible:Boolean;
public var materialBack:MaterialObject3D;
private var _ty:Number;
private static var _totalFaces:Number = 0;
private static var _bitmapMatrix:Matrix;
public function Face3D(_arg1:Array, _arg2:MaterialObject3D=null, _arg3:Array=null){
this.vertices = _arg1;
this.material = _arg2;
this.uv = _arg3;
if (((((_arg3) && (_arg2))) && (_arg2.bitmap))){
transformUV();
};
this.id = _totalFaces++;
if (!(_bitmapMatrix)){
_bitmapMatrix = new Matrix();
};
}
public function transformUV(_arg1:MaterialObject3D=null):void{
var _local2:MaterialObject3D;
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;
_local2 = ((this.material) || (_arg1));
if (((_local2) && (_local2.bitmap))){
_local3 = this.uv;
_local4 = _local2.bitmap.width;
_local5 = _local2.bitmap.height;
_local6 = (_local3[0].u * _local4);
_local7 = (_local3[0].v * _local5);
_local8 = (_local3[1].u * _local4);
_local9 = (_local3[1].v * _local5);
_local10 = (_local3[2].u * _local4);
_local11 = (_local3[2].v * _local5);
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();
this._a = _local16.a;
this._b = _local16.b;
this._c = _local16.c;
this._d = _local16.d;
this._tx = _local16.tx;
this._ty = _local16.ty;
} else {
Papervision3D.log("Face3D: transformUV() material.bitmap not found!");
};
}
public function render(_arg1:Sprite, _arg2:MaterialObject3D=null, _arg3:Boolean=false):Number{
var _local4:Array;
var _local5:Number3D;
var _local6:Number3D;
var _local7:Number3D;
var _local8:Number;
var _local9:Number;
var _local10:Number;
var _local11:Number;
var _local12:Number;
var _local13:Number;
var _local14:MaterialObject3D;
var _local15:BitmapData;
var _local16:Number;
var _local17:Number;
var _local18:Number;
var _local19:Number;
var _local20:Number;
var _local21:Number;
var _local22:Number;
var _local23:Number;
var _local24:Number;
var _local25:Number;
var _local26:Number;
var _local27:Number;
var _local28:Matrix;
_local4 = this.vertices;
_local5 = _local4[0].screen;
_local6 = _local4[1].screen;
_local7 = _local4[2].screen;
_local8 = _local5.x;
_local9 = _local5.y;
_local10 = _local6.x;
_local11 = _local6.y;
_local12 = _local7.x;
_local13 = _local7.y;
_local14 = ((this.material) || (_arg2));
if (((_local14.oneSide) && (((((_local12 - _local8) * (_local11 - _local9)) - ((_local13 - _local9) * (_local10 - _local8))) < 0)))){
if (materialBack){
_local14 = materialBack;
} else {
return (0);
};
};
if (_local14.invisible){
return (0);
};
_local15 = _local14.bitmap;
_local16 = _local14.fillAlpha;
_local17 = _local14.lineAlpha;
if (_arg3){
_arg1.graphics.beginFill((Math.random() * 0xFFFFFF));
} else {
if (_local15){
_local18 = this._a;
_local19 = this._b;
_local20 = this._c;
_local21 = this._d;
_local22 = this._tx;
_local23 = this._ty;
_local24 = (_local10 - _local8);
_local25 = (_local11 - _local9);
_local26 = (_local12 - _local8);
_local27 = (_local13 - _local9);
_local28 = _bitmapMatrix;
_local28.a = ((_local18 * _local24) + (_local19 * _local26));
_local28.b = ((_local18 * _local25) + (_local19 * _local27));
_local28.c = ((_local20 * _local24) + (_local21 * _local26));
_local28.d = ((_local20 * _local25) + (_local21 * _local27));
_local28.tx = (((_local22 * _local24) + (_local23 * _local26)) + _local8);
_local28.ty = (((_local22 * _local25) + (_local23 * _local27)) + _local9);
_arg1.graphics.beginBitmapFill(_local15, _local28, false, _local14.smooth);
} else {
if (_local16){
_arg1.graphics.beginFill(_local14.fillColor, _local16);
};
};
};
if (_local17){
_arg1.graphics.lineStyle(0, _local14.lineColor, _local17);
} else {
_arg1.graphics.lineStyle();
};
_arg1.graphics.moveTo(_local8, _local9);
_arg1.graphics.lineTo(_local10, _local11);
_arg1.graphics.lineTo(_local12, _local13);
if (_local17){
_arg1.graphics.lineTo(_local8, _local9);
};
if (((_local15) || (_local16))){
_arg1.graphics.endFill();
};
return (1);
}
}
}//package org.papervision3d.core.geom
Section 3
//Vertex3D (org.papervision3d.core.geom.Vertex3D)
package org.papervision3d.core.geom {
import org.papervision3d.core.*;
public class Vertex3D {
public var visible:Boolean;
public var toScale:Number3D;
public var screen:Number3D;
public var extra:Object;
public var x:Number;
public var y:Number;
public var z:Number;
public var toRotate:Number3D;
public function Vertex3D(_arg1:Number=0, _arg2:Number=0, _arg3:Number=0){
this.x = _arg1;
this.y = _arg2;
this.z = _arg3;
this.toScale = new Number3D(_arg1, _arg2, _arg3);
this.toRotate = new Number3D(_arg1, _arg2, _arg3);
this.screen = Number3D.ZERO;
this.visible = false;
}
}
}//package org.papervision3d.core.geom
Section 4
//CameraObject3D (org.papervision3d.core.proto.CameraObject3D)
package org.papervision3d.core.proto {
import org.papervision3d.core.*;
public class CameraObject3D extends DisplayObject3D {
public var cos:Number3D;
public var sort:Boolean;
public var zoom:Number;
public var focus:Number;
public var sin:Number3D;
public static var DEFAULT_ZOOM:Number = 3;
public static var DEFAULT_FOCUS:Number = 500;
public static var DEFAULT_Z:Number = -1000;
public function CameraObject3D(_arg1:Number=2, _arg2:Number=100, _arg3:Object=null){
super(_arg3);
this.z = (_arg3) ? ((_arg3.x) || (DEFAULT_Z)) : DEFAULT_Z;
this.zoom = _arg1;
this.focus = _arg2;
this.sort = (_arg3) ? !((_arg3.sort == false)) : true;
this.sin = new Number3D();
this.cos = new Number3D();
}
public function transform():void{
var _local1:Number;
var _local2:Number;
var _local3:Number;
var _local4:Number3D;
var _local5:Number3D;
_local1 = this._rotationX;
_local2 = this._rotationY;
_local3 = this._rotationZ;
_local4 = this.cos;
_local5 = this.sin;
_local4.x = Math.cos(_local1);
_local5.x = Math.sin(_local1);
_local4.y = Math.cos(_local2);
_local5.y = Math.sin(_local2);
_local4.z = Math.cos(_local3);
_local5.z = Math.sin(_local3);
}
}
}//package org.papervision3d.core.proto
Section 5
//DisplayObject3D (org.papervision3d.core.proto.DisplayObject3D)
package org.papervision3d.core.proto {
import org.papervision3d.core.*;
import flash.display.*;
import flash.events.*;
public class DisplayObject3D extends EventDispatcher {
public var y:Number;
protected var _container:Sprite;
public var scene:SceneObject3D;
public var extra:Object;
protected var _rotationZ:Number;
protected var _rotationX:Number;
protected var _rotationY:Number;
protected var _scale:Boolean;
protected var _rotation:Boolean;
protected var _scaleX:Number;
public var screenZ:Number;
protected var _scaleZ:Number;
public var visible:Boolean;
protected var _scaleY:Number;
public var x:Number;
public var z:Number;
public static var BACKWARD:Number3D = new Number3D(0, 0, -1);
public static var PERCENT:Boolean = false;
public static var DEGREES:Boolean = true;
public static var DOWN:Number3D = new Number3D(0, 1, 0);
public static var FORWARD:Number3D = new Number3D(0, 0, 1);
public static var LEFT:Number3D = new Number3D(-1, 0, 0);
public static var UP:Number3D = new Number3D(0, -1, 0);
public static var RIGHT:Number3D = new Number3D(1, 0, 1);
public function DisplayObject3D(_arg1:Object=null):void{
var _local2:Number;
super();
this.x = (_arg1) ? ((_arg1.x) || (0)) : 0;
this.y = (_arg1) ? ((_arg1.y) || (0)) : 0;
this.z = (_arg1) ? ((_arg1.z) || (0)) : 0;
rotationX = (_arg1) ? ((_arg1.rotationX) || (0)) : 0;
rotationY = (_arg1) ? ((_arg1.rotationY) || (0)) : 0;
rotationZ = (_arg1) ? ((_arg1.rotationZ) || (0)) : 0;
this._rotation = (((((this._rotationX == 0)) && ((this._rotationY == 0)))) && ((this._rotationZ == 0)));
_local2 = (PERCENT) ? 100 : 1;
scaleX = (_arg1) ? ((_arg1.scaleX) || (_local2)) : _local2;
scaleY = (_arg1) ? ((_arg1.scaleY) || (_local2)) : _local2;
scaleZ = (_arg1) ? ((_arg1.scaleZ) || (_local2)) : _local2;
this._scale = (((((this._scaleX == 1)) && ((this._scaleY == 1)))) && ((this._scaleZ == 1)));
if (((_arg1) && (_arg1.extra))){
this.extra = _arg1.extra;
};
if (((_arg1) && (_arg1.container))){
this.container = _arg1.container;
};
this.visible = (_arg1) ? !((_arg1.visible == false)) : true;
}
public function set container(_arg1:Sprite):void{
this._container = _arg1;
}
public function get container():Sprite{
return (this._container);
}
public function moveDown(_arg1:Number):void{
translate(_arg1, DOWN);
}
public function set scale(_arg1:Number):void{
if (PERCENT){
_arg1 = (_arg1 / 100);
};
this._scaleX = (this._scaleY = (this._scaleZ = _arg1));
this._scale = true;
}
public function render(_arg1:SceneObject3D):void{
}
public function project(_arg1:CameraObject3D):void{
}
public function get rotationX():Number{
if (DEGREES){
return (rad2deg(this._rotationX));
};
return (this._rotationX);
}
public function get rotationY():Number{
if (DEGREES){
return (rad2deg(this._rotationY));
};
return (this._rotationY);
}
public function get rotationZ():Number{
if (DEGREES){
return (rad2deg(this._rotationZ));
};
return (this._rotationZ);
}
public function set scaleY(_arg1:Number):void{
if (PERCENT){
this._scaleY = (_arg1 / 100);
} else {
this._scaleY = _arg1;
};
this._scale = true;
}
public function set scaleZ(_arg1:Number):void{
if (PERCENT){
this._scaleZ = (_arg1 / 100);
} else {
this._scaleZ = _arg1;
};
this._scale = true;
}
public function set scaleX(_arg1:Number):void{
if (PERCENT){
this._scaleX = (_arg1 / 100);
} else {
this._scaleX = _arg1;
};
this._scale = true;
}
private function deg2rad(_arg1:Number):Number{
return (((Math.PI * _arg1) / 180));
}
private function rad2deg(_arg1:Number):Number{
return (((180 * _arg1) / Math.PI));
}
public function set rotationX(_arg1:Number):void{
if (DEGREES){
this._rotationX = deg2rad(_arg1);
} else {
this._rotationX = _arg1;
};
this._rotation = true;
}
public function set rotationY(_arg1:Number):void{
if (DEGREES){
this._rotationY = deg2rad(_arg1);
} else {
this._rotationY = _arg1;
};
this._rotation = true;
}
public function set rotationZ(_arg1:Number):void{
if (DEGREES){
this._rotationZ = deg2rad(_arg1);
} else {
this._rotationZ = _arg1;
};
this._rotation = true;
}
public function moveForward(_arg1:Number):void{
translate(_arg1, FORWARD);
}
public function moveRight(_arg1:Number):void{
translate(_arg1, RIGHT);
}
public function moveUp(_arg1:Number):void{
translate(_arg1, UP);
}
public function get scaleX():Number{
if (PERCENT){
return ((this._scaleX * 100));
};
return (this._scaleX);
}
public function get scaleY():Number{
if (PERCENT){
return ((this._scaleY * 100));
};
return (this._scaleY);
}
public function get scaleZ():Number{
if (PERCENT){
return ((this._scaleZ * 100));
};
return (this._scaleZ);
}
public function translate(_arg1:Number, _arg2:Number3D):void{
var _local3:Number3D;
_local3 = _arg2.clone();
rotate(_local3);
this.x = (this.x + (_arg1 * _local3.x));
this.y = (this.y + (_arg1 * _local3.y));
this.z = (this.z + (_arg1 * _local3.z));
}
public function get scale():Number{
if ((((this._scaleX == this._scaleY)) && ((this._scaleX == this._scaleZ)))){
if (PERCENT){
return ((this._scaleX * 100));
};
return (this._scaleX);
//unresolved jump
};
return (NaN);
}
public function moveBackward(_arg1:Number):void{
translate(_arg1, BACKWARD);
}
public function rotate(_arg1:Number3D):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;
var _local15:Number;
var _local16:Number;
var _local17:Number;
var _local18:Number;
var _local19:Number;
_local2 = _arg1.x;
_local3 = _arg1.y;
_local4 = _arg1.z;
_local5 = this._rotationX;
_local6 = this._rotationY;
_local7 = this._rotationZ;
_local8 = Math.cos(_local5);
_local9 = Math.sin(_local5);
_local10 = Math.cos(_local6);
_local11 = Math.sin(_local6);
_local12 = Math.cos(_local7);
_local13 = Math.sin(_local7);
_local14 = ((_local2 * _local12) - (_local3 * _local13));
_local15 = ((_local3 * _local12) + (_local2 * _local13));
_local16 = ((_local14 * _local10) - (_local4 * _local11));
_local17 = ((_local4 * _local10) + (_local14 * _local11));
_local18 = ((_local15 * _local8) - (_local17 * _local9));
_local19 = ((_local17 * _local8) + (_local15 * _local9));
_arg1.x = _local16;
_arg1.y = _local18;
_arg1.z = _local19;
}
override public function toString():String{
return (((((("x:" + Math.round(this.x)) + " y:") + Math.round(this.y)) + " z:") + Math.round(this.z)));
}
public function moveLeft(_arg1:Number):void{
translate(_arg1, LEFT);
}
public static function get ZERO():DisplayObject3D{
return (new (DisplayObject3D));
}
}
}//package org.papervision3d.core.proto
Section 6
//MaterialObject3D (org.papervision3d.core.proto.MaterialObject3D)
package org.papervision3d.core.proto {
import flash.display.*;
public class MaterialObject3D {
public var lineAlpha:Number;
public var scene:SceneObject3D;
public var lineColor:Number;
public var fillAlpha:Number;
public var oneSide:Boolean;
public var fillColor:Number;
public var animated:Boolean;
public var invisible:Boolean;
public var smooth:Boolean;
public var bitmap:BitmapData;
public static var DEFAULT_COLOR:Number = 0xFF00FF;
public function MaterialObject3D(_arg1:Object=null){
if (((_arg1) && (_arg1.bitmap))){
this.bitmap = _arg1.bitmap;
};
this.lineColor = (_arg1) ? ((_arg1.lineColor) || (DEFAULT_COLOR)) : DEFAULT_COLOR;
this.lineAlpha = (_arg1) ? ((_arg1.lineAlpha) || (0)) : 0;
this.fillColor = (_arg1) ? ((_arg1.fillColor) || (DEFAULT_COLOR)) : DEFAULT_COLOR;
this.fillAlpha = (_arg1) ? ((_arg1.fillAlpha) || (0)) : 0;
this.animated = (_arg1) ? ((_arg1.animated) || (false)) : false;
this.invisible = (_arg1) ? ((_arg1.invisible) || (false)) : false;
this.smooth = (_arg1) ? ((_arg1.smooth) || (false)) : false;
this.oneSide = (_arg1) ? !((_arg1.oneSide == false)) : true;
}
public function updateBitmap():void{
}
public function toString():String{
return (((((("[MaterialObject3D] bitmap:" + this.bitmap) + " lineColor:") + this.lineColor) + " fillColor:") + fillColor));
}
public static function get DEFAULT():MaterialObject3D{
var _local1:MaterialObject3D;
_local1 = new (MaterialObject3D);
_local1.lineColor = DEFAULT_COLOR;
_local1.lineAlpha = 100;
_local1.fillColor = DEFAULT_COLOR;
_local1.fillAlpha = 10;
_local1.oneSide = false;
return (_local1);
}
}
}//package org.papervision3d.core.proto
Section 7
//SceneObject3D (org.papervision3d.core.proto.SceneObject3D)
package org.papervision3d.core.proto {
import org.papervision3d.*;
import flash.display.*;
import flash.utils.*;
public class SceneObject3D {
public var container:Sprite;
public var materials:Array;
public var objects:Array;
public var stats:Object;
public function SceneObject3D(_arg1:Sprite){
if (_arg1){
this.container = _arg1;
} else {
Papervision3D.log("Scene3D: container argument required.");
};
this.objects = new Array();
this.materials = new Array();
Papervision3D.log((((((((Papervision3D.NAME + " ") + Papervision3D.VERSION) + "\nRevision ") + Papervision3D.REVISION) + " (") + Papervision3D.DATE) + ")\n"));
this.stats = new Object();
this.stats.points = 0;
this.stats.polys = 0;
this.stats.triangles = 0;
this.stats.performance = 0;
this.stats.rendered = 0;
}
protected function renderObjects(_arg1:Boolean):void{
}
public function push(_arg1):void{
if ((_arg1 is DisplayObject3D)){
this.objects.push(_arg1);
_arg1.scene = this;
} else {
if ((_arg1 is MaterialObject3D)){
this.materials.push(_arg1);
_arg1.scene = this;
} else {
Papervision3D.log("SceneObject3D.push(): Object not recognized. Must be Material3D or DisplayObject3D descendants.");
};
};
}
public function renderCamera(_arg1:CameraObject3D):void{
var _local2:Object;
var _local3:MaterialObject3D;
var _local4:Array;
var _local5:Number;
var _local6:Boolean;
var _local7:Array;
var _local8:DisplayObject3D;
_local2 = this.stats;
_local2.performance = getTimer();
_local4 = this.materials;
_local5 = _local4.length;
while ((_local3 = _local4[--_local5])) {
if (_local3.animated){
_local3.updateBitmap();
};
};
if (_arg1){
_arg1.transform();
_local7 = this.objects;
_local5 = _local7.length;
while ((_local8 = _local7[--_local5])) {
if (_local8.visible){
_local8.project(_arg1);
};
};
};
_local6 = _arg1.sort;
if (_local6){
this.objects.sortOn("screenZ", Array.NUMERIC);
};
_local2.rendered = 0;
renderObjects(_local6);
}
}
}//package org.papervision3d.core.proto
Section 8
//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 clone():Number3D{
return (new Number3D(this.x, this.y, this.z));
}
public static function get ZERO():Number3D{
return (new Number3D(0, 0, 0));
}
}
}//package org.papervision3d.core
Section 9
//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 10
//BitmapMaterial (org.papervision3d.materials.BitmapMaterial)
package org.papervision3d.materials {
import org.papervision3d.core.proto.*;
import flash.display.*;
public class BitmapMaterial extends MaterialObject3D {
protected var _texture;
public function BitmapMaterial(_arg1, _arg2:Object=null){
super(_arg2);
texture = _arg1;
}
protected function createBitmap(_arg1):BitmapData{
return (_arg1);
}
public function get texture(){
return (this._texture);
}
override public function toString():String{
return (((((("Texture:" + this.texture) + " lineColor:") + this.lineColor) + " lineAlpha:") + this.lineAlpha));
}
public function set texture(_arg1):void{
this.bitmap = createBitmap(_arg1);
this._texture = _arg1;
}
}
}//package org.papervision3d.materials
Section 11
//Mesh (org.papervision3d.objects.Mesh)
package org.papervision3d.objects {
import org.papervision3d.core.*;
import org.papervision3d.core.proto.*;
import org.papervision3d.core.geom.*;
import flash.display.*;
public class Mesh extends Points {
protected var _material:MaterialObject3D;
protected var _visibleNow:Boolean;
public var showFaces:Boolean;
public var faces:Array;
public var sortFaces:Boolean;
public function Mesh(_arg1:MaterialObject3D, _arg2:Array, _arg3:Array, _arg4:Object=null){
super(_arg2, _arg4);
this.faces = ((_arg3) || (new Array()));
this._material = ((_arg1) || (MaterialObject3D.DEFAULT));
this.sortFaces = (_arg4) ? !((_arg4.sortFaces == false)) : true;
this.showFaces = (_arg4) ? ((_arg4.showFaces) || (false)) : false;
}
override public function render(_arg1:SceneObject3D):void{
var _local2:Array;
var _local3:Sprite;
var _local4:MaterialObject3D;
var _local5:Boolean;
var _local6:Number;
var _local7:Face3D;
var _local8:int;
if (this._visibleNow){
_local2 = this.faces;
if (this.sortFaces){
_local2.sortOn("screenZ", (Array.DESCENDING | Array.NUMERIC));
};
_local3 = ((this._container) || (_arg1.container));
_local4 = this._material;
_local5 = this.showFaces;
_local6 = 0;
_local8 = 0;
while ((_local7 = _local2[_local8])) {
if (_local7.visible){
_local6 = (_local6 + _local7.render(_local3, _local4, _local5));
};
_local8++;
};
_arg1.stats.rendered = (_arg1.stats.rendered + _local6);
};
}
override public function project(_arg1:CameraObject3D):void{
var _local2:Array;
var _local3:Number;
var _local4:Number;
var _local5:Object;
var _local6:int;
var _local7:Vertex3D;
var _local8:Vertex3D;
var _local9:Vertex3D;
var _local10:Number;
super.project(_arg1);
_local2 = this.faces;
_local3 = 0;
_local4 = 0;
_local6 = 0;
while ((_local5 = _local2[_local6])) {
_local7 = _local5.vertices[0];
_local8 = _local5.vertices[1];
_local9 = _local5.vertices[2];
_local10 = ((Number(_local7.visible) + Number(_local8.visible)) + Number(_local9.visible));
_local5.visible = (_local10 == 3);
if (_local5.visible){
_local3 = (_local3 + (_local5.screenZ = (((_local7.screen.z + _local8.screen.z) + _local9.screen.z) / 3)));
_local4++;
};
_local6++;
};
this._visibleNow = (_local4 > 0);
if (this._visibleNow){
this.screenZ = (_local3 / _local4);
};
}
public function transformUV(_arg1:MaterialObject3D):void{
var _local2:String;
if (_arg1.bitmap){
for (_local2 in this.faces) {
faces[_local2].transformUV(_arg1);
};
};
}
public function projectTexture(_arg1:String, _arg2:String):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;
_arg1 = ((_arg1) || ("x"));
_arg2 = ((_arg2) || ("y"));
_local3 = this.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];
if (((_local9) && (_local9.bitmap))){
_local11.transformUV(_local9);
};
};
}
public function get material():MaterialObject3D{
return (this._material);
}
public function set material(_arg1:MaterialObject3D):void{
transformUV(_arg1);
this._material = _arg1;
}
}
}//package org.papervision3d.objects
Section 12
//Plane (org.papervision3d.objects.Plane)
package org.papervision3d.objects {
import org.papervision3d.core.*;
import org.papervision3d.core.proto.*;
import org.papervision3d.core.geom.*;
public class Plane extends Mesh {
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(), _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.vertices;
_local8 = this.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((1 - (_local13 / _local3)), (_local17 / _local4));
_local15 = new NumberUV((1 - (_local13 / _local3)), ((_local17 + 1) / _local4));
_local16 = new NumberUV((1 - ((_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((1 - ((_local13 + 1) / _local3)), ((_local17 + 1) / _local4));
_local15 = new NumberUV((1 - ((_local13 + 1) / _local3)), (_local17 / _local4));
_local16 = new NumberUV((1 - (_local13 / _local3)), ((_local17 + 1) / _local4));
_local8.push(new Face3D([_local20, _local22, _local21], null, [_local14, _local16, _local15]));
_local17++;
};
_local13++;
};
transformUV(this._material);
}
}
}//package org.papervision3d.objects
Section 13
//Points (org.papervision3d.objects.Points)
package org.papervision3d.objects {
import org.papervision3d.core.*;
import org.papervision3d.core.geom.*;
import org.papervision3d.core.proto.*;
public class Points extends DisplayObject3D {
public var vertices:Array;
public function Points(_arg1:Array, _arg2:Object){
super(_arg2);
this.vertices = ((_arg1) || (new Array()));
}
public function boundingBox():Object{
var _local1:Object;
var _local2:Object;
var _local3:String;
var _local4:Vertex3D;
_local1 = this.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);
}
override public function project(_arg1:CameraObject3D):void{
var _local2:Number;
var _local3:Number;
var _local4:Number;
var _local5:Number3D;
var _local6:Number;
var _local7:Number;
var _local8:Number;
var _local9:Number3D;
var _local10:Number;
var _local11:Number;
var _local12:Number;
var _local13:Vertex3D;
var _local14:Array;
var _local15:Number;
var _local16:Number;
var _local17:Number;
var _local18:Number3D;
var _local19:Number;
var _local20:Number;
var _local21:Number;
var _local22:Number;
var _local23:Number;
var _local24:Number;
var _local25:Number;
var _local26:Number;
var _local27:Number;
var _local28:Number;
if (this._scale){
updateScale(this.vertices, new Number3D(this._scaleX, this._scaleY, this._scaleZ));
this._scale = false;
this._rotation = true;
};
if (this._rotation){
updateRotation(this.vertices, new Number3D(this._rotationX, this._rotationY, this._rotationZ));
this._rotation = false;
};
_local2 = _arg1.x;
_local3 = _arg1.y;
_local4 = _arg1.z;
_local5 = _arg1.sin;
_local6 = _local5.x;
_local7 = _local5.y;
_local8 = _local5.z;
_local9 = _arg1.cos;
_local10 = _local9.x;
_local11 = _local9.y;
_local12 = _local9.z;
_local2 = (_local2 - this.x);
_local3 = (_local3 - this.y);
_local4 = (_local4 - this.z);
_local14 = this.vertices;
_local15 = _local14.length;
_local16 = _arg1.focus;
_local17 = _arg1.zoom;
while ((_local13 = _local14[--_local15])) {
_local20 = (_local13.x - _local2);
_local21 = (_local13.y - _local3);
_local22 = (_local13.z - _local4);
_local23 = ((_local20 * _local12) - (_local21 * _local8));
_local24 = ((_local21 * _local12) + (_local20 * _local8));
_local25 = ((_local23 * _local11) - (_local22 * _local7));
_local26 = ((_local22 * _local11) + (_local23 * _local7));
_local27 = ((_local24 * _local10) - (_local26 * _local6));
_local28 = ((_local26 * _local10) + (_local24 * _local6));
_local13.visible = (_local28 > -100);
if (_local13.visible){
_local18 = _local13.screen;
_local19 = ((_local16 / (_local16 + _local28)) * _local17);
_local18.x = (_local25 * _local19);
_local18.y = (_local27 * _local19);
_local18.z = _local28;
};
};
}
public function updateScale(_arg1:Array, _arg2:Number3D):void{
var _local3:Number;
var _local4:Number;
var _local5:Number;
var _local6:Number3D;
var _local7:Number3D;
var _local8:int;
var _local9:Vertex3D;
_local3 = _arg2.x;
_local4 = _arg2.y;
_local5 = _arg2.z;
_local8 = _arg1.length;
while ((_local9 = _arg1[--_local8])) {
_local6 = _local9.toScale;
_local7 = _local9.toRotate;
_local7.x = (_local6.x * _local3);
_local7.y = (_local6.y * _local4);
_local7.z = (_local6.z * _local5);
};
}
protected function updateRotation(_arg1:Array, _arg2:Number3D):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:Number3D;
var _local19:Vertex3D;
var _local20:int;
_local3 = Math.cos(_arg2.x);
_local4 = Math.sin(_arg2.x);
_local5 = Math.cos(_arg2.y);
_local6 = Math.sin(_arg2.y);
_local7 = Math.cos(_arg2.z);
_local8 = Math.sin(_arg2.z);
_local20 = _arg1.length;
while ((_local19 = _arg1[--_local20])) {
_local18 = _local19.toRotate;
_local9 = _local18.x;
_local10 = _local18.y;
_local11 = _local18.z;
_local12 = ((_local9 * _local7) - (_local10 * _local8));
_local13 = ((_local10 * _local7) + (_local9 * _local8));
_local14 = ((_local12 * _local5) - (_local11 * _local6));
_local15 = ((_local11 * _local5) + (_local12 * _local6));
_local16 = ((_local13 * _local3) - (_local15 * _local4));
_local17 = ((_local15 * _local3) + (_local13 * _local4));
_local19.x = _local14;
_local19.y = _local16;
_local19.z = _local17;
};
}
}
}//package org.papervision3d.objects
Section 14
//Scene3D (org.papervision3d.scenes.Scene3D)
package org.papervision3d.scenes {
import flash.display.*;
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 15
//Papervision3D (org.papervision3d.Papervision3D)
package org.papervision3d {
public class Papervision3D {
public static var VERBOSE:Boolean = true;
public static var AUTHOR:String = "(c) 2006 Copyright by Carlos Ulloa | papervision3d.org | C4RL054321@gmail.com";
public static var DATE:String = "17.12.06";
public static var NAME:String = "Papervision3D";
public static var VERSION:String = "Beta RC0";
public static var REVISION:String = "12";
public function Papervision3D():void{
log("Papervision3D scene class has been replaced by org.papervision3d.scenes");
}
public static function log(_arg1:String):void{
if (Papervision3D.VERBOSE){
trace(_arg1);
};
}
}
}//package org.papervision3d
Section 16
//Main (Main)
package {
import org.papervision3d.materials.*;
import org.papervision3d.objects.*;
import flash.display.*;
import flash.events.*;
import org.papervision3d.scenes.*;
import org.papervision3d.cameras.*;
import flash.utils.*;
import flash.geom.*;
import flash.filters.*;
public class Main extends MovieClip {
private var texture:BitmapData;
private var lineSize:int;// = 15
private var camera:FreeCamera3D;
private var lineSizeDyn:int;
private var materials:Array;
public var dPreloader:MovieClip;
private var container:Sprite;
public var iFull:SimpleButton;
private var scene:Scene3D;
private var textureSize:int;// = 0x0200
public var iFPS:MovieClip;
public function Main(){
textureSize = 0x0200;
lineSize = 15;
iFull = new SimpleButton();
iFPS = new MovieClip();
dPreloader = new MovieClip();
super();
addFrameScript(0, frame1);
stage.quality = "LOW";
addChild(dPreloader);
addChild(iFull);
iFull.x = (600 + ((stage.stageWidth - 600) / 2));
iFull.y = (600 + ((stage.stageHeight - 600) / 2));
iFull.visible = stage.hasOwnProperty("displayState");
iFull.addEventListener(MouseEvent.CLICK, goFull);
this.addEventListener(Event.ENTER_FRAME, CheckIfLoaded);
}
private function _onMouseDown(_arg1:Event):void{
var _local2:String;
for (_local2 in materials) {
materials[_local2].lineAlpha = 10;
};
}
function frame1(){
stop();
}
public function CheckIfLoaded(_arg1:Event):void{
if (dPreloader.loadComplete){
this.removeEventListener(Event.ENTER_FRAME, CheckIfLoaded);
nextFrame();
nextFrame();
init3D();
addChild(dPreloader);
addChild(iFPS);
addChild(iFull);
this.addEventListener(Event.ENTER_FRAME, onEnterFrame);
};
}
private function goFull(_arg1:MouseEvent):void{
if (stage.hasOwnProperty("displayState")){
if (stage.displayState != StageDisplayState.FULL_SCREEN){
stage.displayState = StageDisplayState.FULL_SCREEN;
} else {
stage.displayState = StageDisplayState.NORMAL;
};
};
}
private function init3D():void{
var _local1:Number;
var _local2:Number;
var _local3:Number;
var _local4:Number;
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:BitmapMaterial;
var _local9:Plane;
container = new Sprite();
addChild(container);
container.x = 300;
container.y = 300;
scene = new Scene3D(container);
camera = new FreeCamera3D();
camera.zoom = 1;
camera.focus = 250;
camera.z = 0;
_local1 = 8;
_local2 = 4;
_local3 = 0xFF00;
_local4 = 5000;
_local5 = 100;
_local6 = (_local4 / 2);
_local7 = (_local5 / 2);
materials = new Array();
texture = new BitmapData(textureSize, textureSize, false, 0);
_local8 = new BitmapMaterial(texture);
_local8.oneSide = true;
_local8.lineColor = _local3;
_local8.animated = true;
materials.push(_local8);
scene.push(_local8);
_local9 = new Plane(_local8, _local4, _local4, _local1, _local1);
_local9.z = _local6;
_local9.rotationY = 180;
scene.push(_local9);
_local9 = new Plane(_local8, _local4, _local4, _local1, _local1);
_local9.x = -(_local6);
_local9.rotationY = -90;
scene.push(_local9);
_local9 = new Plane(_local8, _local4, _local4, _local1, _local1);
_local9.x = _local6;
_local9.rotationY = 90;
scene.push(_local9);
_local9 = new Plane(_local8, _local4, _local4, _local1, _local1);
_local9.y = -(_local6);
_local9.rotationX = -90;
scene.push(_local9);
_local9 = new Plane(_local8, _local4, _local4, _local1, _local1);
_local9.y = _local6;
_local9.rotationX = 90;
scene.push(_local9);
_local9 = new Plane(_local8, _local4, _local4, _local1, _local1);
_local9.z = -(_local6);
scene.push(_local9);
_local9 = new Plane(_local8, _local5, _local5, _local2, _local2);
_local9.z = _local7;
scene.push(_local9);
_local9 = new Plane(_local8, _local5, _local5, _local2, _local2);
_local9.x = -(_local7);
_local9.rotationY = 90;
scene.push(_local9);
_local9 = new Plane(_local8, _local5, _local5, _local2, _local2);
_local9.x = _local7;
_local9.rotationY = -90;
scene.push(_local9);
_local9 = new Plane(_local8, _local5, _local5, _local2, _local2);
_local9.y = -(_local7);
_local9.rotationX = 90;
scene.push(_local9);
_local9 = new Plane(_local8, _local5, _local5, _local2, _local2);
_local9.y = _local7;
_local9.rotationX = -90;
scene.push(_local9);
_local9 = new Plane(_local8, _local5, _local5, _local2, _local2);
_local9.z = -(_local7);
_local9.rotationY = 180;
scene.push(_local9);
}
private function onEnterFrame(_arg1:Event):void{
camera.rotationX = (camera.rotationX - (((camera.rotationX + 0) - (360 * (container.mouseY / stage.stageHeight))) / 16));
camera.rotationY = (camera.rotationY - (((camera.rotationY - 0) - (360 * (container.mouseX / stage.stageWidth))) / 16));
iFull.x = (600 + ((stage.stageWidth - 600) / 2));
iFull.y = (600 + ((stage.stageHeight - 600) / 2));
lineSizeDyn = (lineSize * (Math.sin((getTimer() * 0.002)) + 1.2));
texture.draw(container, null, null, null, new Rectangle(0, 0, (textureSize * 2), (textureSize * 2)));
texture.applyFilter(texture, new Rectangle(0, 0, textureSize, textureSize), new Point(0, 0), new BlurFilter());
texture.colorTransform(new Rectangle(0, 0, textureSize, textureSize), new ColorTransform(1, 1, 1, 1, -25, -10, -10, 0));
texture.fillRect(new Rectangle(0, 0, lineSizeDyn, textureSize), 0xFFFFFF);
texture.fillRect(new Rectangle(0, 0, textureSize, lineSizeDyn), 0xFFFFFF);
texture.fillRect(new Rectangle((textureSize - lineSizeDyn), 0, lineSizeDyn, textureSize), 0xFFFFFF);
texture.fillRect(new Rectangle(0, (textureSize - lineSizeDyn), textureSize, lineSizeDyn), 0xFFFFFF);
scene.renderCamera(camera);
}
private function _onMouseUp(_arg1:Event):void{
var _local2:String;
for (_local2 in materials) {
materials[_local2].lineAlpha = 0;
};
}
}
}//package
Section 17
//Timeline2_6a7b35df54724409640f4f34df7ee2 (Timeline2_6a7b35df54724409640f4f34df7ee2)
package {
import adobe.utils.*;
import flash.accessibility.*;
import flash.display.*;
import flash.errors.*;
import flash.events.*;
import flash.external.*;
import flash.filters.*;
import flash.geom.*;
import flash.media.*;
import flash.net.*;
import flash.printing.*;
import flash.system.*;
import flash.text.*;
import flash.ui.*;
import flash.utils.*;
import flash.xml.*;
public dynamic class Timeline2_6a7b35df54724409640f4f34df7ee2 extends MovieClip {
public function Timeline2_6a7b35df54724409640f4f34df7ee2(){
addFrameScript(19, frame20);
}
function frame20(){
stop();
}
}
}//package
Section 18
//Timeline3_71691d4e2bdc7d4393b1e44f8fe56388 (Timeline3_71691d4e2bdc7d4393b1e44f8fe56388)
package {
import adobe.utils.*;
import flash.accessibility.*;
import flash.display.*;
import flash.errors.*;
import flash.events.*;
import flash.external.*;
import flash.filters.*;
import flash.geom.*;
import flash.media.*;
import flash.net.*;
import flash.printing.*;
import flash.system.*;
import flash.text.*;
import flash.ui.*;
import flash.utils.*;
import flash.xml.*;
public dynamic class Timeline3_71691d4e2bdc7d4393b1e44f8fe56388 extends MovieClip {
public function Timeline3_71691d4e2bdc7d4393b1e44f8fe56388(){
addFrameScript(19, frame20);
}
function frame20(){
stop();
}
}
}//package
Section 19
//Timeline4_63965f391de87244ae20c651bd9d1a4f (Timeline4_63965f391de87244ae20c651bd9d1a4f)
package {
import adobe.utils.*;
import flash.accessibility.*;
import flash.display.*;
import flash.errors.*;
import flash.events.*;
import flash.external.*;
import flash.filters.*;
import flash.geom.*;
import flash.media.*;
import flash.net.*;
import flash.printing.*;
import flash.system.*;
import flash.text.*;
import flash.ui.*;
import flash.utils.*;
import flash.xml.*;
public dynamic class Timeline4_63965f391de87244ae20c651bd9d1a4f extends MovieClip {
public var loaded:int;
public var Bar:MovieClip;
public var ratio:int;
public var loadText:TextField;
public var loadComplete:Boolean;
public var total:int;
public var sentences:Array;
public var Bg:MovieClip;
public function Timeline4_63965f391de87244ae20c651bd9d1a4f(){
addFrameScript(0, frame1);
}
public function onLoadInit(_arg1:Event):void{
loaded = _arg1.target.bytesLoaded;
total = _arg1.target.bytesTotal;
loadText.text = sentences[Math.round((Math.random() * (sentences.length - 1)))];
}
function frame1(){
loadComplete = false;
sentences = new Array("Converting a Terrier into a Parrot", "Returning a dead Parrot to the Pet shop", "Stopping a silly sketch", "Calculating the palindrom of Bolton", "Thinking about full frontal nudity", "Spotting trains", "Writting the funniest joke in the world", "Eating a banana", "Turning to a lumberjack", "Notch notch wink wink know wadda mean?", "Selling encyclopedias");
Bar.width = 0;
this.loaderInfo.addEventListener(Event.INIT, onLoadInit);
this.loaderInfo.addEventListener(ProgressEvent.PROGRESS, onLoadProgress);
this.loaderInfo.addEventListener(Event.COMPLETE, onLoadComplete);
this.addEventListener(Event.ENTER_FRAME, onEnterFrame);
}
public function onLoadProgress(_arg1:ProgressEvent):void{
loaded = _arg1.bytesLoaded;
total = _arg1.bytesTotal;
ratio = ((loaded / total) * 100);
}
public function onEnterFrame(_arg1:Event):void{
Bg.x = (((getTimer() * 0.1) % 58) - 58);
if (loadComplete){
this.alpha = (this.alpha - ((getTimer() * 0.0001) % 1));
Bar.width = (Bar.width + ((0 - Bar.width) / 10));
if (this.alpha < 0){
this.removeEventListener(Event.ENTER_FRAME, onEnterFrame);
};
} else {
Bar.width = (Bar.width + (((ratio * 2) - Bar.width) / 10));
};
}
public function onLoadComplete(_arg1:Event):void{
loadText.text = "Done!";
loadComplete = true;
}
}
}//package