Difference between timelines - trigger action

Hi,

Is it possible to trigger a JavaScript action when 2 timelines are apart by a specific time? Let’s say, one timeline is running and the other is not, I need to show a text saying “IMBALANCE” when this happens.

Thank you,

Petr

Hype includes methods to get info on current state of timelines:

https://tumult.com/hype/documentation/3.0/#code-classprettyprinthypedocument-isplayingtimelinenamed39timelinename39code

Thanks for the reply. One more question, this message has to be triggered automatically (without pushing a button or any timeline action). Let’s say one timeline is paused and the other one is playing. When they are let’s say 3 seconds apart, I need a message to show. How would you set it up? So far all the functions and methods I saw were called when pressing a button, timeline action keyframe or on scene load.

Thank you,

Petr

you can setup a setInterval or requestanimationframe repetition and remove it when your event occurs.

Thanks for your help:)