You can control the playback of your animation with the timeline. You can access your component's timeline using: haikuComponent.getDefaultTimeline()

There’s more info in the docs, but here are some methods that may come in handy:


.play() -> void

Play this timeline at whatever frame it's currently at. (This does not reset the playhead to 0.)

.seek(milliseconds: Number) -> void

Jump to a specific time (in milliseconds) in the timeline.

Note that this locks playback to the specified frame. Use .gotoAndPlay if you want it to continue playing from that point.

.gotoAndPlay(milliseconds: Number) -> void

Seek a specific frame, and play from that point.

.gotoAndStop(milliseconds: Number) -> void

Seek to a specific frame, and stop the timeline at that point.

Did this answer your question?