And thank you all for making these forums so alive and helpful !
Here is my question :
I have a music playing with my main timeline. Then I want to have a button that makes music play / pause (switching function)
I found this Java functions but I can’t make it work. First, I don’t really know how to encode an “unique ID” for a sound as it is easy to do with any other elements.
How are you adding your sound? Timeline action? Dropping onto scene area? In HTML inside an element?
If you are dropping onto the scene area then you cannot manipulate it using Javascript (btw javascript is different to Java try not to mix them) because you cannot reference the audio with an id. You need to be able to access the <audio> element.
If you are calling it using a timeline then again for the reasons stated above you cannot access in the same way.
You can access it however, if you are using code (<audio> tag inside an element with an id=‘myAudio’) inside a rectangle or other element. This way you can use your shorthand javascript conditional statement.