|
Step 1. Using Notepad or your favorite text editor, create a file named overplay.js.
Insert the following code, substituting your sound file name for soundfile.wav in the code:
function DHTMLSound(surl) { document.getElementById('soundspan').innerHTML="<embed src='"+surl+"' height=0 width=0 autostart=true loop=false>"; } function OverPlay() { DHTMLSound('soundfile.wav'); }
Note: make sure the second line doesn't linewrap... it should be all on one line, unlike what you see above. Save the file. You'll need it later.
Step 2. In your page Layout HTML, insert the following code on the Between Head Tags tab.
note: this "includes" the external javascript file created in Step 1. By not placing the script and an embed tag for the sound file directly on your page, you avoid an alert about running an ActiveX control in current IE browsers. (April 2006)
Step 3. a. Add the image you wish to use to your page using the Fusion Picture Tool.
b. Select the image and press F3.
c. Click on the HTML button in the Picture Properties window.
d. On the Inside Tag tab, enter: onMouseOver="OverPlay()"
e. On the After Tag tab enter: <span id="soundspan"></span>
Step 4. Using your favorite FTP program, upload the wave sound file you wish to use and the overplay.js script to your web server. Placing both in the same folder as the web page is the simplest method. If you place them elsewhere, you'll need to add relative path info to the example code.
Notes: If you wish to have a user click on the image to play the sound, change "onMouseOver" to "onClick".
You can have Fusion manage the script file and sound file by adding them as assets in Assets View.
If you do so, they'll end up in the root folder of your site by default. You can modify this behavior in Publish View.
|