If you are trying to coordinate multiple animations’ playback at runtime,
consider using a state machine instead to do this for you!
Choosing starting animations
Starting animations can also be chosen when Rive is instantiated. The first animation on the artboard may play if one is not provided, or a state machine is not set.Controlling playback
Playback of each animation and state machine can be separately controlled. You can play and pause playback using theplay , pause and stop methods, either passing in the names of the animations you want to affect or passing in nothing which will affect all instanced animations.
Invoking Playback Controls
With the web runtime, you can provide callback functions to receive notification when certain animation events have occurred:onLoadwhen a rive file has been loaded and initialized; it’s now ready for playbackonPlaywhen one or more animations play; provides a list of animationsonPausewhen one or more animations pause; provides a list of animationsonStopwhen one or more animations are stopped; provides a list of animationsonLoopwhen an animation loops; provides the animation name