First time here? First time here? Newsletter Signup Newsletter
651326 Members and growing! | Flash Jobs
Search tutorials
Author: Gonzalo Alustiza

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 don’t 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: 5.83 Votes: 30
(10 being the highest)
» 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.
» Forums
More help? Search our boards for quick answers!

Comments

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

  • You must have javascript enabled in order to post comments.

Leave a Comment
  • Your email address will not be published. All fields are required.
Featured Flash FLA
» Author: work2survive
» Title: Girl Walking 1kb
» Description: Walking girl, animation just takes 1kb, using high heels shoes, and fashion model attitude.
Featured Sound Loops
Image for equalize

Audio Player

» Author: BoxCat
» Title: CPU Talk
» Description: From the cyberpunk RPG, "Nameless: the Hackers" Completely Free to use! Keywords: edm hip hop rap electronic mysterious mission hacking chase exciting spy ios ambient chilling love happy sad angry suspense
Latest Font
» Author: Fábio FAFERS
» Description: I created this font for free use. Everyone can apply it in personal or business texts. Its free, but I want to be communicated in case of business use. Donations are accepted to keep the project of free fonts alive! Thank you all
Featured Sound Fx
Image for equalize

Audio Player

» Author: nathan
» Description:

A recorded sound of the Dimensional Fork Gate.