Packagecom.pblabs.rendering2D
Classpublic class MovieClipRenderer
InheritanceMovieClipRenderer Inheritance DisplayObjectRenderer Inheritance AnimatedComponent Inheritance EntityComponent Inheritance Object

Renderer which is for displaying MovieClips/SWFs and playing their animation correctly.

It can be used one of two ways. You can either subclass it and override getClipInstance(), or you create one and set the clip property.



Public Properties
 PropertyDefined By
 Inheritedalpha : Number
Transparency, 0 being completely transparent and 1 being opaque.
DisplayObjectRenderer
 InheritedalphaProperty : PropertyReference
If set, alpha is gotten from this property every frame.
DisplayObjectRenderer
 InheritedblendMode : String
Blend mode, using strings from flash.display.BlendMode
DisplayObjectRenderer
 InheritedblendModeProperty : PropertyReference
If set, blend mode is gotten from this property every frame.
DisplayObjectRenderer
  clip : MovieClip
MovieClipRenderer
  destroyOnEnd : Boolean = false
Should we destroy the entity when animation is over? Useful for things like explosions.
MovieClipRenderer
 InheriteddisplayObject : DisplayObject
The displayObject which this DisplayObjectRenderer will draw.
DisplayObjectRenderer
  failed : Boolean
[read-only] Indicates if the SWFResource has failed loading
MovieClipRenderer
  fileName : String
Resource (file)name of the SWFResource
MovieClipRenderer
  frameRate : Number = 25
Framerate for playback.
MovieClipRenderer
 InheritedisRegistered : Boolean
[read-only] Whether or not the component is currently registered with an entity.
EntityComponent
 InheritedlayerIndex : int
In what layer of the scene is this renderer drawn?
DisplayObjectRenderer
 InheritedlayerIndexProperty : PropertyReference
If set, the layer index is gotten from this property every frame.
DisplayObjectRenderer
  loaded : Boolean
[read-only] Indicates if the SWFResource has been loaded
MovieClipRenderer
  loading : Boolean
[read-only] Indicates if the resource is beeing loaded
MovieClipRenderer
 InheritedlocalBounds : Rectangle
[read-only]
DisplayObjectRenderer
  loop : Boolean = false
Should we loop the animation?
MovieClipRenderer
 Inheritedname : String
[read-only] The name given to the component when it is added to an entity.
EntityComponent
 InheritedobjectMask : ObjectType
The types for this object; used for picking queries primarily.
DisplayObjectRenderer
 Inheritedowner : IEntity
A reference to the entity that this component currently belongs to.
EntityComponent
 Inheritedposition : Point
Position of the renderer in scene space.
DisplayObjectRenderer
 InheritedpositionOffset : Point
Sets a position offset that will offset the sprite.
DisplayObjectRenderer
 InheritedpositionProperty : PropertyReference
If set, position is gotten from this property every frame.
DisplayObjectRenderer
 InheritedregisterForUpdates : Boolean
Set to register/unregister for frame updates.
AnimatedComponent
 InheritedregistrationPoint : Point
The registration point can be used to offset the sprite so that rotation and scaling work properly.
DisplayObjectRenderer
 InheritedregistrationPointProperty : PropertyReference
If set, our registration point is gotten from this property every frame.
DisplayObjectRenderer
 InheritedrenderKey : int = 0
Reference value used for sorting in some scenes.
DisplayObjectRenderer
 InheritedrenderPosition : Point
[read-only] Where in the scene will this object be rendered?
DisplayObjectRenderer
  resource : SWFResource
[read-only] Loaded SWFResource
MovieClipRenderer
 Inheritedrotation : Number
Rotation in degrees, with 0 being Y+.
DisplayObjectRenderer
 InheritedrotationOffset : Number
Rotation offset applied to the child DisplayObject.
DisplayObjectRenderer
 InheritedrotationProperty : PropertyReference
If set, rotation is gotten from this property every frame.
DisplayObjectRenderer
 Inheritedscale : Point
You can scale things on the X and Y axes.
DisplayObjectRenderer
 InheritedscaleProperty : PropertyReference
If set, scale is gotten from this property every frame.
DisplayObjectRenderer
 Inheritedscene : IScene2D
The scene which is responsible for drawing this renderer.
DisplayObjectRenderer
 InheritedsceneBounds : Rectangle
[read-only] Our bounds in scene coordinates.
DisplayObjectRenderer
 Inheritedsize : Point
Explicitly set the size.
DisplayObjectRenderer
 InheritedsizeProperty : PropertyReference
If set, size is determined by this property every frame.
DisplayObjectRenderer
 InheritedsnapToNearestPixels : Boolean = true
if set this to false, positions will be handeled with numbers insteed of integers makes slow movement smoother for example
DisplayObjectRenderer
 InheritedupdatePriority : Number = 0.0
The update priority for this component.
AnimatedComponent
 InheritedworldPosition : Point
Convenience method to allow placing the renderer in world coordinates.
DisplayObjectRenderer
 Inheritedx : Number
The x value of our scene space position.
DisplayObjectRenderer
 Inheritedy : Number
The y component of our scene space position.
DisplayObjectRenderer
 InheritedzIndex : int
By default, layers are sorted based on the z-index, from small to large.
DisplayObjectRenderer
 InheritedzIndexProperty : PropertyReference
If set, our z-index is gotten from this property every frame.
DisplayObjectRenderer
Protected Properties
 PropertyDefined By
 Inherited_alpha : Number = 1
