EventDispatcher |
Timeline |
The ‘Timeline’ class simulates the timeline paradox by presenting a similar API to create and control tweens.
Timeline | The ‘Timeline’ class simulates the timeline paradox by presenting a similar API to create and control tweens. |
Constants | |
DEFAULT_RENDER_METHOD | Configures the default render method to use for rendering tweens. |
DEFAULT_FRAME_RATE | Configures the default frame rate for timelines. |
DEFAULT_LOOP | Configures the default loop setting. |
Variables | |
m_objRendererPrev | Holds an instance of the renderer object for rendering playback in reverse. |
m_objRendererNext | Holds an instance of the renderer object for rendering playback forwards. |
m_uRenderMethod | Stores the render method being used to render this object’s tweens. |
m_uFrameRate | The frame rate for this timeline to play at. |
m_nRefreshRate | The necessary refresh rate to achieve the desired frame rate. |
m_objTweenStack | A stack for storing all tweens in this timeline. |
m_uFrame | The current frame the playhead of this timeline is at. |
m_uLength | The length (in frames) of this timeline. |
m_bLoop | Determines whether or not this timeline loops when the last frame is finished. |
Functions | |
Timeline | Constructor. |
onPrevFrameEF | Called by the renderer when playing in reverse using the ‘RenderMethod.ENTER_FRAME’ render method. |
onNextFrameEF | Called by the renderer when playing forwards using the ‘RenderMethod.ENTER_FRAME’ render method. |
onPrevFrameT | Called by the renderer when playing in reverse using the ‘RenderMethod.TIMER’ render method. |
onNextFrameT | Called by the renderer when playing forwards using the ‘RenderMethod.TIMER’ render method. |
setFrameRate | Sets the frame rate this timeline plays at. |
addTween | Adds a new tween to this timeline. |
play | Plays this timeline from the current frame. |
playReverse | Plays this timeline in reverse from the current frame. |
stop | Stops this timeline at the current frame. |
gotoAndPlay | Moves the playhead to the desired frame and then plays from there. |
gotoAndPlayReverse | Moves the playhead to the desired frame and then plays in reverse from there. |
gotoAndStop | Moves the playhead to the desired frame and then stops. |
prevFrame | Move the playhead backwards one frame. |
nextFrame | Move the playhead forwards one frame. |
Properties | |
length | Returns the length (in frames) of this timeline. |
loop | Gets the current loop setting. |
loop | Sets whether the playhead loops back to the first frame and continues playing when the last frame is reached or not. |
Functions | |
dispose | Performs any appropriate clean-up tasks for garbage collection such as removing event listeners, setting object references to ‘null’, etc. |
init | Initializes this object. |
setFrame | Sets the current frame of the playhead. |
computeFrameData | Computes the necessary frame data for each tween. |
render | Loops through the tween stack and renders the current frame of each tween. |
protected const DEFAULT_RENDER_METHOD: uint
Configures the default render method to use for rendering tweens.
The default value ‘2’ is RenderMethod.TIMER. This is done because the ‘RenderMethod’ class is not available at the time this is compiled.
com.boostworthy.animation.rendering.RenderMethod
public function Timeline( uRenderMethod: uint = DEFAULT_RENDER_METHOD, nFrameRate: Number = DEFAULT_FRAME_RATE )
Constructor.
param | uRenderMethod The render method to use for rendering tweens. |
param | nFrameRate The frame rate for the timeline to play at. This is only used if ‘RenderMethod.TIMER’ is used as the render method. |
com.boostworthy.animation.rendering.RenderMethod, DEFAULT_RENDER_METHOD, DEFAULT_FRAME_RATE
protected function onPrevFrameEF( objEvent: Event ):void
Called by the renderer when playing in reverse using the ‘RenderMethod.ENTER_FRAME’ render method.
param | objEvent An object containing information about the enter frame event. |
com.boostworthy.animation.rendering.RenderMethod
protected function onNextFrameEF( objEvent: Event ):void
Called by the renderer when playing forwards using the ‘RenderMethod.ENTER_FRAME’ render method.
param | objEvent An object containing information about the enter frame event. |
com.boostworthy.animation.rendering.RenderMethod
protected function init( uRenderMethod: uint, nFrameRate: Number ):void
Initializes this object.
param | uRenderMethod The render method to use for rendering tweens. |
param | nFrameRate The frame rate for the timeline to play at. This is only used if ‘RenderMethod.TIMER’ is used as the render method. |
com.boostworthy.animation.rendering.RenderMethod
Configures the default render method to use for rendering tweens.
protected const DEFAULT_RENDER_METHOD: uint
Configures the default frame rate for timelines.
protected const DEFAULT_FRAME_RATE: Number
Configures the default loop setting.
protected const DEFAULT_LOOP: Boolean
Holds an instance of the renderer object for rendering playback in reverse.
protected var m_objRendererPrev: Renderer
Holds an instance of the renderer object for rendering playback forwards.
protected var m_objRendererNext: Renderer
Stores the render method being used to render this object’s tweens.
protected var m_uRenderMethod: uint
The frame rate for this timeline to play at.
protected var m_uFrameRate: uint
The necessary refresh rate to achieve the desired frame rate.
protected var m_nRefreshRate: Number
A stack for storing all tweens in this timeline.
protected var m_objTweenStack: TweenStack
The current frame the playhead of this timeline is at.
protected var m_uFrame: uint
The length (in frames) of this timeline.
protected var m_uLength: uint
Determines whether or not this timeline loops when the last frame is finished.
protected var m_bLoop: Boolean
Constructor.
public function Timeline( uRenderMethod: uint = DEFAULT_RENDER_METHOD, nFrameRate: Number = DEFAULT_FRAME_RATE )
Called by the renderer when playing in reverse using the ‘RenderMethod.ENTER_FRAME’ render method.
protected function onPrevFrameEF( objEvent: Event ):void
Called by the renderer when playing forwards using the ‘RenderMethod.ENTER_FRAME’ render method.
protected function onNextFrameEF( objEvent: Event ):void
Called by the renderer when playing in reverse using the ‘RenderMethod.TIMER’ render method.
protected function onPrevFrameT( objEvent: TimerEvent ):void
Called by the renderer when playing forwards using the ‘RenderMethod.TIMER’ render method.
protected function onNextFrameT( objEvent: TimerEvent ):void
Sets the frame rate this timeline plays at.
public function setFrameRate( nFrameRate: Number ):void
Adds a new tween to this timeline.
public function addTween( objTween: ITween ):void
Plays this timeline from the current frame.
public function play():void
Plays this timeline in reverse from the current frame.
public function playReverse():void
Stops this timeline at the current frame.
public function stop():void
Moves the playhead to the desired frame and then plays from there.
public function gotoAndPlay( uFrame: uint ):void
Moves the playhead to the desired frame and then plays in reverse from there.
public function gotoAndPlayReverse( uFrame: uint ):void
Moves the playhead to the desired frame and then stops.
public function gotoAndStop( uFrame: uint ):void
Move the playhead backwards one frame.
public function prevFrame():void
Move the playhead forwards one frame.
public function nextFrame():void
Returns the length (in frames) of this timeline.
public function get length():Number
Gets the current loop setting.
public function get loop():Boolean
Performs any appropriate clean-up tasks for garbage collection such as removing event listeners, setting object references to ‘null’, etc.
public function dispose():void
Initializes this object.
protected function init( uRenderMethod: uint, nFrameRate: Number ):void
Sets the current frame of the playhead.
protected function setFrame( uFrame: Number ):void
Computes the necessary frame data for each tween.
protected function computeFrameData( uFirstFrame: uint, uLastFrame: uint ):void
Loops through the tween stack and renders the current frame of each tween.
protected function render( bIsReverse: Boolean = false ):void