Animator is a static class designed to provided base animation functionality, using frame labels of MovieClips
_makeTimeline
clip
eventList
onComplete
onCancelled
Creates the AnimatorTimeline for a given animation
The Timeline object
_onSoundDone
timeline
playIndex
soundAlias
The sound is done
timeline
springroll.AnimatorTimeline
playIndex
Int
soundAlias
String
_remove
timeline
doCancelled
Remove a timeline from the stack
timeline
springroll.AnimatorTimeline
doCancelled
Boolean
If we do the on complete callback
canAnimate
clip
Determines if a given instance can be animated by Animator. Note - id
is a property
with a unique value for each createjs.DisplayObject
. If a custom object is made that does
not inherit from DisplayObject, it needs to not have an id that is identical to anything
from EaselJS.
clip
The object to check for animation properties.
If the instance can be animated or not.
createInstance
clip
Create an instance by clip
clip
The animation object to animate
The animator instance
getDefinitionByClip
clip
Get a definition by clip
clip
The animation clip
The new definition
getDuration
instance
event
Get duration of animation event (or sequence of events) in seconds
Duration of animation event in milliseconds
getTimeline
clip
Get the timeline object for an instance
clip
The animation clip
The timeline
getTimelineByClip
clip
Loop a clip by timeline
clip
The clip to check
The timeline for clip
hasAnimation
clip
event
Checks if animation exists
clip
The instance to check
event
String
The frame label event (e.g. "onClose" to "onClose_stop")
does this animation exist?
isFunction
func
Check to see if object is a Function
func
The object to check
if object is Function
isNumber
num
Check to see if object is a Number
num
The object to check
if object is Number
isString
str
Check to see if object is a String
str
The string
if object is String
onSoundStarted
timeline
playIndex
The sound has been started
timeline
springroll.AnimatorTimeline
playIndex
Int
elapsed
The update every frame
elapsed
Int
The time in milliseconds since the last frame
pauseInGroup
paused
container
Pauses or unpauses all timelines that are children of the specified DisplayObjectContainer.
paused
Boolean
If this should be paused or unpaused
container
createjs.Container
The container to stop timelines contained within
play
clip
options
[onComplete]
[onCancelled]
Play an animation for a frame label event, with more verbose play options.
clip
The display object with the same API to animate.
options
Object
One of or an array of the following
anim
String
the frame label of the animation to play, e.g. "onClose" to "onClose_stop".
[start=0]
Int
optional
Milliseconds into the animation to start. A value of -1 starts from a random time in the animation.
[speed=1]
Int
optional
a multiplier for the animation speed.
[audio]
Object | String
optional
Audio to sync the animation to using springroll.Sound. audio can be a String if you want the audio to start 0 milliseconds into the animation.
[alias]
String
optional
[start]
Int
optional
[onComplete]
Function
optional
The callback function for when the animation is done.
[onCancelled]
Function | Boolean
optional
A callback function for when an animation is stopped with Animator.stop() or to play another animation. A value of 'true' uses onComplete for onCancelled.
The Timeline object that represents this play() call.
play
clip
eventList
[onComplete]
[onCancelled]
Play an animation for a frame label event or events
clip
The display object with the same API to animate.
eventList
String | Array
The name of an event or collection of events
[onComplete]
Function
optional
The callback function for when the animation is done.
[onCancelled]
Function | Boolean
optional
A callback function for when an animation is stopped with Animator.stop() or to play another animation. A value of 'true' uses onComplete for onCancelled.
The Timeline object that represents this play() call.
poolInstance
instance
Destroy an instance
instance
springroll.AnimatorInstance
The instance to destroy
register
qualifiedClassName
priority
Register an animator instance definition type
qualifiedClassName
String
The class name
priority
Int
The priority order for definition
stop
clip
[removeCallbacks=false]
Stop the animation.
clip
The instance to stop the action on
[removeCallbacks=false]
Boolean
optional
Completely disregard the on complete or on cancelled callback of this animation.
stopAll
[container]
[removeCallbacks=false]
Stop all current Animator animations. This is good for cleaning up all animation, as it doesn't do a callback on any of them.
[container]
createjs.Container
optional
Specify a container to stop timelines contained within. This only checks one layer deep.
[removeCallbacks=false]
Boolean
optional
Completely disregard the on complete or on cancelled callback of the current animations.