sound onClick?

Posts: 29
Joined: Wed Oct 04, 2017 11:18 am

sound onClick?

Postby sstgerma » Wed Nov 15, 2017 3:25 pm

I was looking at the hotspot-sounds example. I would like to do something similar except play the sound onClick rather than automatically. What actions/events are available to play or stop a sound? Please let me know. Thanks!

User avatar
ForgeJS Team
Posts: 166
Joined: Wed Oct 26, 2016 12:19 pm

Re: sound onClick?

Postby rroux » Fri Nov 17, 2017 1:55 pm


You should take a look at the hotspots-states sample.
There is a hotspot with the "hotspot-checkbox-0" uid.
if you look at the configuration it has an event binded onClick that will toggle the hotspot states.
I didn't try but I guess that if you have two states for your spot (one with sound and the other without sound), you should be able to toggle the sound on and off with this technic. Combining action and states toggle should do the trick :)
Tell me if it worked!

Have a nice day!
- Raphaël

Who is online

Users browsing this forum: No registered users and 2 guests