Framebuffer

EventDispatcher
Framebuffer

The ‘Framebuffer’ class works with buffers and a renderer to handle the process of rendering multiple animations at the same time.

See Also

com.boostworthy.animation.management.Buffer, com.boostworthy.animation.rendering.Renderer

Summary
FramebufferThe ‘Framebuffer’ class works with buffers and a renderer to handle the process of rendering multiple animations at the same time.
Variables
m_objBufferEFHolds all animation objects to be rendered on enter frame.
m_objBufferTHolds all animation objects to be rendered on timer.
m_objRendererThe renderer instance to be used to render the contents of the buffers.
Functions
FramebufferConstructor.
onRenderEFEvent handler for the enter frame event.
onRenderTEvent handler for the timer event.
onAnimationStartCalled when an animation starts.
onAnimationChangeCalled when an animation changes.
onAnimationStopCalled when an animation stops.
onAnimationFinishCalled when an animation finishes.
addBufferObjectAdds a new animation to the framebuffer.
removeBufferObjectRemoves all animations involving the target object from the framebuffer.
clearBufferClears all animations from the buffers.
disposePerforms any appropriate clean-up tasks for garbage collection such as removing event listeners, setting object references to ‘null’, etc.
initInitializes this object.
removeAnimationRemoves the specified animation from the buffer.
removeAnimationByObjectRemoves all animations involving the target object from the framebuffer.
removeAnimationByPropertyRemoves all animations involving the target object’s property from the framebuffer.
checkBufferLengthEFChecks the enter frame buffer to see if it is empty.
checkBufferLengthTChecks the timer buffer to see if it is empty.

Variables

m_objBufferEF

protected var m_objBufferEF: Buffer

Holds all animation objects to be rendered on enter frame.

See Also

com.boostworthy.animation.management.Buffer

m_objBufferT

protected var m_objBufferT: Buffer

Holds all animation objects to be rendered on timer.

See Also

com.boostworthy.animation.management.Buffer

m_objRenderer

protected var m_objRenderer: Renderer

The renderer instance to be used to render the contents of the buffers.

See Also

com.boostworthy.animation.rendering.Renderer

Functions

Framebuffer

public function Framebuffer(nRefreshRate: Number)

Constructor.

Parameters

param nRefreshRate This rate in which animations being rendered using the ‘RenderMethod.TIMER’ method will be refreshed.  The value is in milliseconds. 

See Also

com.boostworthy.animation.rendering.RenderMethod

onRenderEF

protected function onRenderEF(objEvent: Event):void

Event handler for the enter frame event.  Loops through the contents of the buffer and updates each animation.

Parameters

param objEvent An object containing information about the event. 

onRenderT

protected function onRenderT(objEvent: TimerEvent):void

Event handler for the timer event. 

Loops through the contents of the buffer and updates each animation.

Parameters

param objEvent An object containing information about the event. 

onAnimationStart

protected function onAnimationStart(objEvent: AnimationEvent):void

Called when an animation starts.

Parameters

param objEvent An object containing information about the animation event. 

onAnimationChange

protected function onAnimationChange(objEvent: AnimationEvent):void

Called when an animation changes.

Parameters

param objEvent An object containing information about the animation event. 

onAnimationStop

protected function onAnimationStop(objEvent: AnimationEvent):void

Called when an animation stops.

Parameters

param objEvent An object containing information about the animation event. 

onAnimationFinish

protected function onAnimationFinish(objEvent: AnimationEvent):void

Called when an animation finishes.

Parameters

param objEvent An object containing information about the animation event. 

addBufferObject

public function addBufferObject(objAnimation: IAnimation):void

Adds a new animation to the framebuffer.

Parameters

param objAnimation The aniamtion to be added to the framebuffer. 

removeBufferObject

public function removeBufferObject(objTarget: Object):void

Removes all animations involving the target object from the framebuffer.

Parameters

param objTarget The object whose animations are to be removed. 

clearBuffer

public function clearBuffer():void

Clears all animations from the buffers.

dispose

public function dispose():void

Performs any appropriate clean-up tasks for garbage collection such as removing event listeners, setting object references to ‘null’, etc.

init

protected function init(nRefreshRate: Number):void

Initializes this object.

Parameters

param nRefreshRate This rate in which animations being rendered using the ‘RenderMethod.TIMER’ method will be refreshed.  The value is in milliseconds. 

See Also

com.boostworthy.animation.rendering.RenderMethod

removeAnimation

protected function removeAnimation(objAnimation: IAnimation):void

Removes the specified animation from the buffer.

Parameters

param objAnimation The animation to be removed from the buffer. 

removeAnimationByObject

protected function removeAnimationByObject(objTarget: Object):void

Removes all animations involving the target object from the framebuffer.

Parameters

param objTarget The object whose animations are to be removed. 

removeAnimationByProperty

protected function removeAnimationByProperty(objTarget: Object,
strProperty: String):void

Removes all animations involving the target object’s property from the framebuffer.

Parameters

param objTarget The object whose animations are to be removed.
param strProperty The target object’s property being searched for. 

checkBufferLengthEF

protected function checkBufferLengthEF():void

Checks the enter frame buffer to see if it is empty.  If it is, enter frame rendering is stopped.

checkBufferLengthT

protected function checkBufferLengthT():void

Checks the timer buffer to see if it is empty.  If it is, timer rendering is stopped.

The ‘IDisposable’ interface defines a common interface for all objects to encorporate garbage collection.
protected var m_objBufferEF: Buffer
Holds all animation objects to be rendered on enter frame.
protected var m_objBufferT: Buffer
Holds all animation objects to be rendered on timer.
protected var m_objRenderer: Renderer
The renderer instance to be used to render the contents of the buffers.
public function Framebuffer(nRefreshRate: Number)
Constructor.
protected function onRenderEF(objEvent: Event):void
Event handler for the enter frame event.
protected function onRenderT(objEvent: TimerEvent):void
Event handler for the timer event.
protected function onAnimationStart(objEvent: AnimationEvent):void
Called when an animation starts.
protected function onAnimationChange(objEvent: AnimationEvent):void
Called when an animation changes.
protected function onAnimationStop(objEvent: AnimationEvent):void
Called when an animation stops.
protected function onAnimationFinish(objEvent: AnimationEvent):void
Called when an animation finishes.
public function addBufferObject(objAnimation: IAnimation):void
Adds a new animation to the framebuffer.
public function removeBufferObject(objTarget: Object):void
Removes all animations involving the target object from the framebuffer.
public function clearBuffer():void
Clears all animations from the buffers.
public function dispose():void
Performs any appropriate clean-up tasks for garbage collection such as removing event listeners, setting object references to ‘null’, etc.
protected function init(nRefreshRate: Number):void
Initializes this object.
protected function removeAnimation(objAnimation: IAnimation):void
Removes the specified animation from the buffer.
protected function removeAnimationByObject(objTarget: Object):void
Removes all animations involving the target object from the framebuffer.
protected function removeAnimationByProperty(objTarget: Object,
strProperty: String):void
Removes all animations involving the target object’s property from the framebuffer.
protected function checkBufferLengthEF():void
Checks the enter frame buffer to see if it is empty.
protected function checkBufferLengthT():void
Checks the timer buffer to see if it is empty.
Close