Ambiera ForumDiscussions, Help and Support. |
|
|
|||||
|
Hi, Please could someone help me with adding sound to a button when it's clicked. Is there an option or do I need to code this using HTML? |
||||
|
Hi, do it like this: In RocketCake, add a HTML 5 audio element and select the sound (uncheck the 'controls' option if you want it not to be visible). Richt-click the HTML 5 audio element, select "HTML Code..." and see what ID it has. It's usually something like "audio_8538c1f". Then, create your button. Right-click, select "Insert Link " and as mode, select "JavaScript". as URL, enter this: javascript:document.getElementById('audio_8538c1f').play(); But replace that 'audio_8538c1f' with the ID of your audio. That's it. |
||||
|
Right click on button > HTML-код > on click="new Audio('../rc_images/sound-name.mp3').play();" |
|