Tween Play
- Starts playing the animation forward, optionally from a specific time or label.
play()
play(from:Number, suppressEvents:Boolean): self
By default, playback resumes from the current playhead position.
Parameters
-
from (Number, default = null)
-
The time (in seconds) or label from which the animation should start playing.
-
If omitted, playback begins from the animation’s current position.
-
-
suppressEvents (Boolean, default = true)
-
When
true(default), no events or callbacks are triggered when the playhead jumps to the new position. -
Set to
falseif you want any skipped callbacks or events (between the previous and new position) to fire.
-
Returns
-
self – Returns the animation instance for method chaining.
Details
The
play()method resumes forward playback of an animation or timeline.
If afromtime (or label) is provided, the playhead instantly jumps to that point before playing.By default,
suppressEventsistrue, meaning that no callbacks or events will trigger during that jump — it’s as if you lift the record needle and place it at a new position without playing the skipped portion.To ensure all intermediate callbacks or events execute during the jump, set
suppressEventstofalse.
Callingplay()also guarantees that the animation is not paused or reversed.-
// Play forward from the current position:
myAnimation.play();
// Start playing from exactly 2 seconds into the animation:
myAnimation.play(2);
// Jump to 2 seconds and play forward,
// but do not suppress intermediate events/callbacks:
myAnimation.play(2, false);