Packagecom.boostworthy.animation.sequence
Classpublic class Timeline
InheritanceTimeline Inheritance flash.events.EventDispatcher
ImplementsIDisposable

The 'Timeline' class simulates the timeline paradox by presenting a similar API to create and control tweens.



Public Properties
 PropertyDefined by
  length : Number
[read-only] Returns the length (in frames) of this timeline.
Timeline
  loop : Boolean
Gets the current loop setting.
Timeline
Protected Properties
 PropertyDefined by
  m_bLoop : Boolean
Determines whether or not this timeline loops when the last frame is finished.
Timeline
  m_nRefreshRate : Number
The necessary refresh rate to achieve the desired frame rate.
Timeline
  m_objRendererNext : Renderer
Holds an instance of the renderer object for rendering playback forwards.
Timeline
  m_objRendererPrev : Renderer
Holds an instance of the renderer object for rendering playback in reverse.
Timeline
  m_objTweenStack : TweenStack
A stack for storing all tweens in this timeline.
Timeline
  m_uFrame : uint
The current frame the playhead of this timeline is at.
Timeline
  m_uFrameRate : uint
The frame rate for this timeline to play at.
Timeline
  m_uLength : uint
The length (in frames) of this timeline.
Timeline
  m_uRenderMethod : uint
Stores the render method being used to render this object's tweens.
Timeline
Public Methods
 MethodDefined by
  
Timeline(uRenderMethod:uint, nFrameRate:Number)
Constructor.
Timeline
  
addTween(objTween:ITween):void
Adds a new tween to this timeline.
Timeline
  
dispose():void
Performs any appropriate clean-up tasks for garbage collection such as removing event listeners, setting object references to 'null', etc.
Timeline
  
gotoAndPlay(uFrame:uint):void
Moves the playhead to the desired frame and then plays from there.
Timeline
  
gotoAndPlayReverse(uFrame:uint):void
Moves the playhead to the desired frame and then plays in reverse from there.
Timeline
  
gotoAndStop(uFrame:uint):void
Moves the playhead to the desired frame and then stops.
Timeline
  
nextFrame():void
Move the playhead forwards one frame.
Timeline
  
play():void
Plays this timeline from the current frame.
Timeline
  
playReverse():void
Plays this timeline in reverse from the current frame.
Timeline
  
prevFrame():void
Move the playhead backwards one frame.
Timeline
  
setFrameRate(nFrameRate:Number):void
Sets the frame rate this timeline plays at.
Timeline
  
stop():void
Stops this timeline at the current frame.
Timeline
Protected Methods
 MethodDefined by
  
computeFrameData(uFirstFrame:uint, uLastFrame:uint):void
Computes the necessary frame data for each tween.
Timeline
  
init(uRenderMethod:uint, nFrameRate:Number):void
Initializes this object.
Timeline
  
onNextFrameEF(objEvent:Event):void
Called by the renderer when playing forwards using the 'RenderMethod.ENTER_FRAME' render method.
Timeline
  
onNextFrameT(objEvent:TimerEvent):void
Called by the renderer when playing forwards using the 'RenderMethod.TIMER' render method.
Timeline
  
onPrevFrameEF(objEvent:Event):void
Called by the renderer when playing in reverse using the 'RenderMethod.ENTER_FRAME' render method.
Timeline
  
onPrevFrameT(objEvent:TimerEvent):void
Called by the renderer when playing in reverse using the 'RenderMethod.TIMER' render method.
Timeline
  
render(bIsReverse:Boolean = false):void
Loops through the tween stack and renders the current frame of each tween.
Timeline
  
setFrame(uFrame:Number):void
Sets the current frame of the playhead.
Timeline
Events
 EventSummaryDefined by
   Dispatched when an animation changes.Timeline
   Dispatched when an animation is finished.Timeline
   Dispatched when an animation starts.Timeline
   Dispatched when an animation stops.Timeline
Protected Constants
 ConstantDefined by
  DEFAULT_FRAME_RATE : Number = 60
Configures the default frame rate for timelines.
Timeline
  DEFAULT_LOOP : Boolean = false
Configures the default loop setting.
Timeline
  DEFAULT_RENDER_METHOD : uint = 2
Configures the default render method to use for rendering tweens.
Timeline
Property detail
lengthproperty
length:Number  [read-only]

Returns the length (in frames) of this timeline.

Implementation
    public function get length():Number
loopproperty 
loop:Boolean  [read-write]

Gets the current loop setting.

Implementation
    public function get loop():Boolean
    public function set loop(value:Boolean):void
m_bLoopproperty 
protected var m_bLoop:Boolean

Determines whether or not this timeline loops when the last frame is finished.

m_nRefreshRateproperty 
protected var m_nRefreshRate:Number

The necessary refresh rate to achieve the desired frame rate.

m_objRendererNextproperty 
protected var m_objRendererNext:Renderer

Holds an instance of the renderer object for rendering playback forwards.

m_objRendererPrevproperty 
protected var m_objRendererPrev:Renderer

Holds an instance of the renderer object for rendering playback in reverse.

m_objTweenStackproperty 
protected var m_objTweenStack:TweenStack

A stack for storing all tweens in this timeline.

