flex-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From carlosrov...@apache.org
Subject [5/8] flex-asjs git commit: Initial project setup from Lizhi’s SpriteFlexJS project
Date Wed, 22 Feb 2017 15:36:44 GMT
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/2b7a1d9f/frameworks/projects/spriteflexjs/src/main/flex/flash/display3D/Context3D.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/spriteflexjs/src/main/flex/flash/display3D/Context3D.as b/frameworks/projects/spriteflexjs/src/main/flex/flash/display3D/Context3D.as
new file mode 100644
index 0000000..a4fd62d
--- /dev/null
+++ b/frameworks/projects/spriteflexjs/src/main/flex/flash/display3D/Context3D.as
@@ -0,0 +1,391 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  Licensed to the Apache Software Foundation (ASF) under one or more
+//  contributor license agreements.  See the NOTICE file distributed with
+//  this work for additional information regarding copyright ownership.
+//  The ASF licenses this file to You under the Apache License, Version 2.0
+//  (the "License"); you may not use this file except in compliance with
+//  the License.  You may obtain a copy of the License at
+//
+//      http://www.apache.org/licenses/LICENSE-2.0
+//
+//  Unless required by applicable law or agreed to in writing, software
+//  distributed under the License is distributed on an "AS IS" BASIS,
+//  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+//  See the License for the specific language governing permissions and
+//  limitations under the License.
+//
+////////////////////////////////////////////////////////////////////////////////
+package flash.display3D
+{
+	import flash.events.EventDispatcher;
+	import flash.geom.Matrix3D;
+	import flash.utils.ByteArray;
+	import flash.display3D.textures.*;
+	import flash.geom.Rectangle;
+	import flash.display.BitmapData;
+	/**
+	 * ...
+	 * @author lizhi http://matrix3d.github.io/
+	 */
+	public final class Context3D extends EventDispatcher
+	{
+		public var canvas:HTMLCanvasElement;
+		public var gl:WebGLRenderingContext;
+		private var currentProgram:Program3D;
+		private var currentTextures:Object = { };
+		private var currentVBufs:Object = { };
+		public function Context3D()
+		{
+			super();
+		}
+		
+		public static function get supportsVideoTexture():Boolean  { return false }
+		
+		public function get driverInfo():String  { return null }
+		
+		public function dispose(recreate:Boolean = true):void
+		{
+		}
+		
+		public function get enableErrorChecking():Boolean  { return false }
+		
+		public function set enableErrorChecking(toggle:Boolean):void
+		{
+		}
+		
+		public function configureBackBuffer(width:int, height:int, antiAlias:int, enableDepthAndStencil:Boolean = true, wantsBestResolution:Boolean = false):void
+		{
+			canvas.width = width;
+			canvas.height = height;
+			canvas.style.width = width + "px";
+			canvas.style.height = height + "px";
+			gl.viewport(0, 0, width, height);
+			if (enableDepthAndStencil)
+			{
+				gl.enable(gl.DEPTH_TEST);
+				gl.enable(gl.STENCIL_TEST);
+			}
+			else
+			{
+				gl.disable(gl.DEPTH_TEST);
+				gl.disable(gl.STENCIL_TEST);
+			}
+		}
+		
+		public function clear(red:Number = 0, green:Number = 0, blue:Number = 0, alpha:Number = 1, depth:Number = 1, stencil:uint = 0, mask:uint = 4294967295):void
+		{
+			SpriteFlexjs.dirtyGraphics = true;
+			gl.clearColor(red, green, blue, alpha);
+			gl.clearDepth(depth);
+			gl.clearStencil(stencil);
+			gl.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT);
+		}
+		
+		public function drawTriangles(indexBuffer:IndexBuffer3D, firstIndex:int = 0, numTriangles:int = -1):void
+		{
+			gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, indexBuffer.buff);
+			gl.drawElements(gl.TRIANGLES, numTriangles < 0 ? indexBuffer.count : numTriangles * 3, gl.UNSIGNED_SHORT, firstIndex * 2);
+		}
+		
+		public function present():void
+		{
+			SpriteFlexjs.dirtyGraphics = true;
+		}
+		
+		public function setProgram(program:Program3D):void
+		{
+			if(currentProgram!=program){
+				currentProgram = program;
+				gl.useProgram(program.program);
+			}
+		}
+		
+		public function setProgramConstantsFromVector(programType:String, firstRegister:int, data:Vector.<Number>, numRegisters:int = -1):void
+		{
+			//var num:int =gl.getProgramParameter(currentProgram.program, gl.ACTIVE_UNIFORMS);
+			//var count:int = 0;
+			//for (var i:int = 0; i < num;i++ ) {
+			//	var au:WebGLActiveInfo = gl(currentProgram.program, i);
+			//}
+			setProgramConstantsFromVectorGL(getUniformLocationName(programType, firstRegister), data, numRegisters);
+		}
+		
+		public function setProgramConstantsFromMatrix(programType:String, firstRegister:int, matrix:Matrix3D, transposedMatrix:Boolean = false):void
+		{
+			setProgramConstantsFromMatrixGL(getUniformLocationName(programType, firstRegister), matrix, transposedMatrix);
+		}
+		
+		public function setProgramConstantsFromByteArray(programType:String, firstRegister:int, numRegisters:int, data:ByteArray, byteArrayOffset:uint):void
+		{
+		}
+		public function setProgramConstantsFromVectorGL(name:String, data:Vector.<Number>, numRegisters:int = -1):void
+		{
+			gl.uniform4fv(getUniformLocation(name), data as Object);
+		}
+		
+		/**
+		 * @flexjsignorecoercion Object
+		 */
+		public function setProgramConstantsFromMatrixGL(name:String, matrix:Matrix3D, transposedMatrix:Boolean = false):void
+		{
+			if (transposedMatrix) {
+				matrix.transpose();
+			}
+			gl.uniformMatrix4fv(getUniformLocation(name), false, matrix.rawData as Object);
+			if (transposedMatrix) {
+				matrix.transpose();
+			}
+		}
+		
+		public function setProgramConstantsFromByteArrayGL(name:String , numRegisters:int, data:ByteArray, byteArrayOffset:uint):void
+		{
+		}
+		
+		private function getUniformLocationName(programType:String, register:int):String
+		{
+			return (Context3DProgramType.VERTEX === programType) ? ("vc" + register) : ("fc" + register);
+		}
+		private function getUniformLocation(name:String):WebGLUniformLocation
+		{
+			return currentProgram.getUniformLocation(name);
+		}
+		
+		public function setVertexBufferAt(index:int, buffer:VertexBuffer3D, bufferOffset:int = 0, format:String = "float4"):void
+		{
+			setVertexBufferAtGL("va" + index, buffer, bufferOffset, format);
+		}
+		
+		public function setVertexBufferAtGL(name:String, buffer:VertexBuffer3D, bufferOffset:int = 0, format:String = "float4"):void {
+			if (currentVBufs[name] != buffer) {
+				currentVBufs[name] = buffer;
+				var loc:Number= currentProgram.getAttribLocation(name);
+				gl.bindBuffer(gl.ARRAY_BUFFER, buffer.buff);
+				var type:int = gl.FLOAT;
+				var size:int = 0;
+				var normalized:Boolean = false;
+				switch (format)
+				{
+				case Context3DVertexBufferFormat.FLOAT_1: 
+					size = 1;
+					break;
+				case Context3DVertexBufferFormat.FLOAT_2: 
+					size = 2;
+					break;
+				case Context3DVertexBufferFormat.FLOAT_3: 
+					size = 3;
+					break;
+				case Context3DVertexBufferFormat.FLOAT_4: 
+					size = 4;
+					break;
+				case Context3DVertexBufferFormat.BYTES_4: 
+					size = 4;
+					type = gl.UNSIGNED_BYTE;
+					normalized = true;
+					break;
+				}
+				gl.vertexAttribPointer(loc, size, type, normalized, bufferOffset, bufferOffset);
+			}
+		}
+		
+		public function setBlendFactors(sourceFactor:String, destinationFactor:String):void
+		{
+			gl.enable(gl.BLEND);
+			gl.blendEquation(gl.FUNC_ADD);
+			gl.blendFunc(Context3DBlendFactor.getGLVal(gl,sourceFactor), Context3DBlendFactor.getGLVal(gl,destinationFactor));
+		}
+		
+		public function setColorMask(red:Boolean, green:Boolean, blue:Boolean, alpha:Boolean):void
+		{
+			gl.colorMask(red, green, blue, alpha);
+		}
+		
+		public function setDepthTest(depthMask:Boolean, passCompareMode:String):void
+		{
+			gl.depthFunc(Context3DCompareMode.getGLVal(gl,passCompareMode));
+			gl.depthMask(depthMask);
+		}
+		
+		public function setTextureAt(sampler:int, texture:TextureBase):void
+		{
+			if (texture == null)
+			{
+				this.setTextureInternal(sampler, null);
+			}
+			else if (texture is Texture)
+			{
+				this.setTextureInternal(sampler, texture as Texture);
+			}
+			else if (texture is CubeTexture)
+			{
+				this.setCubeTextureInternal(sampler, texture as CubeTexture);
+			}
+			else if (texture is RectangleTexture)
+			{
+				this.setRectangleTextureInternal(sampler, texture as RectangleTexture);
+			}
+			else if (texture is VideoTexture)
+			{
+				this.setVideoTextureInternal(sampler, texture as VideoTexture);
+			}
+		}
+		
+		public function setRenderToTexture(texture:TextureBase, enableDepthAndStencil:Boolean = false, antiAlias:int = 0, surfaceSelector:int = 0, colorOutputIndex:int = 0):void
+		{
+			var targetType:uint = 0;
+			if (texture is Texture)
+			{
+				targetType = 1;
+			}
+			else if (texture is CubeTexture)
+			{
+				targetType = 2;
+			}
+			else if (texture is RectangleTexture)
+			{
+				targetType = 3;
+			}
+			else if (texture != null)
+			{
+				throw "texture argument not derived from TextureBase (can be Texture, CubeTexture, or if supported, RectangleTexture)";
+			}
+			this.setRenderToTextureInternal(texture, targetType, enableDepthAndStencil, antiAlias, surfaceSelector, colorOutputIndex);
+		}
+		
+		public function setRenderToBackBuffer():void
+		{
+		}
+		
+		private function setRenderToTextureInternal(param1:TextureBase, param2:int, param3:Boolean, param4:int, param5:int, param6:int):void
+		{
+		}
+		
+		public function setCulling(triangleFaceToCull:String):void
+		{
+			if (triangleFaceToCull === Context3DTriangleFace.NONE)
+			{
+				gl.disable(gl.CULL_FACE);
+			}
+			else
+			{
+				gl.enable(gl.CULL_FACE);
+				gl.cullFace(Context3DTriangleFace.getGLVal(gl,triangleFaceToCull));
+			}
+		}
+		
+		public function setStencilActions(triangleFace:String = "frontAndBack", compareMode:String = "always", actionOnBothPass:String = "keep", actionOnDepthFail:String = "keep", actionOnDepthPassStencilFail:String = "keep"):void
+		{
+		}
+		
+		public function setStencilReferenceValue(referenceValue:uint, readMask:uint = 255, writeMask:uint = 255):void
+		{
+		}
+		
+		public function setScissorRectangle(rectangle:Rectangle):void
+		{
+			if (rectangle == null)
+			{
+				gl.disable(gl.SCISSOR_TEST);
+			}
+			else
+			{
+				gl.enable(gl.SCISSOR_TEST);
+				gl.scissor(rectangle.x, rectangle.y, rectangle.width, rectangle.height);
+			}
+		}
+		
+		public function createVertexBuffer(numVertices:int, data32PerVertex:int, bufferUsage:String = "staticDraw"):VertexBuffer3D
+		{
+			var buffer:VertexBuffer3D = new VertexBuffer3D;
+			buffer.buff = gl.createBuffer();
+			buffer.gl = gl;
+			return buffer;
+		}
+		
+		public function createIndexBuffer(numIndices:int, bufferUsage:String = "staticDraw"):IndexBuffer3D
+		{
+			var buffer:IndexBuffer3D = new IndexBuffer3D;
+			buffer.buff = gl.createBuffer();
+			buffer.gl = gl;
+			buffer.count = numIndices;
+			return buffer;
+		}
+		
+		public function createTexture(width:int, height:int, format:String, optimizeForRenderToTexture:Boolean, streamingLevels:int = 0):Texture
+		{
+			var t:Texture = new Texture;
+			t.gl = gl;
+			t.texture = gl.createTexture();
+			return t;
+		}
+		
+		public function createCubeTexture(size:int, format:String, optimizeForRenderToTexture:Boolean, streamingLevels:int = 0):CubeTexture  { return null }
+		
+		public function createRectangleTexture(width:int, height:int, format:String, optimizeForRenderToTexture:Boolean):RectangleTexture  { return null }
+		
+		public function createProgram():Program3D
+		{
+			var p:Program3D = new Program3D;
+			p.gl = gl;
+			p.program = gl.createProgram();
+			return p;
+		}
+		
+		public function drawToBitmapData(destination:BitmapData):void
+		{
+		}
+		
+		public function setSamplerStateAt(sampler:int, wrap:String, filter:String, mipfilter:String):void
+		{
+		}
+		
+		public function get profile():String  { return null }
+		
+		private function setTextureInternal(sampler:int, texture:Texture):void
+		{
+			setTextureAtGL("fs" + sampler, sampler, texture);
+		}
+		
+		public function setTextureAtGL(name:String, sampler:int, texture:Texture):void {
+			if (currentTextures[name] != texture) {
+				currentTextures[name] = texture;
+				if (texture)
+				{
+					gl.activeTexture(WebGLRenderingContext["TEXTURE"+sampler]);
+					gl.bindTexture(gl.TEXTURE_2D, texture.texture);
+					gl.uniform1i(currentProgram.getUniformLocation(name), sampler);
+				}
+			}
+		}
+		
+		private function setCubeTextureInternal(param1:int, param2:CubeTexture):void
+		{
+		}
+		
+		private function setRectangleTextureInternal(param1:int, param2:RectangleTexture):void
+		{
+		}
+		
+		private function setVideoTextureInternal(param1:int, param2:VideoTexture):void
+		{
+		}
+		
+		public function get backBufferWidth():int  { return 0 }
+		
+		public function get backBufferHeight():int  { return 0 }
+		
+		public function get maxBackBufferWidth():int  { return 0 }
+		
+		public function set maxBackBufferWidth(width:int):void
+		{
+		}
+		
+		public function get maxBackBufferHeight():int  { return 0 }
+		
+		public function set maxBackBufferHeight(height:int):void
+		{
+		}
+		
+		public function createVideoTexture():VideoTexture  { return null }
+	}
+}

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/2b7a1d9f/frameworks/projects/spriteflexjs/src/main/flex/flash/display3D/Context3DBlendFactor.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/spriteflexjs/src/main/flex/flash/display3D/Context3DBlendFactor.as b/frameworks/projects/spriteflexjs/src/main/flex/flash/display3D/Context3DBlendFactor.as
new file mode 100644
index 0000000..570b870
--- /dev/null
+++ b/frameworks/projects/spriteflexjs/src/main/flex/flash/display3D/Context3DBlendFactor.as
@@ -0,0 +1,75 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  Licensed to the Apache Software Foundation (ASF) under one or more
+//  contributor license agreements.  See the NOTICE file distributed with
+//  this work for additional information regarding copyright ownership.
+//  The ASF licenses this file to You under the Apache License, Version 2.0
+//  (the "License"); you may not use this file except in compliance with
+//  the License.  You may obtain a copy of the License at
+//
+//      http://www.apache.org/licenses/LICENSE-2.0
+//
+//  Unless required by applicable law or agreed to in writing, software
+//  distributed under the License is distributed on an "AS IS" BASIS,
+//  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+//  See the License for the specific language governing permissions and
+//  limitations under the License.
+//
+////////////////////////////////////////////////////////////////////////////////
+package flash.display3D
+{
+   public final class Context3DBlendFactor extends Object
+   {
+      
+      public static const ONE:String="one";//int = gl.ONE;//
+      
+      public static const ZERO:String="zero";//int = gl.ZERO;//
+      
+      public static const SOURCE_ALPHA:String="sourceAlpha";//int = gl.SRC_ALPHA;//
+      
+      public static const SOURCE_COLOR:String="sourceColor";//int = gl.SRC_COLOR;//
+      
+      public static const ONE_MINUS_SOURCE_ALPHA:String="oneMinusSourceAlpha";//int = gl.ONE_MINUS_SRC_ALPHA;//
+      
+      public static const ONE_MINUS_SOURCE_COLOR:String="oneMinusSourceColor";//int = gl.ONE_MINUS_SRC_COLOR;//
+      
+      public static const DESTINATION_ALPHA:String="destinationAlpha";//int = gl.DST_ALPHA;//
+      
+      public static const DESTINATION_COLOR:String="destinationColor";//int = gl.DST_COLOR;//
+      
+      public static const ONE_MINUS_DESTINATION_ALPHA:String="oneMinusDestinationAlpha";//int = gl.ONE_MINUS_DST_ALPHA;//
+      
+      public static const ONE_MINUS_DESTINATION_COLOR:String="oneMinusDestinationColor";//int = gl.ONE_MINUS_DST_COLOR;//
+       
+      public function Context3DBlendFactor()
+      {
+         super();
+      }
+	  
+	  public static function getGLVal(gl:WebGLRenderingContext,str:String):int {
+		 switch(str) {
+			case ONE:
+				return gl.ONE;
+			case ZERO:
+				return gl.ZERO;
+			case SOURCE_ALPHA:
+				return gl.SRC_ALPHA;
+			case SOURCE_COLOR:
+				return gl.SRC_COLOR;
+			case ONE_MINUS_SOURCE_ALPHA:
+				return gl.ONE_MINUS_SRC_ALPHA;
+			case ONE_MINUS_SOURCE_COLOR:
+				return gl.ONE_MINUS_SRC_COLOR;
+			case DESTINATION_ALPHA:
+				return gl.DST_ALPHA;
+			case DESTINATION_COLOR:
+				return gl.DST_COLOR;
+			case ONE_MINUS_DESTINATION_ALPHA:
+				return gl.ONE_MINUS_DST_ALPHA;
+			case ONE_MINUS_DESTINATION_COLOR:
+				return gl.ONE_MINUS_DST_COLOR;
+		 }
+		 return 0;
+	  }
+   }
+}

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/2b7a1d9f/frameworks/projects/spriteflexjs/src/main/flex/flash/display3D/Context3DBufferUsage.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/spriteflexjs/src/main/flex/flash/display3D/Context3DBufferUsage.as b/frameworks/projects/spriteflexjs/src/main/flex/flash/display3D/Context3DBufferUsage.as
new file mode 100644
index 0000000..cef1a9a
--- /dev/null
+++ b/frameworks/projects/spriteflexjs/src/main/flex/flash/display3D/Context3DBufferUsage.as
@@ -0,0 +1,33 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  Licensed to the Apache Software Foundation (ASF) under one or more
+//  contributor license agreements.  See the NOTICE file distributed with
+//  this work for additional information regarding copyright ownership.
+//  The ASF licenses this file to You under the Apache License, Version 2.0
+//  (the "License"); you may not use this file except in compliance with
+//  the License.  You may obtain a copy of the License at
+//
+//      http://www.apache.org/licenses/LICENSE-2.0
+//
+//  Unless required by applicable law or agreed to in writing, software
+//  distributed under the License is distributed on an "AS IS" BASIS,
+//  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+//  See the License for the specific language governing permissions and
+//  limitations under the License.
+//
+////////////////////////////////////////////////////////////////////////////////
+package flash.display3D
+{
+   public final class Context3DBufferUsage extends Object
+   {
+      
+      public static const STATIC_DRAW:String = "staticDraw";
+      
+      public static const DYNAMIC_DRAW:String = "dynamicDraw";
+       
+      public function Context3DBufferUsage()
+      {
+         super();
+      }
+   }
+}

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/2b7a1d9f/frameworks/projects/spriteflexjs/src/main/flex/flash/display3D/Context3DClearMask.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/spriteflexjs/src/main/flex/flash/display3D/Context3DClearMask.as b/frameworks/projects/spriteflexjs/src/main/flex/flash/display3D/Context3DClearMask.as
new file mode 100644
index 0000000..5254ebb
--- /dev/null
+++ b/frameworks/projects/spriteflexjs/src/main/flex/flash/display3D/Context3DClearMask.as
@@ -0,0 +1,37 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  Licensed to the Apache Software Foundation (ASF) under one or more
+//  contributor license agreements.  See the NOTICE file distributed with
+//  this work for additional information regarding copyright ownership.
+//  The ASF licenses this file to You under the Apache License, Version 2.0
+//  (the "License"); you may not use this file except in compliance with
+//  the License.  You may obtain a copy of the License at
+//
+//      http://www.apache.org/licenses/LICENSE-2.0
+//
+//  Unless required by applicable law or agreed to in writing, software
+//  distributed under the License is distributed on an "AS IS" BASIS,
+//  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+//  See the License for the specific language governing permissions and
+//  limitations under the License.
+//
+////////////////////////////////////////////////////////////////////////////////
+package flash.display3D
+{
+   public final class Context3DClearMask extends Object
+   {
+      
+      public static const COLOR:int = 1 << 0;
+      
+      public static const DEPTH:int = 1 << 1;
+      
+      public static const STENCIL:int = 1 << 2;
+      
+      public static const ALL:int = COLOR | DEPTH | STENCIL;
+       
+      public function Context3DClearMask()
+      {
+         super();
+      }
+   }
+}

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/2b7a1d9f/frameworks/projects/spriteflexjs/src/main/flex/flash/display3D/Context3DCompareMode.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/spriteflexjs/src/main/flex/flash/display3D/Context3DCompareMode.as b/frameworks/projects/spriteflexjs/src/main/flex/flash/display3D/Context3DCompareMode.as
new file mode 100644
index 0000000..27bbccb
--- /dev/null
+++ b/frameworks/projects/spriteflexjs/src/main/flex/flash/display3D/Context3DCompareMode.as
@@ -0,0 +1,71 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  Licensed to the Apache Software Foundation (ASF) under one or more
+//  contributor license agreements.  See the NOTICE file distributed with
+//  this work for additional information regarding copyright ownership.
+//  The ASF licenses this file to You under the Apache License, Version 2.0
+//  (the "License"); you may not use this file except in compliance with
+//  the License.  You may obtain a copy of the License at
+//
+//      http://www.apache.org/licenses/LICENSE-2.0
+//
+//  Unless required by applicable law or agreed to in writing, software
+//  distributed under the License is distributed on an "AS IS" BASIS,
+//  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+//  See the License for the specific language governing permissions and
+//  limitations under the License.
+//
+////////////////////////////////////////////////////////////////////////////////
+package flash.display3D
+{
+	
+	public final class Context3DCompareMode extends Object
+	{
+		
+		public static const ALWAYS:String = "always";//int = gl.ALWAYS;//
+		
+		public static const NEVER:String = "never";//int = gl.NEAREST;//
+		
+		public static const LESS:String = "less";//int = gl.LESS;//
+		
+		public static const LESS_EQUAL:String = "lessEqual";//int = gl.LESS|gl.EQUAL;//
+		
+		public static const EQUAL:String = "equal";//int = gl.EQUAL;//
+		
+		public static const GREATER_EQUAL:String = "greaterEqual";//int = gl.GREATER|gl.EQUAL;//
+		
+		public static const GREATER:String = "greater";//int = gl.GREATER;//
+		
+		public static const NOT_EQUAL:String = "notEqual";//int = gl.NOTEQUAL;//
+		
+		public function Context3DCompareMode()
+		{
+			super();
+		}
+		
+		public static function getGLVal(gl:WebGLRenderingContext,str:String):int
+		{
+			switch (str)
+			{
+				case ALWAYS: 
+					return gl.ALWAYS;
+				case NEVER: 
+					return gl.NEAREST;
+				case LESS: 
+					return gl.LESS;
+				case LESS_EQUAL: 
+					return gl.LESS | gl.EQUAL;
+				case EQUAL: 
+					return gl.EQUAL;
+				case GREATER_EQUAL: 
+					return gl.GREATER | gl.EQUAL;
+				case GREATER: 
+					return gl.GREATER;
+				case NOT_EQUAL: 
+					return gl.NOTEQUAL;
+			}
+			
+			return 0;
+		}
+	}
+}

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/2b7a1d9f/frameworks/projects/spriteflexjs/src/main/flex/flash/display3D/Context3DMipFilter.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/spriteflexjs/src/main/flex/flash/display3D/Context3DMipFilter.as b/frameworks/projects/spriteflexjs/src/main/flex/flash/display3D/Context3DMipFilter.as
new file mode 100644
index 0000000..1f2c02b
--- /dev/null
+++ b/frameworks/projects/spriteflexjs/src/main/flex/flash/display3D/Context3DMipFilter.as
@@ -0,0 +1,35 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  Licensed to the Apache Software Foundation (ASF) under one or more
+//  contributor license agreements.  See the NOTICE file distributed with
+//  this work for additional information regarding copyright ownership.
+//  The ASF licenses this file to You under the Apache License, Version 2.0
+//  (the "License"); you may not use this file except in compliance with
+//  the License.  You may obtain a copy of the License at
+//
+//      http://www.apache.org/licenses/LICENSE-2.0
+//
+//  Unless required by applicable law or agreed to in writing, software
+//  distributed under the License is distributed on an "AS IS" BASIS,
+//  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+//  See the License for the specific language governing permissions and
+//  limitations under the License.
+//
+////////////////////////////////////////////////////////////////////////////////
+package flash.display3D
+{
+   public final class Context3DMipFilter extends Object
+   {
+      
+      public static const MIPNONE:String = "mipnone";
+      
+      public static const MIPNEAREST:String = "mipnearest";
+      
+      public static const MIPLINEAR:String = "miplinear";
+       
+      public function Context3DMipFilter()
+      {
+         super();
+      }
+   }
+}

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/2b7a1d9f/frameworks/projects/spriteflexjs/src/main/flex/flash/display3D/Context3DProfile.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/spriteflexjs/src/main/flex/flash/display3D/Context3DProfile.as b/frameworks/projects/spriteflexjs/src/main/flex/flash/display3D/Context3DProfile.as
new file mode 100644
index 0000000..ccb9dc3
--- /dev/null
+++ b/frameworks/projects/spriteflexjs/src/main/flex/flash/display3D/Context3DProfile.as
@@ -0,0 +1,41 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  Licensed to the Apache Software Foundation (ASF) under one or more
+//  contributor license agreements.  See the NOTICE file distributed with
+//  this work for additional information regarding copyright ownership.
+//  The ASF licenses this file to You under the Apache License, Version 2.0
+//  (the "License"); you may not use this file except in compliance with
+//  the License.  You may obtain a copy of the License at
+//
+//      http://www.apache.org/licenses/LICENSE-2.0
+//
+//  Unless required by applicable law or agreed to in writing, software
+//  distributed under the License is distributed on an "AS IS" BASIS,
+//  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+//  See the License for the specific language governing permissions and
+//  limitations under the License.
+//
+////////////////////////////////////////////////////////////////////////////////
+package flash.display3D
+{
+   public final class Context3DProfile extends Object
+   {
+      
+      public static const BASELINE:String = "baseline";
+      
+      public static const BASELINE_CONSTRAINED:String = "baselineConstrained";
+      
+      public static const BASELINE_EXTENDED:String = "baselineExtended";
+      
+      public static const STANDARD:String = "standard";
+      
+      public static const STANDARD_CONSTRAINED:String = "standardConstrained";
+      
+      public static const STANDARD_EXTENDED:String = "standardExtended";
+       
+      public function Context3DProfile()
+      {
+         super();
+      }
+   }
+}

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/2b7a1d9f/frameworks/projects/spriteflexjs/src/main/flex/flash/display3D/Context3DProgramType.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/spriteflexjs/src/main/flex/flash/display3D/Context3DProgramType.as b/frameworks/projects/spriteflexjs/src/main/flex/flash/display3D/Context3DProgramType.as
new file mode 100644
index 0000000..69a5db1
--- /dev/null
+++ b/frameworks/projects/spriteflexjs/src/main/flex/flash/display3D/Context3DProgramType.as
@@ -0,0 +1,33 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  Licensed to the Apache Software Foundation (ASF) under one or more
+//  contributor license agreements.  See the NOTICE file distributed with
+//  this work for additional information regarding copyright ownership.
+//  The ASF licenses this file to You under the Apache License, Version 2.0
+//  (the "License"); you may not use this file except in compliance with
+//  the License.  You may obtain a copy of the License at
+//
+//      http://www.apache.org/licenses/LICENSE-2.0
+//
+//  Unless required by applicable law or agreed to in writing, software
+//  distributed under the License is distributed on an "AS IS" BASIS,
+//  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+//  See the License for the specific language governing permissions and
+//  limitations under the License.
+//
+////////////////////////////////////////////////////////////////////////////////
+package flash.display3D
+{
+   public final class Context3DProgramType extends Object
+   {
+      
+      public static const VERTEX:String = "vertex";
+      
+      public static const FRAGMENT:String = "fragment";
+       
+      public function Context3DProgramType()
+      {
+         super();
+      }
+   }
+}

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/2b7a1d9f/frameworks/projects/spriteflexjs/src/main/flex/flash/display3D/Context3DRenderMode.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/spriteflexjs/src/main/flex/flash/display3D/Context3DRenderMode.as b/frameworks/projects/spriteflexjs/src/main/flex/flash/display3D/Context3DRenderMode.as
new file mode 100644
index 0000000..6196dcd
--- /dev/null
+++ b/frameworks/projects/spriteflexjs/src/main/flex/flash/display3D/Context3DRenderMode.as
@@ -0,0 +1,33 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  Licensed to the Apache Software Foundation (ASF) under one or more
+//  contributor license agreements.  See the NOTICE file distributed with
+//  this work for additional information regarding copyright ownership.
+//  The ASF licenses this file to You under the Apache License, Version 2.0
+//  (the "License"); you may not use this file except in compliance with
+//  the License.  You may obtain a copy of the License at
+//
+//      http://www.apache.org/licenses/LICENSE-2.0
+//
+//  Unless required by applicable law or agreed to in writing, software
+//  distributed under the License is distributed on an "AS IS" BASIS,
+//  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+//  See the License for the specific language governing permissions and
+//  limitations under the License.
+//
+////////////////////////////////////////////////////////////////////////////////
+package flash.display3D
+{
+   public final class Context3DRenderMode extends Object
+   {
+      
+      public static const AUTO:String = "auto";
+      
+      public static const SOFTWARE:String = "software";
+       
+      public function Context3DRenderMode()
+      {
+         super();
+      }
+   }
+}

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/2b7a1d9f/frameworks/projects/spriteflexjs/src/main/flex/flash/display3D/Context3DStencilAction.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/spriteflexjs/src/main/flex/flash/display3D/Context3DStencilAction.as b/frameworks/projects/spriteflexjs/src/main/flex/flash/display3D/Context3DStencilAction.as
new file mode 100644
index 0000000..789ba09
--- /dev/null
+++ b/frameworks/projects/spriteflexjs/src/main/flex/flash/display3D/Context3DStencilAction.as
@@ -0,0 +1,45 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  Licensed to the Apache Software Foundation (ASF) under one or more
+//  contributor license agreements.  See the NOTICE file distributed with
+//  this work for additional information regarding copyright ownership.
+//  The ASF licenses this file to You under the Apache License, Version 2.0
+//  (the "License"); you may not use this file except in compliance with
+//  the License.  You may obtain a copy of the License at
+//
+//      http://www.apache.org/licenses/LICENSE-2.0
+//
+//  Unless required by applicable law or agreed to in writing, software
+//  distributed under the License is distributed on an "AS IS" BASIS,
+//  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+//  See the License for the specific language governing permissions and
+//  limitations under the License.
+//
+////////////////////////////////////////////////////////////////////////////////
+package flash.display3D
+{
+   public final class Context3DStencilAction extends Object
+   {
+      
+      public static const KEEP:String = "keep";
+      
+      public static const ZERO:String = "zero";
+      
+      public static const INCREMENT_SATURATE:String = "incrementSaturate";
+      
+      public static const DECREMENT_SATURATE:String = "decrementSaturate";
+      
+      public static const INVERT:String = "invert";
+      
+      public static const INCREMENT_WRAP:String = "incrementWrap";
+      
+      public static const DECREMENT_WRAP:String = "decrementWrap";
+      
+      public static const SET:String = "set";
+       
+      public function Context3DStencilAction()
+      {
+         super();
+      }
+   }
+}

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/2b7a1d9f/frameworks/projects/spriteflexjs/src/main/flex/flash/display3D/Context3DTextureFilter.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/spriteflexjs/src/main/flex/flash/display3D/Context3DTextureFilter.as b/frameworks/projects/spriteflexjs/src/main/flex/flash/display3D/Context3DTextureFilter.as
new file mode 100644
index 0000000..4638b54
--- /dev/null
+++ b/frameworks/projects/spriteflexjs/src/main/flex/flash/display3D/Context3DTextureFilter.as
@@ -0,0 +1,41 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  Licensed to the Apache Software Foundation (ASF) under one or more
+//  contributor license agreements.  See the NOTICE file distributed with
+//  this work for additional information regarding copyright ownership.
+//  The ASF licenses this file to You under the Apache License, Version 2.0
+//  (the "License"); you may not use this file except in compliance with
+//  the License.  You may obtain a copy of the License at
+//
+//      http://www.apache.org/licenses/LICENSE-2.0
+//
+//  Unless required by applicable law or agreed to in writing, software
+//  distributed under the License is distributed on an "AS IS" BASIS,
+//  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+//  See the License for the specific language governing permissions and
+//  limitations under the License.
+//
+////////////////////////////////////////////////////////////////////////////////
+package flash.display3D
+{
+   public final class Context3DTextureFilter extends Object
+   {
+      
+      public static const NEAREST:String = "nearest";
+      
+      public static const LINEAR:String = "linear";
+      
+      public static const ANISOTROPIC2X:String = "anisotropic2x";
+      
+      public static const ANISOTROPIC4X:String = "anisotropic4x";
+      
+      public static const ANISOTROPIC8X:String = "anisotropic8x";
+      
+      public static const ANISOTROPIC16X:String = "anisotropic16x";
+       
+      public function Context3DTextureFilter()
+      {
+         super();
+      }
+   }
+}

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/2b7a1d9f/frameworks/projects/spriteflexjs/src/main/flex/flash/display3D/Context3DTextureFormat.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/spriteflexjs/src/main/flex/flash/display3D/Context3DTextureFormat.as b/frameworks/projects/spriteflexjs/src/main/flex/flash/display3D/Context3DTextureFormat.as
new file mode 100644
index 0000000..bf2fd32
--- /dev/null
+++ b/frameworks/projects/spriteflexjs/src/main/flex/flash/display3D/Context3DTextureFormat.as
@@ -0,0 +1,41 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  Licensed to the Apache Software Foundation (ASF) under one or more
+//  contributor license agreements.  See the NOTICE file distributed with
+//  this work for additional information regarding copyright ownership.
+//  The ASF licenses this file to You under the Apache License, Version 2.0
+//  (the "License"); you may not use this file except in compliance with
+//  the License.  You may obtain a copy of the License at
+//
+//      http://www.apache.org/licenses/LICENSE-2.0
+//
+//  Unless required by applicable law or agreed to in writing, software
+//  distributed under the License is distributed on an "AS IS" BASIS,
+//  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+//  See the License for the specific language governing permissions and
+//  limitations under the License.
+//
+////////////////////////////////////////////////////////////////////////////////
+package flash.display3D
+{
+   public final class Context3DTextureFormat extends Object
+   {
+      
+      public static const BGRA:String = "bgra";
+      
+      public static const RGBA_HALF_FLOAT:String = "rgbaHalfFloat";
+      
+      public static const COMPRESSED:String = "compressed";
+      
+      public static const COMPRESSED_ALPHA:String = "compressedAlpha";
+      
+      public static const BGR_PACKED:String = "bgrPacked565";
+      
+      public static const BGRA_PACKED:String = "bgraPacked4444";
+       
+      public function Context3DTextureFormat()
+      {
+         super();
+      }
+   }
+}

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/2b7a1d9f/frameworks/projects/spriteflexjs/src/main/flex/flash/display3D/Context3DTriangleFace.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/spriteflexjs/src/main/flex/flash/display3D/Context3DTriangleFace.as b/frameworks/projects/spriteflexjs/src/main/flex/flash/display3D/Context3DTriangleFace.as
new file mode 100644
index 0000000..5d3b4e1
--- /dev/null
+++ b/frameworks/projects/spriteflexjs/src/main/flex/flash/display3D/Context3DTriangleFace.as
@@ -0,0 +1,54 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  Licensed to the Apache Software Foundation (ASF) under one or more
+//  contributor license agreements.  See the NOTICE file distributed with
+//  this work for additional information regarding copyright ownership.
+//  The ASF licenses this file to You under the Apache License, Version 2.0
+//  (the "License"); you may not use this file except in compliance with
+//  the License.  You may obtain a copy of the License at
+//
+//      http://www.apache.org/licenses/LICENSE-2.0
+//
+//  Unless required by applicable law or agreed to in writing, software
+//  distributed under the License is distributed on an "AS IS" BASIS,
+//  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+//  See the License for the specific language governing permissions and
+//  limitations under the License.
+//
+////////////////////////////////////////////////////////////////////////////////
+package flash.display3D
+{
+	
+	public final class Context3DTriangleFace extends Object
+	{
+		
+		public static const NONE:String = "none";//int =gl.NONE;//
+		
+		public static const BACK:String = "back";//int = gl.BACK;//
+		
+		public static const FRONT:String = "front";//int = gl.FRONT;//
+		
+		public static const FRONT_AND_BACK:String = "frontAndBack";//int = gl.FRONT_AND_BACK; //
+		
+		public function Context3DTriangleFace()
+		{
+			super();
+		}
+		
+		public static function getGLVal(gl:WebGLRenderingContext,str:String):int
+		{
+			switch (str)
+			{
+			case NONE: 
+				return gl.NONE;
+			case BACK: 
+				return gl.FRONT;
+			case FRONT: 
+				return gl.BACK;
+			case FRONT_AND_BACK: 
+				return gl.FRONT_AND_BACK;
+			}
+			return 0;
+		}
+	}
+}

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/2b7a1d9f/frameworks/projects/spriteflexjs/src/main/flex/flash/display3D/Context3DVertexBufferFormat.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/spriteflexjs/src/main/flex/flash/display3D/Context3DVertexBufferFormat.as b/frameworks/projects/spriteflexjs/src/main/flex/flash/display3D/Context3DVertexBufferFormat.as
new file mode 100644
index 0000000..5589520
--- /dev/null
+++ b/frameworks/projects/spriteflexjs/src/main/flex/flash/display3D/Context3DVertexBufferFormat.as
@@ -0,0 +1,39 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  Licensed to the Apache Software Foundation (ASF) under one or more
+//  contributor license agreements.  See the NOTICE file distributed with
+//  this work for additional information regarding copyright ownership.
+//  The ASF licenses this file to You under the Apache License, Version 2.0
+//  (the "License"); you may not use this file except in compliance with
+//  the License.  You may obtain a copy of the License at
+//
+//      http://www.apache.org/licenses/LICENSE-2.0
+//
+//  Unless required by applicable law or agreed to in writing, software
+//  distributed under the License is distributed on an "AS IS" BASIS,
+//  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+//  See the License for the specific language governing permissions and
+//  limitations under the License.
+//
+////////////////////////////////////////////////////////////////////////////////
+package flash.display3D
+{
+   public final class Context3DVertexBufferFormat extends Object
+   {
+      
+      public static const FLOAT_1:String = "float1";
+      
+      public static const FLOAT_2:String = "float2";
+      
+      public static const FLOAT_3:String = "float3";
+      
+      public static const FLOAT_4:String = "float4";
+      
+      public static const BYTES_4:String = "bytes4";
+       
+      public function Context3DVertexBufferFormat()
+      {
+         super();
+      }
+   }
+}

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/2b7a1d9f/frameworks/projects/spriteflexjs/src/main/flex/flash/display3D/Context3DWrapMode.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/spriteflexjs/src/main/flex/flash/display3D/Context3DWrapMode.as b/frameworks/projects/spriteflexjs/src/main/flex/flash/display3D/Context3DWrapMode.as
new file mode 100644
index 0000000..59a3513
--- /dev/null
+++ b/frameworks/projects/spriteflexjs/src/main/flex/flash/display3D/Context3DWrapMode.as
@@ -0,0 +1,37 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  Licensed to the Apache Software Foundation (ASF) under one or more
+//  contributor license agreements.  See the NOTICE file distributed with
+//  this work for additional information regarding copyright ownership.
+//  The ASF licenses this file to You under the Apache License, Version 2.0
+//  (the "License"); you may not use this file except in compliance with
+//  the License.  You may obtain a copy of the License at
+//
+//      http://www.apache.org/licenses/LICENSE-2.0
+//
+//  Unless required by applicable law or agreed to in writing, software
+//  distributed under the License is distributed on an "AS IS" BASIS,
+//  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+//  See the License for the specific language governing permissions and
+//  limitations under the License.
+//
+////////////////////////////////////////////////////////////////////////////////
+package flash.display3D
+{
+   public final class Context3DWrapMode extends Object
+   {
+      
+      public static const REPEAT:String = "repeat";
+      
+      public static const CLAMP:String = "clamp";
+      
+      public static const CLAMP_U_REPEAT_V:String = "clamp_u_repeat_v";
+      
+      public static const REPEAT_U_CLAMP_V:String = "repeat_u_clamp_v";
+       
+      public function Context3DWrapMode()
+      {
+         super();
+      }
+   }
+}

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/2b7a1d9f/frameworks/projects/spriteflexjs/src/main/flex/flash/display3D/IndexBuffer3D.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/spriteflexjs/src/main/flex/flash/display3D/IndexBuffer3D.as b/frameworks/projects/spriteflexjs/src/main/flex/flash/display3D/IndexBuffer3D.as
new file mode 100644
index 0000000..e21583e
--- /dev/null
+++ b/frameworks/projects/spriteflexjs/src/main/flex/flash/display3D/IndexBuffer3D.as
@@ -0,0 +1,48 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  Licensed to the Apache Software Foundation (ASF) under one or more
+//  contributor license agreements.  See the NOTICE file distributed with
+//  this work for additional information regarding copyright ownership.
+//  The ASF licenses this file to You under the Apache License, Version 2.0
+//  (the "License"); you may not use this file except in compliance with
+//  the License.  You may obtain a copy of the License at
+//
+//      http://www.apache.org/licenses/LICENSE-2.0
+//
+//  Unless required by applicable law or agreed to in writing, software
+//  distributed under the License is distributed on an "AS IS" BASIS,
+//  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+//  See the License for the specific language governing permissions and
+//  limitations under the License.
+//
+////////////////////////////////////////////////////////////////////////////////
+package flash.display3D
+{
+   import flash.utils.ByteArray;
+   
+   public final class IndexBuffer3D extends Object
+   {
+       public var count:int;
+	   public var buff:WebGLBuffer;
+	   public var gl:WebGLRenderingContext;
+      public function IndexBuffer3D()
+      {
+         super();
+      }
+      
+	  /**
+		 * @flexjsignorecoercion Object
+		 */
+     public function uploadFromVector(data:Vector.<uint>, startOffset:int, count:int) : void{
+		gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, buff);
+		gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, new Uint16Array(data as Object), gl.STATIC_DRAW);	
+	 }
+      
+     public function uploadFromByteArray(data:ByteArray, byteArrayOffset:int, startOffset:int, count:int) : void{}
+      
+     public function dispose() : void{
+		 gl.deleteBuffer(buff);
+		 buff=null
+	 }
+   }
+}

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/2b7a1d9f/frameworks/projects/spriteflexjs/src/main/flex/flash/display3D/Program3D.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/spriteflexjs/src/main/flex/flash/display3D/Program3D.as b/frameworks/projects/spriteflexjs/src/main/flex/flash/display3D/Program3D.as
new file mode 100644
index 0000000..ac85612
--- /dev/null
+++ b/frameworks/projects/spriteflexjs/src/main/flex/flash/display3D/Program3D.as
@@ -0,0 +1,83 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  Licensed to the Apache Software Foundation (ASF) under one or more
+//  contributor license agreements.  See the NOTICE file distributed with
+//  this work for additional information regarding copyright ownership.
+//  The ASF licenses this file to You under the Apache License, Version 2.0
+//  (the "License"); you may not use this file except in compliance with
+//  the License.  You may obtain a copy of the License at
+//
+//      http://www.apache.org/licenses/LICENSE-2.0
+//
+//  Unless required by applicable law or agreed to in writing, software
+//  distributed under the License is distributed on an "AS IS" BASIS,
+//  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+//  See the License for the specific language governing permissions and
+//  limitations under the License.
+//
+////////////////////////////////////////////////////////////////////////////////
+package flash.display3D
+{
+	import flash.utils.ByteArray;
+	
+	public final class Program3D extends Object
+	{
+		public var fshader:WebGLShader;
+		public var vshader:WebGLShader;
+		public var program:WebGLProgram;
+		public var gl:WebGLRenderingContext;
+		private var uniformLocations:Object = { };
+		private var attribLocations:Object = { };
+		public function Program3D()
+		{
+			super();
+		}
+		
+		public function upload(vcode:ByteArray, fcode:ByteArray):void
+		{
+			fshader = gl.createShader(gl.FRAGMENT_SHADER);
+			vshader = gl.createShader(gl.VERTEX_SHADER);
+			vcode.position = fcode.position = 0;
+			gl.shaderSource(vshader, vcode.readUTFBytes(vcode.length));
+			gl.compileShader(vshader);
+			if (!gl.getShaderParameter(vshader,gl.COMPILE_STATUS)) {
+				throw vshader+"\n"+vcode+"\n" + (gl.getShaderInfoLog(vshader));
+			}
+			gl.shaderSource(fshader, fcode.readUTFBytes(fcode.length));
+			gl.compileShader(fshader);
+			if (!gl.getShaderParameter(fshader,gl.COMPILE_STATUS)) {
+				throw fcode+"\n" + (gl.getShaderInfoLog(fshader));
+			}
+			gl.attachShader(program, vshader);
+			gl.attachShader(program, fshader);
+			gl.linkProgram(program);
+			if (!gl.getProgramParameter(program,gl.LINK_STATUS)) {
+				throw (gl.getProgramInfoLog(program));
+			}
+		}
+		
+		public function dispose():void
+		{
+			gl.deleteShader(fshader);
+			gl.deleteShader(vshader);
+			gl.deleteProgram(program);
+		}
+		
+		public function getUniformLocation(name:String):WebGLUniformLocation {
+			var loc:WebGLUniformLocation = uniformLocations[name];
+			if (loc==null) {
+				loc = uniformLocations[name] = gl.getUniformLocation(program,name);
+			}
+			return loc;
+		}
+		public function getAttribLocation(name:String):Number {
+			var loc:Object = attribLocations[name];
+			if (loc==null) {
+				loc = attribLocations[name] = gl.getAttribLocation(program,name);
+			}
+			var locnum:Number = Number(loc);
+			gl.enableVertexAttribArray(locnum);
+			return locnum;
+		}
+	}
+}

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/2b7a1d9f/frameworks/projects/spriteflexjs/src/main/flex/flash/display3D/VertexBuffer3D.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/spriteflexjs/src/main/flex/flash/display3D/VertexBuffer3D.as b/frameworks/projects/spriteflexjs/src/main/flex/flash/display3D/VertexBuffer3D.as
new file mode 100644
index 0000000..5610f6f
--- /dev/null
+++ b/frameworks/projects/spriteflexjs/src/main/flex/flash/display3D/VertexBuffer3D.as
@@ -0,0 +1,48 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  Licensed to the Apache Software Foundation (ASF) under one or more
+//  contributor license agreements.  See the NOTICE file distributed with
+//  this work for additional information regarding copyright ownership.
+//  The ASF licenses this file to You under the Apache License, Version 2.0
+//  (the "License"); you may not use this file except in compliance with
+//  the License.  You may obtain a copy of the License at
+//
+//      http://www.apache.org/licenses/LICENSE-2.0
+//
+//  Unless required by applicable law or agreed to in writing, software
+//  distributed under the License is distributed on an "AS IS" BASIS,
+//  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+//  See the License for the specific language governing permissions and
+//  limitations under the License.
+//
+////////////////////////////////////////////////////////////////////////////////
+package flash.display3D
+{
+   import flash.utils.ByteArray;
+   
+   public class VertexBuffer3D extends Object
+   {
+       public var buff:WebGLBuffer;
+	   public var gl:WebGLRenderingContext;
+      public function VertexBuffer3D()
+      {
+         super();
+      }
+      
+	  /**
+		 * @flexjsignorecoercion Object
+		 */
+     public function uploadFromVector(data:Vector.<Number>, startVertex:int, numVertices:int) : void{
+		 gl.bindBuffer(gl.ARRAY_BUFFER, buff);
+		gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(data as Object), gl.STATIC_DRAW);
+			
+	 }
+      
+     public function uploadFromByteArray(data:ByteArray, byteArrayOffset:int, startVertex:int, numVertices:int) : void{}
+      
+     public function dispose() : void{
+		 gl.deleteBuffer(buff);
+		 buff = null;
+	 }
+   }
+}

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/2b7a1d9f/frameworks/projects/spriteflexjs/src/main/flex/flash/display3D/textures/CubeTexture.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/spriteflexjs/src/main/flex/flash/display3D/textures/CubeTexture.as b/frameworks/projects/spriteflexjs/src/main/flex/flash/display3D/textures/CubeTexture.as
new file mode 100644
index 0000000..f4c30ec
--- /dev/null
+++ b/frameworks/projects/spriteflexjs/src/main/flex/flash/display3D/textures/CubeTexture.as
@@ -0,0 +1,38 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  Licensed to the Apache Software Foundation (ASF) under one or more
+//  contributor license agreements.  See the NOTICE file distributed with
+//  this work for additional information regarding copyright ownership.
+//  The ASF licenses this file to You under the Apache License, Version 2.0
+//  (the "License"); you may not use this file except in compliance with
+//  the License.  You may obtain a copy of the License at
+//
+//      http://www.apache.org/licenses/LICENSE-2.0
+//
+//  Unless required by applicable law or agreed to in writing, software
+//  distributed under the License is distributed on an "AS IS" BASIS,
+//  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+//  See the License for the specific language governing permissions and
+//  limitations under the License.
+//
+////////////////////////////////////////////////////////////////////////////////
+package flash.display3D.textures
+{
+   import flash.display.BitmapData;
+   import flash.utils.ByteArray;
+   
+   public final class CubeTexture extends TextureBase
+   {
+       
+      public function CubeTexture()
+      {
+         super();
+      }
+      
+     public function uploadFromBitmapData(param1:BitmapData, param2:uint, param3:uint = 0) : void{}
+      
+     public function uploadFromByteArray(param1:ByteArray, param2:uint, param3:uint, param4:uint = 0) : void{}
+      
+     public function uploadCompressedTextureFromByteArray(param1:ByteArray, param2:uint, param3:Boolean = false) : void{}
+   }
+}

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/2b7a1d9f/frameworks/projects/spriteflexjs/src/main/flex/flash/display3D/textures/RectangleTexture.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/spriteflexjs/src/main/flex/flash/display3D/textures/RectangleTexture.as b/frameworks/projects/spriteflexjs/src/main/flex/flash/display3D/textures/RectangleTexture.as
new file mode 100644
index 0000000..f4b4d12
--- /dev/null
+++ b/frameworks/projects/spriteflexjs/src/main/flex/flash/display3D/textures/RectangleTexture.as
@@ -0,0 +1,36 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  Licensed to the Apache Software Foundation (ASF) under one or more
+//  contributor license agreements.  See the NOTICE file distributed with
+//  this work for additional information regarding copyright ownership.
+//  The ASF licenses this file to You under the Apache License, Version 2.0
+//  (the "License"); you may not use this file except in compliance with
+//  the License.  You may obtain a copy of the License at
+//
+//      http://www.apache.org/licenses/LICENSE-2.0
+//
+//  Unless required by applicable law or agreed to in writing, software
+//  distributed under the License is distributed on an "AS IS" BASIS,
+//  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+//  See the License for the specific language governing permissions and
+//  limitations under the License.
+//
+////////////////////////////////////////////////////////////////////////////////
+package flash.display3D.textures
+{
+   import flash.display.BitmapData;
+   import flash.utils.ByteArray;
+   
+   public final class RectangleTexture extends TextureBase
+   {
+       
+      public function RectangleTexture()
+      {
+         super();
+      }
+      
+     public function uploadFromBitmapData(param1:BitmapData) : void{}
+      
+     public function uploadFromByteArray(param1:ByteArray, param2:uint) : void{}
+   }
+}

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/2b7a1d9f/frameworks/projects/spriteflexjs/src/main/flex/flash/display3D/textures/Texture.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/spriteflexjs/src/main/flex/flash/display3D/textures/Texture.as b/frameworks/projects/spriteflexjs/src/main/flex/flash/display3D/textures/Texture.as
new file mode 100644
index 0000000..e996d9d
--- /dev/null
+++ b/frameworks/projects/spriteflexjs/src/main/flex/flash/display3D/textures/Texture.as
@@ -0,0 +1,69 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  Licensed to the Apache Software Foundation (ASF) under one or more
+//  contributor license agreements.  See the NOTICE file distributed with
+//  this work for additional information regarding copyright ownership.
+//  The ASF licenses this file to You under the Apache License, Version 2.0
+//  (the "License"); you may not use this file except in compliance with
+//  the License.  You may obtain a copy of the License at
+//
+//      http://www.apache.org/licenses/LICENSE-2.0
+//
+//  Unless required by applicable law or agreed to in writing, software
+//  distributed under the License is distributed on an "AS IS" BASIS,
+//  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+//  See the License for the specific language governing permissions and
+//  limitations under the License.
+//
+////////////////////////////////////////////////////////////////////////////////
+package flash.display3D.textures
+{
+	import flash.display.BitmapData;
+	import flash.utils.ByteArray;
+	
+	public final class Texture extends TextureBase
+	{
+		public var gl:WebGLRenderingContext;
+		public var texture:WebGLTexture;
+		public var repeat:Boolean = true;
+		public function Texture()
+		{
+			super();
+		}
+		
+		public function uploadFromBitmapData(bitmapData:BitmapData, maplevel:uint = 0):void
+		{
+			uploadFromImg(bitmapData.image,maplevel);
+		}
+		
+		public function uploadFromImg(img:Object, maplevel:uint = 0):void
+		{
+			gl.bindTexture(gl.TEXTURE_2D, texture);
+			gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, gl.RGBA, gl.UNSIGNED_BYTE, img);
+			if (repeat){
+				gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.REPEAT);
+				gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.REPEAT);
+			}else{
+				gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE);
+				gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE);
+			}
+			if(maplevel>0){
+				gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.LINEAR);
+				gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.LINEAR_MIPMAP_NEAREST);
+				gl.generateMipmap(gl.TEXTURE_2D);
+			}else {
+				gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.NEAREST);
+				gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.NEAREST);
+			}
+			gl.bindTexture(gl.TEXTURE_2D, null);
+		}
+		
+		public function uploadFromByteArray(param1:ByteArray, param2:uint, param3:uint = 0):void
+		{
+		}
+		
+		public function uploadCompressedTextureFromByteArray(param1:ByteArray, param2:uint, param3:Boolean = false):void
+		{
+		}
+	}
+}

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/2b7a1d9f/frameworks/projects/spriteflexjs/src/main/flex/flash/display3D/textures/TextureBase.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/spriteflexjs/src/main/flex/flash/display3D/textures/TextureBase.as b/frameworks/projects/spriteflexjs/src/main/flex/flash/display3D/textures/TextureBase.as
new file mode 100644
index 0000000..a3dd04f
--- /dev/null
+++ b/frameworks/projects/spriteflexjs/src/main/flex/flash/display3D/textures/TextureBase.as
@@ -0,0 +1,33 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  Licensed to the Apache Software Foundation (ASF) under one or more
+//  contributor license agreements.  See the NOTICE file distributed with
+//  this work for additional information regarding copyright ownership.
+//  The ASF licenses this file to You under the Apache License, Version 2.0
+//  (the "License"); you may not use this file except in compliance with
+//  the License.  You may obtain a copy of the License at
+//
+//      http://www.apache.org/licenses/LICENSE-2.0
+//
+//  Unless required by applicable law or agreed to in writing, software
+//  distributed under the License is distributed on an "AS IS" BASIS,
+//  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+//  See the License for the specific language governing permissions and
+//  limitations under the License.
+//
+////////////////////////////////////////////////////////////////////////////////
+package flash.display3D.textures
+{
+   import flash.events.EventDispatcher;
+   
+   public class TextureBase extends EventDispatcher
+   {
+       
+      public function TextureBase()
+      {
+         super();
+      }
+      
+     public function dispose() : void{}
+   }
+}

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/2b7a1d9f/frameworks/projects/spriteflexjs/src/main/flex/flash/display3D/textures/VideoTexture.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/spriteflexjs/src/main/flex/flash/display3D/textures/VideoTexture.as b/frameworks/projects/spriteflexjs/src/main/flex/flash/display3D/textures/VideoTexture.as
new file mode 100644
index 0000000..c750ed8
--- /dev/null
+++ b/frameworks/projects/spriteflexjs/src/main/flex/flash/display3D/textures/VideoTexture.as
@@ -0,0 +1,38 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  Licensed to the Apache Software Foundation (ASF) under one or more
+//  contributor license agreements.  See the NOTICE file distributed with
+//  this work for additional information regarding copyright ownership.
+//  The ASF licenses this file to You under the Apache License, Version 2.0
+//  (the "License"); you may not use this file except in compliance with
+//  the License.  You may obtain a copy of the License at
+//
+//      http://www.apache.org/licenses/LICENSE-2.0
+//
+//  Unless required by applicable law or agreed to in writing, software
+//  distributed under the License is distributed on an "AS IS" BASIS,
+//  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+//  See the License for the specific language governing permissions and
+//  limitations under the License.
+//
+////////////////////////////////////////////////////////////////////////////////
+package flash.display3D.textures
+{
+   
+   public final class VideoTexture extends TextureBase
+   {
+       
+      public function VideoTexture()
+      {
+         super();
+      }
+      
+     //public function attachNetStream(param1:NetStream) : void;
+      
+     public function attachCamera(param1:Object/*Camera*/) : void{}
+      
+     public function get videoWidth() : int{return 0}
+      
+     public function get videoHeight() : int{return 0}
+   }
+}

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/2b7a1d9f/frameworks/projects/spriteflexjs/src/main/flex/flash/errors/IOError.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/spriteflexjs/src/main/flex/flash/errors/IOError.as b/frameworks/projects/spriteflexjs/src/main/flex/flash/errors/IOError.as
new file mode 100644
index 0000000..098ef83
--- /dev/null
+++ b/frameworks/projects/spriteflexjs/src/main/flex/flash/errors/IOError.as
@@ -0,0 +1,29 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  Licensed to the Apache Software Foundation (ASF) under one or more
+//  contributor license agreements.  See the NOTICE file distributed with
+//  this work for additional information regarding copyright ownership.
+//  The ASF licenses this file to You under the Apache License, Version 2.0
+//  (the "License"); you may not use this file except in compliance with
+//  the License.  You may obtain a copy of the License at
+//
+//      http://www.apache.org/licenses/LICENSE-2.0
+//
+//  Unless required by applicable law or agreed to in writing, software
+//  distributed under the License is distributed on an "AS IS" BASIS,
+//  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+//  See the License for the specific language governing permissions and
+//  limitations under the License.
+//
+////////////////////////////////////////////////////////////////////////////////
+package flash.errors
+{
+   public dynamic class IOError extends Error
+   {
+       
+      public function IOError(message:String = "", id:int = 0)
+      {
+         super(message,id);
+      }
+   }
+}

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/2b7a1d9f/frameworks/projects/spriteflexjs/src/main/flex/flash/errors/IllegalOperationError.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/spriteflexjs/src/main/flex/flash/errors/IllegalOperationError.as b/frameworks/projects/spriteflexjs/src/main/flex/flash/errors/IllegalOperationError.as
new file mode 100644
index 0000000..de5cb48
--- /dev/null
+++ b/frameworks/projects/spriteflexjs/src/main/flex/flash/errors/IllegalOperationError.as
@@ -0,0 +1,29 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  Licensed to the Apache Software Foundation (ASF) under one or more
+//  contributor license agreements.  See the NOTICE file distributed with
+//  this work for additional information regarding copyright ownership.
+//  The ASF licenses this file to You under the Apache License, Version 2.0
+//  (the "License"); you may not use this file except in compliance with
+//  the License.  You may obtain a copy of the License at
+//
+//      http://www.apache.org/licenses/LICENSE-2.0
+//
+//  Unless required by applicable law or agreed to in writing, software
+//  distributed under the License is distributed on an "AS IS" BASIS,
+//  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+//  See the License for the specific language governing permissions and
+//  limitations under the License.
+//
+////////////////////////////////////////////////////////////////////////////////
+package flash.errors
+{
+   public dynamic class IllegalOperationError extends Error
+   {
+       
+      public function IllegalOperationError(message:String = "", id:int = 0)
+      {
+         super(message,id);
+      }
+   }
+}

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/2b7a1d9f/frameworks/projects/spriteflexjs/src/main/flex/flash/events/ErrorEvent.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/spriteflexjs/src/main/flex/flash/events/ErrorEvent.as b/frameworks/projects/spriteflexjs/src/main/flex/flash/events/ErrorEvent.as
new file mode 100644
index 0000000..e9b9cef
--- /dev/null
+++ b/frameworks/projects/spriteflexjs/src/main/flex/flash/events/ErrorEvent.as
@@ -0,0 +1,49 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  Licensed to the Apache Software Foundation (ASF) under one or more
+//  contributor license agreements.  See the NOTICE file distributed with
+//  this work for additional information regarding copyright ownership.
+//  The ASF licenses this file to You under the Apache License, Version 2.0
+//  (the "License"); you may not use this file except in compliance with
+//  the License.  You may obtain a copy of the License at
+//
+//      http://www.apache.org/licenses/LICENSE-2.0
+//
+//  Unless required by applicable law or agreed to in writing, software
+//  distributed under the License is distributed on an "AS IS" BASIS,
+//  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+//  See the License for the specific language governing permissions and
+//  limitations under the License.
+//
+////////////////////////////////////////////////////////////////////////////////
+package flash.events
+{
+   public class ErrorEvent extends TextEvent
+   {
+      
+      public static const ERROR:String = "error";
+       
+      private var m_errorID:int;
+      
+      public function ErrorEvent(type:String, bubbles:Boolean = false, cancelable:Boolean = false, text:String = "", id:int = 0)
+      {
+         super(type,bubbles,cancelable,text);
+         this.m_errorID = id;
+      }
+      
+      public function get errorID() : int
+      {
+         return this.m_errorID;
+      }
+      
+      override public function clone() : Event
+      {
+         return new ErrorEvent(type,bubbles,cancelable,text,this.m_errorID);
+      }
+      
+      override public function toString() : String
+      {
+         return formatToString("ErrorEvent","type","bubbles","cancelable","eventPhase","text");
+      }
+   }
+}

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/2b7a1d9f/frameworks/projects/spriteflexjs/src/main/flex/flash/events/Event.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/spriteflexjs/src/main/flex/flash/events/Event.as b/frameworks/projects/spriteflexjs/src/main/flex/flash/events/Event.as
new file mode 100644
index 0000000..b17a1fb
--- /dev/null
+++ b/frameworks/projects/spriteflexjs/src/main/flex/flash/events/Event.as
@@ -0,0 +1,176 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  Licensed to the Apache Software Foundation (ASF) under one or more
+//  contributor license agreements.  See the NOTICE file distributed with
+//  this work for additional information regarding copyright ownership.
+//  The ASF licenses this file to You under the Apache License, Version 2.0
+//  (the "License"); you may not use this file except in compliance with
+//  the License.  You may obtain a copy of the License at
+//
+//      http://www.apache.org/licenses/LICENSE-2.0
+//
+//  Unless required by applicable law or agreed to in writing, software
+//  distributed under the License is distributed on an "AS IS" BASIS,
+//  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+//  See the License for the specific language governing permissions and
+//  limitations under the License.
+//
+////////////////////////////////////////////////////////////////////////////////
+package flash.events
+{
+	
+	public class Event extends Object
+	{
+		
+		public static const ACTIVATE:String = "activate";
+		
+		public static const ADDED:String = "added";
+		
+		public static const ADDED_TO_STAGE:String = "addedToStage";
+		
+		public static const BROWSER_ZOOM_CHANGE:String = "browserZoomChange";
+		
+		public static const CANCEL:String = "cancel";
+		
+		public static const CHANGE:String = "change";
+		
+		public static const CLEAR:String = "clear";
+		
+		public static const CLOSE:String = "close";
+		
+		public static const COMPLETE:String = "complete";
+		
+		public static const CONNECT:String = "connect";
+		
+		public static const COPY:String = "copy";
+		
+		public static const CUT:String = "cut";
+		
+		public static const DEACTIVATE:String = "deactivate";
+		
+		public static const ENTER_FRAME:String = "enterFrame";
+		
+		public static const FRAME_CONSTRUCTED:String = "frameConstructed";
+		
+		public static const EXIT_FRAME:String = "exitFrame";
+		
+		public static const FRAME_LABEL:String = "frameLabel";
+		
+		public static const ID3:String = "id3";
+		
+		public static const INIT:String = "init";
+		
+		public static const MOUSE_LEAVE:String = "mouseLeave";
+		
+		public static const OPEN:String = "open";
+		
+		public static const PASTE:String = "paste";
+		
+		public static const REMOVED:String = "removed";
+		
+		public static const REMOVED_FROM_STAGE:String = "removedFromStage";
+		
+		public static const RENDER:String = "render";
+		
+		public static const RESIZE:String = "resize";
+		
+		public static const SCROLL:String = "scroll";
+		
+		public static const TEXT_INTERACTION_MODE_CHANGE:String = "textInteractionModeChange";
+		
+		public static const SELECT:String = "select";
+		
+		public static const SELECT_ALL:String = "selectAll";
+		
+		public static const SOUND_COMPLETE:String = "soundComplete";
+		
+		public static const TAB_CHILDREN_CHANGE:String = "tabChildrenChange";
+		
+		public static const TAB_ENABLED_CHANGE:String = "tabEnabledChange";
+		
+		public static const TAB_INDEX_CHANGE:String = "tabIndexChange";
+		
+		public static const UNLOAD:String = "unload";
+		
+		public static const FULLSCREEN:String = "fullScreen";
+		
+		public static const CONTEXT3D_CREATE:String = "context3DCreate";
+		
+		public static const TEXTURE_READY:String = "textureReady";
+		
+		public static const VIDEO_FRAME:String = "videoFrame";
+		
+		public static const SUSPEND:String = "suspend";
+		
+		public static const CHANNEL_MESSAGE:String = "channelMessage";
+		
+		public static const CHANNEL_STATE:String = "channelState";
+		
+		public static const WORKER_STATE:String = "workerState";
+		
+		private var _type:String;
+		
+		private var _bubbles:Boolean;
+		private var _cancelable:Boolean;
+		private var _target:Object;
+		private var _currentTarget:Object;
+
+		public function Event(type:String, bubbles:Boolean = false, cancelable:Boolean = false)
+		{
+			super();
+			this.ctor(type, bubbles, cancelable);
+		}
+		
+		public function formatToString(className:String, ... args):String
+		{
+			return null
+		}
+		
+		private function ctor(type:String, bubbles:Boolean, cancelable:Boolean):void
+		{
+			_type = type;
+			_bubbles = bubbles;
+			_cancelable = cancelable;
+		}
+		
+		public function clone():Event
+		{
+			return new Event(this.type, this.bubbles, this.cancelable);
+		}
+		
+		public function toString():String
+		{
+			return this.formatToString("Event", "type", "bubbles", "cancelable", "eventPhase");
+		}
+		
+		public function get type():String  { return _type }
+		
+		public function get bubbles():Boolean  { return _bubbles }
+		
+		public function get cancelable():Boolean  { return _cancelable }
+		
+		public function get target():Object  { return _target }
+		
+		public function set target(value:Object):void  { _target = value }
+		
+		public function get currentTarget():Object  { return _currentTarget }
+		
+		public function set currentTarget(value:Object):void  { _currentTarget = value }
+		
+		public function get eventPhase():uint  { return 0 }
+		
+		public function stopPropagation():void
+		{
+		}
+		
+		public function stopImmediatePropagation():void
+		{
+		}
+		
+		public function preventDefault():void
+		{
+		}
+		
+		public function isDefaultPrevented():Boolean  { return false }
+	}
+}

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/2b7a1d9f/frameworks/projects/spriteflexjs/src/main/flex/flash/events/EventDispatcher.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/spriteflexjs/src/main/flex/flash/events/EventDispatcher.as b/frameworks/projects/spriteflexjs/src/main/flex/flash/events/EventDispatcher.as
new file mode 100755
index 0000000..2618cdc
--- /dev/null
+++ b/frameworks/projects/spriteflexjs/src/main/flex/flash/events/EventDispatcher.as
@@ -0,0 +1,130 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  Licensed to the Apache Software Foundation (ASF) under one or more
+//  contributor license agreements.  See the NOTICE file distributed with
+//  this work for additional information regarding copyright ownership.
+//  The ASF licenses this file to You under the Apache License, Version 2.0
+//  (the "License"); you may not use this file except in compliance with
+//  the License.  You may obtain a copy of the License at
+//
+//      http://www.apache.org/licenses/LICENSE-2.0
+//
+//  Unless required by applicable law or agreed to in writing, software
+//  distributed under the License is distributed on an "AS IS" BASIS,
+//  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+//  See the License for the specific language governing permissions and
+//  limitations under the License.
+//
+////////////////////////////////////////////////////////////////////////////////
+package flash.events
+{
+	import flash.net.*;
+	
+	[Event(name = "deactivate", type = "flash.events.Event")]
+	[Event(name = "activate", type = "flash.events.Event")]
+	public class EventDispatcher implements IEventDispatcher
+	{
+		private var listeners:Object = {};
+		
+		public function EventDispatcher(target:IEventDispatcher = null)
+		{
+			super();
+			this.ctor(target);
+		}
+		
+		private static function trimHeaderValue(headerValue:String):String
+		{
+			var currChar:String = null;
+			var indexOfFirstValueChar:uint = 0;
+			var headerValueLen:uint = headerValue.length;
+			var done:Boolean = false;
+			while (indexOfFirstValueChar < headerValueLen && !done)
+			{
+				currChar = headerValue.charAt(indexOfFirstValueChar);
+				done = currChar != " " && currChar != "\t";
+				if (!done)
+				{
+					indexOfFirstValueChar++;
+				}
+			}
+			var indexOfLastValueChar:uint = headerValueLen;
+			done = false;
+			while (indexOfLastValueChar > indexOfFirstValueChar && !done)
+			{
+				currChar = headerValue.charAt(indexOfLastValueChar - 1);
+				done = currChar != " " && currChar != "\t";
+				if (!done)
+				{
+					indexOfLastValueChar--;
+				}
+			}
+			return headerValue.substring(indexOfFirstValueChar, indexOfLastValueChar);
+		}
+		
+		private function ctor(param1:IEventDispatcher):void
+		{
+		}
+		
+		public function addEventListener(type:String, listener:Function, useCapture:Boolean = false, priority:int = 0, useWeakReference:Boolean = false):void
+		{
+			var funcs:Array = listeners[type] = listeners[type] || [];
+			var i:Object = funcs.indexOf(listener);
+			if (i != -1)
+			{
+				funcs.splice(i, 1);
+			}
+			funcs.push(listener);
+		}
+		
+		public function removeEventListener(type:String, listener:Function, useCapture:Boolean = false):void
+		{
+			var funcs:Array = listeners[type];
+			if (funcs)
+			{
+				var i:Object = funcs.indexOf(listener);
+				if (i != -1)
+				{
+					funcs.splice(i, 1);
+				}
+				if (funcs.length === 0)
+				{
+					listeners[type] = null;
+					delete listeners[type];
+				}
+			}
+		}
+		
+		public function dispatchEvent(event:Event):Boolean
+		{
+			if (event.target)
+			{
+				return this.dispatchEventFunction(event.clone());
+			}
+			return this.dispatchEventFunction(event);
+		}
+		
+		public function hasEventListener(type:String):Boolean
+		{
+			return listeners[type] != null;
+		}
+		
+		public function willTrigger(param1:String):Boolean  { return false }
+		
+		private function dispatchEventFunction(event:Event):Boolean
+		{
+			event.target = this;
+			event.currentTarget = this;
+			var funcs:Array = listeners[event.type];
+			if (funcs)
+			{
+				var len:int = funcs.length
+				for (var i:int = 0; i < len;i++ ){
+					var func:Function = funcs[i];
+					func(event);
+				}
+			}
+			return false;
+		}
+	
+	}
+}

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/2b7a1d9f/frameworks/projects/spriteflexjs/src/main/flex/flash/events/HTTPStatusEvent.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/spriteflexjs/src/main/flex/flash/events/HTTPStatusEvent.as b/frameworks/projects/spriteflexjs/src/main/flex/flash/events/HTTPStatusEvent.as
new file mode 100644
index 0000000..55ff18c
--- /dev/null
+++ b/frameworks/projects/spriteflexjs/src/main/flex/flash/events/HTTPStatusEvent.as
@@ -0,0 +1,92 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  Licensed to the Apache Software Foundation (ASF) under one or more
+//  contributor license agreements.  See the NOTICE file distributed with
+//  this work for additional information regarding copyright ownership.
+//  The ASF licenses this file to You under the Apache License, Version 2.0
+//  (the "License"); you may not use this file except in compliance with
+//  the License.  You may obtain a copy of the License at
+//
+//      http://www.apache.org/licenses/LICENSE-2.0
+//
+//  Unless required by applicable law or agreed to in writing, software
+//  distributed under the License is distributed on an "AS IS" BASIS,
+//  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+//  See the License for the specific language governing permissions and
+//  limitations under the License.
+//
+////////////////////////////////////////////////////////////////////////////////
+package flash.events
+{
+   public class HTTPStatusEvent extends Event
+   {
+      
+      public static const HTTP_STATUS:String = "httpStatus";
+      
+      public static const HTTP_RESPONSE_STATUS:String = "httpResponseStatus";
+       
+      private var m_status:int;
+      
+      private var m_responseHeaders:Array;
+      
+      private var m_responseUrl:String;
+      
+      private var m_redirected:Boolean;
+      
+      public function HTTPStatusEvent(type:String, bubbles:Boolean = false, cancelable:Boolean = false, status:int = 0, redirected:Boolean = false)
+      {
+         super(type,bubbles,cancelable);
+         this.m_status = status;
+         this.m_redirected = redirected;
+         this.m_responseHeaders = [];
+      }
+      
+      override public function clone() : Event
+      {
+         var result:HTTPStatusEvent = new HTTPStatusEvent(type,bubbles,cancelable,this.status,this.redirected);
+         result.responseURL = this.responseURL;
+         result.responseHeaders = this.responseHeaders;
+         return result;
+      }
+      
+      override public function toString() : String
+      {
+         return formatToString("HTTPStatusEvent","type","bubbles","cancelable","eventPhase","status","redirected","responseURL");
+      }
+      
+      public function get status() : int
+      {
+         return this.m_status;
+      }
+      
+      public function get responseURL() : String
+      {
+         return this.m_responseUrl;
+      }
+      
+      public function set responseURL(value:String) : void
+      {
+         this.m_responseUrl = value;
+      }
+      
+      public function get responseHeaders() : Array
+      {
+         return this.m_responseHeaders;
+      }
+      
+      public function set responseHeaders(value:Array) : void
+      {
+         this.m_responseHeaders = value;
+      }
+      
+      public function get redirected() : Boolean
+      {
+         return this.m_redirected;
+      }
+      
+      public function set redirected(value:Boolean) : void
+      {
+         this.m_redirected = value;
+      }
+   }
+}

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/2b7a1d9f/frameworks/projects/spriteflexjs/src/main/flex/flash/events/IEventDispatcher.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/spriteflexjs/src/main/flex/flash/events/IEventDispatcher.as b/frameworks/projects/spriteflexjs/src/main/flex/flash/events/IEventDispatcher.as
new file mode 100644
index 0000000..6653fdd
--- /dev/null
+++ b/frameworks/projects/spriteflexjs/src/main/flex/flash/events/IEventDispatcher.as
@@ -0,0 +1,29 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  Licensed to the Apache Software Foundation (ASF) under one or more
+//  contributor license agreements.  See the NOTICE file distributed with
+//  this work for additional information regarding copyright ownership.
+//  The ASF licenses this file to You under the Apache License, Version 2.0
+//  (the "License"); you may not use this file except in compliance with
+//  the License.  You may obtain a copy of the License at
+//
+//      http://www.apache.org/licenses/LICENSE-2.0
+//
+//  Unless required by applicable law or agreed to in writing, software
+//  distributed under the License is distributed on an "AS IS" BASIS,
+//  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+//  See the License for the specific language governing permissions and
+//  limitations under the License.
+//
+////////////////////////////////////////////////////////////////////////////////
+package flash.events
+{
+	public interface IEventDispatcher
+	{
+		function addEventListener(type:String, listener:Function, useCapture:Boolean = false, priority:int = 0, useWeakReference:Boolean = false):void;
+		function dispatchEvent(event:Event):Boolean;
+		function hasEventListener(type:String):Boolean;
+		function removeEventListener(type:String, listener:Function, useCapture:Boolean = false):void;
+		function willTrigger(type:String):Boolean;
+	}
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/2b7a1d9f/frameworks/projects/spriteflexjs/src/main/flex/flash/events/IOErrorEvent.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/spriteflexjs/src/main/flex/flash/events/IOErrorEvent.as b/frameworks/projects/spriteflexjs/src/main/flex/flash/events/IOErrorEvent.as
new file mode 100644
index 0000000..b7ddc42
--- /dev/null
+++ b/frameworks/projects/spriteflexjs/src/main/flex/flash/events/IOErrorEvent.as
@@ -0,0 +1,50 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  Licensed to the Apache Software Foundation (ASF) under one or more
+//  contributor license agreements.  See the NOTICE file distributed with
+//  this work for additional information regarding copyright ownership.
+//  The ASF licenses this file to You under the Apache License, Version 2.0
+//  (the "License"); you may not use this file except in compliance with
+//  the License.  You may obtain a copy of the License at
+//
+//      http://www.apache.org/licenses/LICENSE-2.0
+//
+//  Unless required by applicable law or agreed to in writing, software
+//  distributed under the License is distributed on an "AS IS" BASIS,
+//  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+//  See the License for the specific language governing permissions and
+//  limitations under the License.
+//
+////////////////////////////////////////////////////////////////////////////////
+package flash.events
+{
+   public class IOErrorEvent extends ErrorEvent
+   {
+      
+      public static const IO_ERROR:String = "ioError";
+      
+      [Inspectable(environment="none")]
+      public static const NETWORK_ERROR:String = "networkError";
+      
+      [Inspectable(environment="none")]
+      public static const DISK_ERROR:String = "diskError";
+      
+      [Inspectable(environment="none")]
+      public static const VERIFY_ERROR:String = "verifyError";
+       
+      public function IOErrorEvent(type:String, bubbles:Boolean = false, cancelable:Boolean = false, text:String = "", id:int = 0)
+      {
+         super(type,bubbles,cancelable,text,id);
+      }
+      
+      override public function clone() : Event
+      {
+         return new IOErrorEvent(type,bubbles,cancelable,text,errorID);
+      }
+      
+      override public function toString() : String
+      {
+         return formatToString("IOErrorEvent","type","bubbles","cancelable","eventPhase","text");
+      }
+   }
+}


Mime
View raw message