Attaching Your Sounds to the Images
To attach the sound that we created in this tutorial to the Angry Coffee logo above we use the code below:
<SCRIPT SRC="music-object.js"></SCRIPT>
<SCRIPT LANGUAGE=JavaScript>
new Music ('stub');
stub.preloadEmbed ('stub.rmf');
new Music ('coffee');
coffee.preloadEmbed ('coffee.rmf');
</SCRIPT>
Again, simply replace each instance of the word "coffee" above with the name of your own custom sound file.
Finally, attach the sound to the image by adding this line of code right before the image tag:
<a href="fill-in-your-file-path-here" onMouseOver="coffee.play();">
The fill-in-your-file-path-here part is where you want the image to take the user when it is clicked on. In this case, a Mouseover gives you a sound, while a click takes you elsewhere. You can get sounds on clicks, too.