Multiple Actions on one click

wxdqz

New Member
I am making a menu for a website. I want it to play a sound, and do a roll over when I click it. I was just wondering if this is possible. I tried it, but adding the rollover code above or below the sound code, makes it so neither works.
Here is the working sound code:

<html>
<head>
<base target="main">
<head>
<script language="javascript" type="text/javascript">
var aySound = new Array();
// Below: source for sound files to be preloaded
aySound[0] = "siren.wav";

// DO NOT edit below this line
document.write('<BGSOUND ID="auIEContainer">')
IE = (navigator.appVersion.indexOf("MSIE")!=-1 && document.all)? 1:0;
NS = (navigator.appName=="Netscape" && navigator.plugins["LiveAudio"])? 1:0;
ver4 = IE||NS? 1:0;
onload=auPreload;

function auPreload() {
if (!ver4) return;
if (NS) auEmb = new Layer(0,window);
else {
Str = "<DIV ID='auEmb' STYLE='position:absolute;'></DIV>";
document.body.insertAdjacentHTML("BeforeEnd",Str);
}
var Str = '';
for (i=0;i<aySound.length;i++)
Str += "<EMBED SRC='http://www.webdeveloper.com/forum/archive/index.php/"+aySound+"' AUTOSTART='FALSE' HIDDEN='TRUE'>"
if (IE) auEmb.innerHTML = Str;
else {
auEmb.document.open();
auEmb.document.write(Str);
auEmb.document.close();
}
auCon = IE? document.all.auIEContainer:auEmb;
auCon.control = auCtrl;
}
function auCtrl(whSound,play) {
if (IE) this.src = play? aySound[whSound]:'';
else eval("this.document.embeds[whSound]." + (play? "play()":"stop()"))
}
function playSound(whSound) { if (window.auCon) auCon.control(whSound,true); }
function stopSound(whSound) { if (window.auCon) auCon.control(whSound,false); }

</script>
</Head>

<Body background="Images\leftback.jpg" alink=black vlink=black link=black>
<A HREF=http://www.webdeveloper.com/forum/archive/index.php/"Home.html" onclick="playSound(0)"><img src="Images\minilogoin.jpg" width=80%></A>
<A HREf="members.html"><img src="Images\membersin.jpg" width=80%></A>
<A HREF="media.html"><img src="Images\mediain.jpg" width=80%></A>
<A HREf="Links.html"><img src="Images\linksin.jpg" width=80%></A>
</body>
</html>

Could someone show me how to do this if it is possible.
 
Back
Top