Playing A Sound On Click
You can modify a menu so that a sound is played when a user clicks on a menu item, as in the following example:
Here are the steps to add a mouse-over background sound to a menu:
1. Select the desired menu item in the Menu Tree, go to the Menu Item window, click the round button in the upper right corner, and click Edit Condition. This opens the Item Condition dialog.
2. Enter the following code in the "Item Condition" Prefix field:
if(nIEW)
{
document.write("<BGSOUND VOLUME=-10000 ID=stsnd SRC='sound.wav'>");
onblur=function()
{
document.all["stsnd"].volume=-10000;
}
}
function playandopen(u,t) // Play sound and open a link
{
if(nIEW)
{
var s=stgobj('stsnd');
if(s)
{
s.volume=0;
s.src=s.src;
}
}
void(setTimeout("open('"+u+"','"+t+"')",500));
}
Be sure to change "sound.wav" to the name of the WAV file you are using.
3. Switch back to Menu Item>General and enter the following code in the Link field:
javascript:playandopen("http://www.pittwebs.com/","_self");
Be sure to change http://www.pittwebs.com/ to the desired URL.
4. Publish the menu.
5. The WAV file should be in the same directory with the .html files that include the menu.
