Packagecom.flashdynamix.motion.layers
Classpublic class VectorLayer
InheritanceVectorLayer Inheritance flash.display.Shape

The VectorLayer class draws the IVectors in its list to a single Graphics.
Though using the VectorLayer can prove to be a very convient way to draw vectors it doesn't necessarily yield any amazing performance differences. This is until the bitmapData property is used to get a bitmap render of the vector drawing allowing for further optimizations than the built-in cacheAsBitmap property can yield.



Public Properties
 PropertyDefined by
  bitmap : Bitmap
[read-only] Returns a transparent Bitmap of the drawing.
VectorLayer
  bitmapData : BitmapData
[read-only] Returns a transparent BitmapData of the drawing.
VectorLayer
  layerHeight : int
VectorLayer
  layerWidth : int
VectorLayer
  list : Array
The list of IVectors to be drawn on each render.
VectorLayer
  rect : Rectangle
VectorLayer
Public Methods
 MethodDefined by
  
VectorLayer(width:int = 500, height:int = 500, bgColor:Object = null, cacheAsBitmap:Boolean = false)
VectorLayer
  
add(vector:IVector):IVector
Adds an IVector into the list.
VectorLayer
  
clear():void
Removes all IVectors from the list.
VectorLayer
  
dispose():void
Disposes the VectorLayer ready for garbage collection.
VectorLayer
  
remove(vector:IVector):Boolean
Removes an IVector into the list.
VectorLayer
  
render(e:Event = null):void
VectorLayer
  
startRender():void
Starts rendering the VectorLayer on construction rendering automatically starts.
VectorLayer
  
stopRender():void
Stops rendering the VectorLayer this can be resumed via the startRender method.
VectorLayer
  
toString():String
VectorLayer
Protected Methods
 MethodDefined by
  
addEvent(item:EventDispatcher, type:String, liststener:Function, priority:int = 0, useWeakReference:Boolean = true):void
VectorLayer
  
removeEvent(item:EventDispatcher, type:String, listener:Function):void
VectorLayer
Property detail
bitmapproperty
bitmap:Bitmap  [read-only]

Returns a transparent Bitmap of the drawing.

Implementation
    public function get bitmap():Bitmap
bitmapDataproperty 
bitmapData:BitmapData  [read-only]

Returns a transparent BitmapData of the drawing.

Implementation
    public function get bitmapData():BitmapData
layerHeightproperty 
layerHeight:int  [read-write]Implementation
    public function get layerHeight():int
    public function set layerHeight(value:int):void
layerWidthproperty 
layerWidth:int  [read-write]Implementation
    public function get layerWidth():int
    public function set layerWidth(value:int):void
listproperty 
public var list:Array

The list of IVectors to be drawn on each render.

rectproperty 
public var rect:Rectangle
Constructor detail
VectorLayer()constructor
public function VectorLayer(width:int = 500, height:int = 500, bgColor:Object = null, cacheAsBitmap:Boolean = false)Parameters
width:int (default = 500)
 
height:int (default = 500)
 
bgColor:Object (default = null)
 
cacheAsBitmap:Boolean (default = false)
Method detail
add()method
public function add(vector:IVector):IVector

Adds an IVector into the list.

Parameters
vector:IVector

Returns
IVector
addEvent()method 
protected function addEvent(item:EventDispatcher, type:String, liststener:Function, priority:int = 0, useWeakReference:Boolean = true):voidParameters
item:EventDispatcher
 
type:String
 
liststener:Function
 
priority:int (default = 0)
 
useWeakReference:Boolean (default = true)
clear()method 
public function clear():void

Removes all IVectors from the list.

dispose()method 
public function dispose():void

Disposes the VectorLayer ready for garbage collection.

remove()method 
public function remove(vector:IVector):Boolean

Removes an IVector into the list.

Parameters
vector:IVector

Returns
Boolean
removeEvent()method 
protected function removeEvent(item:EventDispatcher, type:String, listener:Function):voidParameters
item:EventDispatcher
 
type:String
 
listener:Function
render()method 
public function render(e:Event = null):voidParameters
e:Event (default = null)
startRender()method 
public function startRender():void

Starts rendering the VectorLayer on construction rendering automatically starts.

stopRender()method 
public function stopRender():void

Stops rendering the VectorLayer this can be resumed via the startRender method.

toString()method 
public override function toString():String

Returns
String