springroll.AnimatorTimeline Class

Animator Instance is a wrapper for different types of media files. They need to extend some basic methods.

_nextItem

()
private

Defined in _nextItem:172

Advances to the next item in the list of things to play.

beginAnim

(
  • animObj
  • isRepeat
)

Defined in beginAnim:61

Sets up variables that are needed (including duration), and does any other setup else needed.

Parameters:

  • animObj Object

    The animation data object.

  • isRepeat Boolean

    If this animation is restarting a loop.

create

(
  • clip
)
springroll.AnimatorInstance
static

Defined in create:137

Get an instance either from a recycled pool or new

Parameters:

  • clip

    The animation clip or display object

Returns:

springroll.AnimatorInstance:

The new instance

destroy

()

Defined in destroy:170

Reset this animator instance so it can be re-used.

destroy

()

Defined in destroy:268

Reset this animator instance so it can be re-used.

endAnim

()

Defined in endAnim:69

Ends animation playback.

endAnim

()

Defined in endAnim:138

Ends animation playback.

extend

(
  • InstanceClass
  • [ParentClass=springroll.AnimatorTimeline]
)
Object

Defined in extend:120

Create pool and add create and remove functions

Parameters:

  • InstanceClass Function

    The instance class

  • [ParentClass=springroll.AnimatorTimeline] Function optional

    The class to extend

Returns:

Object:

The prototype for new class

getDuration

(
  • clip
  • event
)
Number
static

Defined in getDuration:217

Calculates the duration of an animation or list of animations.

Parameters:

  • clip

    The clip to check.

  • event String

    The animation or animation list.

Returns:

Number:

Animation duration in milliseconds.

getDuration

(
  • clip
  • event
)
Number
static

Defined in getDuration:107

Calculates the duration of an animation or list of animations.

Parameters:

  • clip

    The clip to check.

  • event String | Object | Array

    The animation or animation list.

Returns:

Number:

Animation duration in milliseconds.

hasAnimation

(
  • clip
  • event
)
Boolean
static

Defined in hasAnimation:94

Determines if a clip has an animation.

Parameters:

  • clip

    The clip to check for an animation.

  • event String | Object

    The animation.

Returns:

Boolean:

If the clip has the animation.

hasAnimation

(
  • clip
  • event
)
Boolean
static

Defined in hasAnimation:179

Checks if animation exists

Parameters:

  • clip

    The clip to check for an animation.

  • event String

    The frame label event (e.g. "onClose" to "onClose_stop")

Returns:

Boolean:

does this animation exist?

init

(
  • clip
)

Defined in init:49

The initialization method

Parameters:

  • clip

    The movieclip

init

(
  • clip
)

Defined in init:51

The initialization method

Parameters:

  • clip

    The movieclip

pool

(
  • instance
)
static

Defined in pool:154

Recycle an instance to the class's pool

Parameters:

  • instance springroll.AnimatorInstance

    The instance to pool

reset

() springroll.AnimatorTimeline
private

Defined in reset:123

Reset the timeline so we can reuse

Returns:

springroll.AnimatorTimeline:

Instance of timeline

setPosition

(
  • newPos
)

Defined in setPosition:75

Updates position to a new value, and does anything that the clip needs, like updating timelines.

Parameters:

  • newPos Number

    The new position in the animation.

setPosition

(
  • newPos
)

Defined in setPosition:147

Updates position to a new value, and does anything that the clip needs, like updating timelines.

Parameters:

  • newPos Number

    The new position in the animation.

test

() Boolean
static

Defined in test:162

Check to see if a clip is compatible with this

Returns:

Boolean:

if the clip is supported by this instance

test

() Boolean
static

Defined in test:83

Check to see if a clip is compatible with this

Returns:

Boolean:

if the clip is supported by this instance

_paused

Boolean private

Defined in _paused:59

If the timeline is paused.

_pool

Array protected static

Defined in _pool:129

The pool of used up instances

clip

Defined in clip:17

The animation clip to play

complete

Boolean

Defined in complete:109

If the timeline is complete. Looping timelines will never complete.

currentName

String

Defined in currentName:41

The name of the current animation.

duration

Number

Defined in duration:66

The current animation duration in seconds.

duration

Number

Defined in duration:29

Duration, in seconds, of the current animation.

eventList

Array

Defined in eventList:27

An array of animations and pauses.

firstFrame

Int

Defined in firstFrame:32

The frame number of the first frame of the current animation. If this is -1, then the animation is currently a pause instead of an animation.

instance

springroll.AnimatorInstance

Defined in instance:39

The instance of the timeline to animate

isLooping

Boolean

Defined in isLooping:45

If the current animation loops - determined by looking to see if it ends in "_stop" or "_loop"

isLooping

Boolean

Defined in isLooping:35

If the current animation is a looping animation.

lastFrame

Int

Defined in lastFrame:39

The frame number of the last frame of the current animation.

length

Int

Defined in length:26

Length of current animation in frames.

listIndex

Int

Defined in listIndex:33

The index of the active animation in eventList.

onCancelled

Function

Defined in onCancelled:21

The function to call when stopped early.

onComplete

Function

Defined in onComplete:15

The function to call when we're done

paused

Boolean

Defined in paused:269

Sets and gets the animation's paused status.

playSound

Boolean

Defined in playSound:91

If the timeline will, but has yet to play a sound for the current animation.

position

Number

Defined in position:23

Time, in seconds, of the current animation playback, from 0 -> duration.

soundAlias

String

Defined in soundAlias:78

Sound alias to sync to during the current animation.

soundEnd

Number

Defined in soundEnd:103

The time (seconds) into the animation that the sound ends

soundInst

Object

Defined in soundInst:84

A sound instance object from springroll.Sound, used for tracking sound position for the current animation.

soundStart

Number

Defined in soundStart:97

The time (seconds) into the current animation that the sound starts.

speed

Number

Defined in speed:72

The animation speed for the current animation. Default is 1.

startTime

Number

Defined in startTime:20

The start time of the current animation on the movieclip's timeline.

time

Number

Defined in time:253

The position of the current animation, or the current pause timer, in milliseconds.

useCaptions

Boolean

Defined in useCaptions:52

If this timeline plays captions for the current sound.