Linking page elements to sounds
This is the easy part, if you read through this document you have your invisible frame, your web page inside the invisible frame that embeds the Flash Movie, the Flash Movie with sounds as Movie Clips, your JavaScript code library and the web pages that you want sonified.
Now we will see how to create the event handlers needed to sonify links and/or images.
To use the sound function from a web page:
a. Reference the JavaScript library soundtown.js from HTML like this:
<script SRC="soundtown.js">
It is important (as I said before) that you reference the external library from every web page that will have sounds so the sound functions are available to be called from event handlers.
b. Insert the function call inside a onmouseover event handler like this.
<a href="agenda.htm" onmouseover="sound(event,'true');" target="principal"><img border="0" src="images/m_agenda.gif" width="65" height="43" name="m_agenda"></a>
When the onmouseover event fires, it will call the function and the sound will start.
If you want the sounds to stop when the user moves the mouse pointer away from the link and/or image you can add a function call to a onmouseout event. Like this:
Onmouseout="sonido(event,'');" Notice the play flag as an empty string
In this case, the sound inside the Movie Clip will stop. It really is a matter of taste, I mean, if you want sounds to bleed into each other dont use the onmouseout event. Personally I think that stopping sounds when the user leaves the link and/or image allows a much controlled sound experience, but again, it is a matter of taste.
| » Level Intermediate |
|
Added: 2001-02-20 Rating: 6 Votes: 29 |
| » Author |
| My name is Gonzalo Alustiza and I work as a chief developer at Soundtown Argentina. Soundtown is a ten year old music production company specializing in music for advertising and TV which started to develop sonification solutions for the Internet. |
| » Download |
| Download the files used in this tutorial. |
| Download (89 kb) |
| » Forums |
| More help? Search our boards for quick answers! |
-
You must have javascript enabled in order to post comments.


Comments
There are no comments yet. Be the first to comment!