m_uFrameproperty 
protected var m_uFrame:uint

The current frame the playhead of this timeline is at.

m_uFrameRateproperty 
protected var m_uFrameRate:uint

The frame rate for this timeline to play at.

m_uLengthproperty 
protected var m_uLength:uint

The length (in frames) of this timeline.

m_uRenderMethodproperty 
protected var m_uRenderMethod:uint

Stores the render method being used to render this object's tweens.

Constructor detail
Timeline()constructor
public function Timeline(uRenderMethod:uint, nFrameRate:Number)

Constructor.

Parameters
uRenderMethod:uint — The render method to use for rendering tweens.
 
nFrameRate:Number — The frame rate for the timeline to play at. This is only used if 'RenderMethod.TIMER' is used as the render method.

See also

Method detail
addTween()method
public function addTween(objTween:ITween):void

Adds a new tween to this timeline.

Parameters
objTween:ITween — The tween to add to this timeline.
computeFrameData()method 
protected function computeFrameData(uFirstFrame:uint, uLastFrame:uint):void

Computes the necessary frame data for each tween.

Parameters
uFirstFrame:uint — The first frame to compute.
 
uLastFrame:uint — The last frame to compute.
dispose()method 
public function dispose():void

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

gotoAndPlay()method 
public function gotoAndPlay(uFrame:uint):void

Moves the playhead to the desired frame and then plays from there.

Parameters
uFrame:uint — The frame to move the playhead to.
gotoAndPlayReverse()method 
public function gotoAndPlayReverse(uFrame:uint):void

Moves the playhead to the desired frame and then plays in reverse from there.

Parameters
uFrame:uint — The frame to move the playhead to.
gotoAndStop()method 
public function gotoAndStop(uFrame:uint):void

Moves the playhead to the desired frame and then stops.

Parameters
uFrame:uint — The frame to move the playhead to.
init()method 
protected function init(uRenderMethod:uint, nFrameRate:Number):void

Initializes this object.

Parameters
uRenderMethod:uint — The render method to use for rendering tweens.
 
nFrameRate:Number — The frame rate for the timeline to play at. This is only used if 'RenderMethod.TIMER' is used as the render method.

See also

nextFrame()method 
public function nextFrame():void

Move the playhead forwards one frame.

onNextFrameEF()method 
protected function onNextFrameEF(objEvent:Event):void

Called by the renderer when playing forwards using the 'RenderMethod.ENTER_FRAME' render method.

Parameters
objEvent:Event — An object containing information about the enter frame event.

See also

onNextFrameT()method 
protected function onNextFrameT(objEvent:TimerEvent):void

Called by the renderer when playing forwards using the 'RenderMethod.TIMER' render method.

Parameters
objEvent:TimerEvent — An object containing information about the timer event.

See also

onPrevFrameEF()method 
protected function onPrevFrameEF(objEvent:Event):void

Called by the renderer when playing in reverse using the 'RenderMethod.ENTER_FRAME' render method.

Parameters
objEvent:Event — An object containing information about the enter frame event.

See also

onPrevFrameT()method 
protected function onPrevFrameT(objEvent:TimerEvent):void

Called by the renderer when playing in reverse using the 'RenderMethod.TIMER' render method.

Parameters
objEvent:TimerEvent — An object containing information about the timer event.

See also

play()method 
public function play():void

Plays this timeline from the current frame.

playReverse()method 
public function playReverse():void

Plays this timeline in reverse from the current frame.

prevFrame()method 
public function prevFrame():void

Move the playhead backwards one frame.

render()method 
protected function render(bIsReverse:Boolean = false):void

Loops through the tween stack and renders the current frame of each tween.

Parameters
bIsReverse:Boolean (default = false) — A parameter which will force the stack to be rendered in reverse if necessary.
setFrame()method 
protected function setFrame(uFrame:Number):void

Sets the current frame of the playhead.

Parameters
uFrame:Number — The frame to move the playhead to.
setFrameRate()method 
public function setFrameRate(nFrameRate:Number):void

Sets the frame rate this timeline plays at.

Parameters
nFrameRate:Number — The frame rate for the timeline to play at.
stop()method 
public function stop():void

Stops this timeline at the current frame.

Event detail
animationChangeevent 
Event object type: com.boostworthy.events.AnimationEvent

Dispatched when an animation changes.

animationFinishevent  
Event object type: com.boostworthy.events.AnimationEvent

Dispatched when an animation is finished.

animationStartevent  
Event object type: com.boostworthy.events.AnimationEvent

Dispatched when an animation starts.

animationStopevent  
Event object type: com.boostworthy.events.AnimationEvent

Dispatched when an animation stops.

Constant detail
DEFAULT_FRAME_RATEconstant
protected const DEFAULT_FRAME_RATE:Number = 60

Configures the default frame rate for timelines. This is only used if the render method is 'RenderMethod.TIMER'. 'RenderMethod.ENTER_FRAME' uses the SWF file's frame rate.

See also

DEFAULT_LOOPconstant 
protected const DEFAULT_LOOP:Boolean = false

Configures the default loop setting.

DEFAULT_RENDER_METHODconstant 
protected const DEFAULT_RENDER_METHOD:uint = 2

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.

See also