Packagesandy.materials
Classpublic class MovieMaterial
InheritanceMovieMaterial Inheritance BitmapMaterial Inheritance Material

Displays a MovieClip on the faces of a 3D shape.

Based on the AS2 class VideoSkin made by kiroukou and zeusprod



Public Properties
 PropertyDefined by
 Inheritedattributes : MaterialAttributes
The attributes of this material.
Material
  DEFAULT_FILL_COLOR : uint = 0
[static] Default color used to draw the bitmapdata content with.
MovieMaterial
 Inheritedfilters : Array
The array of filters for this material.
Material
 Inheritedgraphics : Graphics
BitmapMaterial
 Inheritedid : Number
The unique id of this material
Material
 InheritedlightingEnable : Boolean = false
Specify is the material can receive light and apply the lightAttributes if specified.
Material
 Inheritedmap : Matrix
BitmapMaterial
 Inheritedmodified : Boolean
The modified state of this material.
Material
  movie : Sprite
[read-only] Get the movieclip used for the material
MovieMaterial
 Inheritedpolygon : Polygon
BitmapMaterial
 Inheritedprecision : uint = 0
Precision of the bitmap mapping.
BitmapMaterial
 Inheritedrepeat : Boolean
The repeat property (?).
Material
 Inheritedsmooth : Boolean = false
This property enable smooth bitmap rendering when set to true.
BitmapMaterial
 Inheritedtexture : BitmapData
The texture ( bitmap ) of this material
BitmapMaterial
 Inheritedtype : MaterialType
The material type of this material.
Material
 InheriteduseVertexNormal : Boolean = false
Specify if the material use the vertex normal information Default value is set to false.
Material
Protected Properties
 PropertyDefined by
 Inheritedmatrix : Matrix
BitmapMaterial
 Inheritedm_bModified : Boolean
Material
 Inheritedm_oCmf : ColorMatrixFilter
BitmapMaterial
 Inheritedm_oPoint : Point
BitmapMaterial
 Inheritedm_oPolygonMatrixMap : Dictionary
BitmapMaterial
 Inheritedm_orgTexture : BitmapData
BitmapMaterial
 Inheritedm_oTexture : BitmapData
BitmapMaterial
 Inheritedm_oType : MaterialType
Material
 Inherited_useLight : Boolean = false
Material
Public Methods
 MethodDefined by
  
MovieMaterial(p_oMovie:Sprite, p_nUpdateMS:uint = 40, p_oAttr:MaterialAttributes = null, p_bRemoveTransparentBorder:Boolean = false, p_nHeight:Number = 0, p_nWidth:Number = 0)
Creates a new MovieMaterial.
MovieMaterial
 Inherited
init(p_oPolygon:Polygon):void
Initiates this material.
BitmapMaterial
  
renderPolygon(p_oScene:Scene3D, p_oPolygon:Polygon, p_mcContainer:Sprite):void
Renders this material on the face it dresses.
MovieMaterial
  
setTransparency(p_nValue:Number):void
Changes the transparency of the texture.
MovieMaterial
  
start():void
Call this method when you want to start the material update.
MovieMaterial
  
stop():void
Call this method is case you would like to stop the automatic MovieMaterial texture update.
MovieMaterial
 Inherited
toString():String
BitmapMaterial
Protected Methods
 MethodDefined by
 Inherited
_createTextureMatrix(p_aUv:Array):Matrix
BitmapMaterial
 Inherited
_tesselatePolygon(p_aPoints:Array, p_aUv:Array):void
BitmapMaterial
 Inherited
renderRec(ta:Number, tb:Number, tc:Number, td:Number, tx:Number, ty:Number, ax:Number, ay:Number, az:Number, bx:Number, by:Number, bz:Number, cx:Number, cy:Number, cz:Number):void
BitmapMaterial
 Inherited
renderTriangle(a:Number, b:Number, c:Number, d:Number, tx:Number, ty:Number, v0x:Number, v0y:Number, v1x:Number, v1y:Number, v2x:Number, v2y:Number):void
BitmapMaterial
Property detail
DEFAULT_FILL_COLORproperty
public static var DEFAULT_FILL_COLOR:uint = 0

Default color used to draw the bitmapdata content with. In case you need a specific color, change this value at your application initialization

movieproperty 
movie:Sprite  [read-only]

Get the movieclip used for the material

Implementation
    public function get movie():Sprite
Constructor detail
MovieMaterial()constructor
public function MovieMaterial(p_oMovie:Sprite, p_nUpdateMS:uint = 40, p_oAttr:MaterialAttributes = null, p_bRemoveTransparentBorder:Boolean = false, p_nHeight:Number = 0, p_nWidth:Number = 0)

Creates a new MovieMaterial.

The MovieClip used for the material may contain animation.
It is converted to a bitmap to give it a perspective distortion.
To see the animation the bitmap has to be recreated from the MovieClip on a regular basis.

Parameters
p_oMovie:Sprite — The Movieclip to be shown by this material
 
p_nUpdateMS:uint (default = 40) — The update interval
 
p_oAttr:MaterialAttributes (default = null) — The material attributes
 
p_bRemoveTransparentBorder:Boolean (default = false) — Remove the transparent border
 
p_nHeight:Number (default = 0) — desired width ( chunk the movieclip )
 
p_nWidth:Number (default = 0) — desired height ( chunk the movieclip )
Method detail
renderPolygon()method
public override function renderPolygon(p_oScene:Scene3D, p_oPolygon:Polygon, p_mcContainer:Sprite):void

Renders this material on the face it dresses.

Parameters
p_oScene:Scene3D — The current scene
 
p_oPolygon:Polygon — The face to be rendered
 
p_mcContainer:Sprite — The container to draw on
setTransparency()method 
public override function setTransparency(p_nValue:Number):void

Changes the transparency of the texture.

The passed value is the percentage of opacity.

Parameters
p_nValue:Number — A value between 0 and 1. (automatically constrained)
start()method 
public function start():void

Call this method when you want to start the material update. This is automatically called at the material creation so basically it is used only when the MovieMaterial::stop() method has been called

stop()method 
public function stop():void

Call this method is case you would like to stop the automatic MovieMaterial texture update.