Playing A Sound On Mouse Over
You can modify a menu so that a sound is played when a user moves the mouse cursor over 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 first 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 myshst(n)
{
if(n)
if(nIEW)
{
var s=stgobj('stsnd');
if(s)
{
s.volume=0;
s.src=s.src;
}
}
}
function setshst()
{
var i=st_ms[st_cm].ps[st_cp].is[st_ci];
i.myshst=myshst;
}
Be sure to change "sound.wav" to the name of the WAV file you are using.
3. Select all menu items, and enter this code in the "Item Condition" Suffix field:
setshst();
4. Publish the menu.
5. The WAV file should be in the same directory with the .html files that include the menu.