DisplayObjectRenderer
 Inherited_blendMode : String = normal
DisplayObjectRenderer
  _clipDirty : Boolean = true
MovieClipRenderer
  _clipFrame : int
MovieClipRenderer
  _clipLastUpdate : Number
MovieClipRenderer
 Inherited_displayObject : DisplayObject
DisplayObjectRenderer
 Inherited_hitTestDirty : Boolean = true
DisplayObjectRenderer
 Inherited_inScene : Boolean = false
DisplayObjectRenderer
 Inherited_lastLayerIndex : int = -1
DisplayObjectRenderer
 Inherited_layerIndex : int = 0
DisplayObjectRenderer
 Inherited_layerIndexDirty : Boolean = true
DisplayObjectRenderer
  _maxFrames : int
MovieClipRenderer
 Inherited_position : Point
DisplayObjectRenderer
 Inherited_positionOffset : Point
DisplayObjectRenderer
 Inherited_registrationPoint : Point
DisplayObjectRenderer
 Inherited_rotation : Number = 0
DisplayObjectRenderer
 Inherited_rotationOffset : Number = 0
DisplayObjectRenderer
 Inherited_scale : Point
DisplayObjectRenderer
 Inherited_scene : IScene2D
DisplayObjectRenderer
 Inherited_size : Point
DisplayObjectRenderer
 Inherited_transformDirty : Boolean = true
DisplayObjectRenderer
 Inherited_transformMatrix : Matrix
DisplayObjectRenderer
 Inherited_zIndex : int = 0
DisplayObjectRenderer
 Inherited_zIndexDirty : Boolean = true
DisplayObjectRenderer
Public Methods
 MethodDefined By
  
onFrame(elapsed:Number):void
[override]
MovieClipRenderer
 Inherited
pointOccupied(worldPosition:Point, mask:ObjectType):Boolean
Is the rendered object opaque at the request position in screen space?
DisplayObjectRenderer
 Inherited
register(owner:IEntity, name:String):void
Registers the component with an entity.
EntityComponent
 Inherited
reset():void
This is called by an entity on all of its components any time a component is added or removed.
EntityComponent
 Inherited
transformObjectToWorld(p:Point):Point
Transform a point from object space to world space.
DisplayObjectRenderer
 Inherited
transformWorldToObject(p:Point):Point
Transform a point from world space to object space.
DisplayObjectRenderer
 Inherited
unregister():void
Unregisters the component from an entity.
EntityComponent
 Inherited
updateTransform(updateProps:Boolean = false):void
Update the object's transform based on its current state.
DisplayObjectRenderer
Protected Methods
 MethodDefined By
 Inherited
addToScene():void
DisplayObjectRenderer
  
findMaxFrames(parent:MovieClip, currentMax:int):int
Find the child clip with the largest number of frames.
MovieClipRenderer
  
getClipInstance():MovieClip
MovieClipRenderer
 Inherited
onAdd():void
[override]
DisplayObjectRenderer
 Inherited
onRemove():void
[override]
DisplayObjectRenderer
 Inherited
onReset():void
This is called anytime a component is added or removed from the owner entity.
EntityComponent
 Inherited
DisplayObjectRenderer
  
updateChildClips(parent:MovieClip, currentFrame:int):void
Recursively advance a clip's children to the current frame.
MovieClipRenderer
 Inherited
DisplayObjectRenderer
Property Detail
_clipDirtyproperty
protected var _clipDirty:Boolean = true

_clipFrameproperty 
protected var _clipFrame:int

_clipLastUpdateproperty 
protected var _clipLastUpdate:Number

_maxFramesproperty 
protected var _maxFrames:int

clipproperty 
clip:MovieClip


Implementation
    public function get clip():MovieClip
    public function set clip(value:MovieClip):void
destroyOnEndproperty 
public var destroyOnEnd:Boolean = false

Should we destroy the entity when animation is over? Useful for things like explosions.

failedproperty 
failed:Boolean  [read-only]

Indicates if the SWFResource has failed loading


Implementation
    public function get failed():Boolean
fileNameproperty 
fileName:String

Resource (file)name of the SWFResource


Implementation
    public function get fileName():String
    public function set fileName(value:String):void
frameRateproperty 
public var frameRate:Number = 25

Framerate for playback.

loadedproperty 
loaded:Boolean  [read-only]

Indicates if the SWFResource has been loaded


Implementation
    public function get loaded():Boolean
loadingproperty 
loading:Boolean  [read-only]

Indicates if the resource is beeing loaded


Implementation
    public function get loading():Boolean
loopproperty 
public var loop:Boolean = false

Should we loop the animation?

resourceproperty 
resource:SWFResource  [read-only]

Loaded SWFResource


Implementation
    public function get resource():SWFResource
Method Detail
findMaxFrames()method
protected function findMaxFrames(parent:MovieClip, currentMax:int):int

Find the child clip with the largest number of frames. This will be used as our target for the end of the animation.

Parameters

parent:MovieClip
 
currentMax:int

Returns
int
getClipInstance()method 
protected function getClipInstance():MovieClip

Returns
MovieClip
onFrame()method 
override public function onFrame(elapsed:Number):void

Parameters

elapsed:Number

updateChildClips()method 
protected function updateChildClips(parent:MovieClip, currentFrame:int):void

Recursively advance a clip's children to the current frame. This takes into account children with varying frame counts.

Parameters

parent:MovieClip
 
currentFrame:int