Variable in Hype

Hi All
Is there a way to give the button 2 or 3 different behaviors depend on the time or the time line.
Rergards

Well you could have that button continue a timeline then pause it with an action (do this or that) on the pause spot then continue same timeline with same button to the next pause/action spot etc.

@haythamfarid

RE: your use of "time" are You referencing a time~date in the "real" world (days, hours, minutes, etc.).

If so You can do this with Javascript.

Here are two links that describe using the "Date object":

Do a search on the Forum for "date" you will get a myriad of hits that show various uses of the Date object.

Thanks @JimScott

This library might also be helpful:

I am sorry for all, but i mean time on time line, as i want when i press button in first time go to any time line that i created inside hype document and if it there then the click will me another method, if statement, so can any one guide me :slight_smile:

Can you provide a bulleted list with what you want to happen? I’m having trouble following you. Something like:

  • When you click an object, do X
  • If the ‘Main Timeline’ timeline has played longer than 10 seconds, do X

yes exactly that’s what i like to do, if statement, but not on the main timeline only but on any time line i have been created, else if i click a button on slide say 2 to go to slide 7 is there a way to make it when i swipe right that i go back to slide2, while if i go to slide 7 from slide 6 when i swipe right i go back to slide 6 :slight_smile:
regards

Within Hypes Javascript API there are methods to get or set the time of a timeline, go to scene etc. …

Have a look in the documentation and the forum search. if you can clearly state out what your aim is then providing a sampledocument is a good starting point :slight_smile: