RE: Some questions for all the clever folks

by Francois de Beer <fbeer(at)sars.gov.za>

 Date:  Wed, 26 Apr 2000 08:55:47 +0200
 To:  "'WSherratt(at)aol.com'" <WSherratt(at)aol.com>,
hwg-techniques(at)mail.hwg.org,
RandysHere(at)aol.com
  todo: View Thread, Original
If you ID your bgsound and change the src dynamically, you should get the
desired effect.
As in:
<HTML>
<HEAD>
<TITLE>Test Sound With Clicks</TITLE>
</HEAD>
<bgsound id="MyBgSound" src="../Wav0.wav" loop="0">
<SCRIPT ID=clientEventHandlersJS LANGUAGE=javascript>
<!--

function Click_onclick() {
	MyBgSound.src = "../Wav1.wav"
}

function Click2_onclick() {
	MyBgSound.src = "../Wav2.wav"
}

function MouseOver1_onmouseover() {
	MyBgSound.src = "../MouseOver1.wav"
}

function MouseOver2_onmouseover() {
	MyBgSound.src = "../MouseOver2.wav"
}

//-->
</SCRIPT>
</head>

<body>
<div id="Click" LANGUAGE=javascript onclick="return Click_onclick()"
onmouseover="return Click_onmouseover()">
<p>Click Me!</p>
</div>

<div id="Click2" LANGUAGE=javascript onclick="return Click2_onclick()"
onmouseover="return Click2_onmouseover()">
<p>Now Click Me!</p>
</div>

<div id="MouseOver1" LANGUAGE=javascript onmouseover="return
MouseOver1_onmouseover()">
<p>Move Mouse Over Me</p>
</div>

<div id="MouseOver2" LANGUAGE=javascript onmouseover="return
MouseOver2_onmouseover()">
<p>Now Move Mouse Over Me</p>
</div>
</BODY>
</HTML>

Not tested but this should get you in the right direction. Also I dunno if
this will work in anything other than IE4+

>>what I meant was a JS rollover that activates a sound,
>>not a sound that changes on rollover.
>>Eg I have a button that I want to light up when the mouse is passed over
it, 
>>AND have a sound happen during this time.

HWG hwg-techniques mailing list archives, maintained by Web Professional Association - IWA

This page is part of a preserved archive of archives.hwg.org. The site is no longer active and its content is not maintained. For enquiries about this archive, write to archive(at)iwanet.org.