Variable in Hype


(haytham) #1

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


(Rick) #2

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.


#3

@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”:
https://www.w3schools.com/jsref/jsref_obj_date.asp
https://www.w3schools.com/js/js_dates.asp

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


#4

Thanks @JimScott

This library might also be helpful:


(haytham) #5

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:


#6

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

(haytham) #7

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


(Hans-Gerd Claßen) #8

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: