PDA

View Full Version : nav bar sounds opening in NEW window to play


Stu
09-14-2002, 02:04 AM
I just started to build a new site with Dreamweaver MX. I've been stumped with this problem for two weeks. I have a large site in mind and when I get stumped I cannot go farther into development causwe it blocks my train of thaught. Please help. My nave bar uses 3 images for each button. also it uses 2 sounds that are applied to all the buttons one for mouse over and one for on click. The sounds work perfectly on my other computers Internet Explorer 6 and on a few friends as well. The problem is that some users, that I have had look at it to help test it, say that it's opening up REAL PLAYER or Media Player to play the sounds. The first user had Real opening and he uninstalled it cause he didn't like it and then the nav bar worked on his computer. My main issue is to keep the site as low on bandwidth usage as possible and not to use a whole lot of flash, especially on buttons due to other users who don't update their plug-ins.
the code is really long but I hope you can decifer what my problem is.

here's the code:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>navbar</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<script language="JavaScript" type="text/JavaScript">
<!--
function MM_preloadImages() { //v3.0
var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.01
var p,i,x; if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_nbGroup(event, grpName) { //v6.0
var i,img,nbArr,args=MM_nbGroup.arguments;
if (event == "init" && args.length > 2) {
if ((img = MM_findObj(args[2])) != null && !img.MM_init) {
img.MM_init = true; img.MM_up = args[3]; img.MM_dn = img.src;
if ((nbArr = document[grpName]) == null) nbArr = document[grpName] = new Array();
nbArr[nbArr.length] = img;
for (i=4; i < args.length-1; i+=2) if ((img = MM_findObj(args[i])) != null) {
if (!img.MM_up) img.MM_up = img.src;
img.src = img.MM_dn = args[i+1];
nbArr[nbArr.length] = img;
} }
} else if (event == "over") {
document.MM_nbOver = nbArr = new Array();
for (i=1; i < args.length-1; i+=3) if ((img = MM_findObj(args[i])) != null) {
if (!img.MM_up) img.MM_up = img.src;
img.src = (img.MM_dn && args[i+2]) ? args[i+2] : ((args[i+1])? args[i+1] : img.MM_up);
nbArr[nbArr.length] = img;
}
} else if (event == "out" ) {
for (i=0; i < document.MM_nbOver.length; i++) {
img = document.MM_nbOver[i]; img.src = (img.MM_dn) ? img.MM_dn : img.MM_up; }
} else if (event == "down") {
nbArr = document[grpName];
if (nbArr)
for (i=0; i < nbArr.length; i++) { img=nbArr[i]; img.src = img.MM_up; img.MM_dn = 0; }
document[grpName] = nbArr = new Array();
for (i=2; i < args.length-1; i+=2) if ((img = MM_findObj(args[i])) != null) {
if (!img.MM_up) img.MM_up = img.src;
img.src = img.MM_dn = (args[i+1])? args[i+1] : img.MM_up;
nbArr[nbArr.length] = img;
} }
}

function MM_controlSound(x, _sndObj, sndFile) { //v3.0
var i, method = "", sndObj = eval(_sndObj);
if (sndObj != null) {
if (navigator.appName == 'Netscape') method = "play";
else {
if (window.MM_WMP == null) {
window.MM_WMP = false;
for(i in sndObj) if (i == "ActiveMovie") {
window.MM_WMP = true; break;
} }
if (window.MM_WMP) method = "play";
else if (sndObj.FileName) method = "run";
} }
if (method) eval(_sndObj+"."+method+"()");
else window.location = sndFile;
}
//-->
</script>
</head>

<body bgcolor="#000000" onLoad="MM_preloadImages('Buttons/homeblack.gif','Buttons/homered.gif','Buttons/fcblack.gif','Buttons/fcred.gif','Buttons/ptblack.gif','Buttons/ptred.gif','Buttons/svblack.gif','Buttons/svred.gif','Buttons/sponsorsblack.gif','Buttons/sponsorsred.gif','Buttons/membersblack.gif','Buttons/membersred.gif')">
<div align="center"><a href="home.htm" target="mainFrame" onClick="MM_nbGroup('down','group1','Home','Buttons/homeblack.gif',1);MM_controlSound('play','document.CS1031882338676','sounds/I_Close.wav')" onMouseOver="MM_nbGroup('over','Home','Buttons/homered.gif','Buttons/homeblack.gif',1);MM_controlSound('play','document.CS1031882330875','sounds/I_Beep.wav')" onMouseOut="MM_nbGroup('out')"><img src="Buttons/homeblue.gif" alt="Return Home" name="Home" border="0" onload=""></a><a href="forums.htm" target="mainFrame" onClick="MM_nbGroup('down','group1','Forums','Buttons/fcblack.gif',1);MM_controlSound('play','document.CS1031882338676','sounds/I_Close.wav')" onMouseOver="MM_nbGroup('over','Forums','Buttons/fcred.gif','Buttons/fcblack.gif',1);MM_controlSound('play','document.CS1031882330875','sounds/I_Beep.wav')" onMouseOut="MM_nbGroup('out')"><img src="Buttons/fcblue.gif" alt="Forums and Chat Rooms" name="Forums" border="0"></a><a href="plans.htm" target="mainFrame" onClick="MM_nbGroup('down','group1','Plansandtips','Buttons/ptblack.gif',1);MM_controlSound('play','document.CS1031882338676','sounds/I_Close.wav')" onMouseOver="MM_nbGroup('over','Plansandtips','Buttons/ptred.gif','Buttons/ptblack.gif',1);MM_controlSound('play','document.CS1031882330875','sounds/I_Beep.wav')" onMouseOut="MM_nbGroup('out')"><img src="Buttons/ptblue.gif" alt="Plans and Techniques" name="Plansandtips" border="0"></a><a href="supplies.htm" target="mainFrame" onClick="MM_nbGroup('down','group1','svblue','Buttons/svblack.gif',1);MM_controlSound('play','document.CS1031882338676','sounds/I_Close.wav')" onMouseOver="MM_nbGroup('over','svblue','Buttons/svred.gif','Buttons/svblack.gif',1);MM_controlSound('play','document.CS1031882330875','sounds/I_Beep.wav')" onMouseOut="MM_nbGroup('out')"><img src="Buttons/svblue.gif" alt="Supplies and Vendors" name="svblue" border="0"></a><a href="sponsors.htm" target="mainFrame" onClick="MM_nbGroup('down','group1','Sponsors','Buttons/sponsorsblack.gif',1);MM_controlSound('play','document.CS1031882338676','sounds/I_Close.wav')" onMouseOver="MM_nbGroup('over','Sponsors','Buttons/sponsorsred.gif','Buttons/sponsorsblack.gif',1);MM_controlSound('play','document.CS1031882330875','sounds/I_Beep.wav')" onMouseOut="MM_nbGroup('out')"><img name="Sponsors" src="Buttons/sponsorsblue.gif" border="0" alt="Who Sponsors Spad World"></a><a href="links.htm" target="mainFrame" onClick="MM_nbGroup('down','group1','Members','Buttons/membersblack.gif',1);MM_controlSound('play','document.CS1031882338676','sounds/I_Close.wav')" onMouseOver="MM_nbGroup('over','Members','Buttons/membersred.gif','Buttons/membersblack.gif',1);MM_controlSound('play','document.CS1031882330875','sounds/I_Beep.wav')" onMouseOut="MM_nbGroup('out')"><img src="Buttons/membersblue.gif" alt="Members Sites" name="Members" border="0"></a>
</div>
<EMBED NAME='CS1031882330875' SRC='sounds/I_Beep.wav' LOOP=false
AUTOSTART=false MASTERSOUND HIDDEN=true WIDTH=0 HEIGHT=0></EMBED>
<EMBED NAME='CS1031882338676' SRC='sounds/I_Close.wav' LOOP=false
AUTOSTART=false MASTERSOUND HIDDEN=true WIDTH=0 HEIGHT=0></EMBED>
</body>
</html>


END CODE..

Here is the link to the site if you want to see what I'm working on.
www.spadworld.com

Let me know if you can help me. I've looked in Creating Web Pages, All-in-one Desk Reference, For DUMMIES 9 in 1 book.
and still found nothing on the navbar with sounds.

Thanks Stu

beetle
09-16-2002, 08:04 PM
You'd be better off with flash buttons. Flash encodes sounds as MP3s for the SWF, so your compression is just as good. Since you've already got a 3-state rollover, filesize for flash buttons should be comparable or less, plus you are loading everything as 1 file, instead of 4 for each button, plus you don't need all that messy DW javascript for the rollovers.