Hi Guys,
I have sound code to play a file in Javascript when moving the cursor over an image (onmouseover), and similarly to turn off the sound clip when moving away from the image (onmouseout). This code works fine. The problem is that if you roll-over and off the image, and roll-over the image again, instead of starting the whole sound clip from the beginning, you may only hear the end portion the clip. It picks-up where you left off. Does anyone know if there is a way that the whole clip can be played from the beginning? (I have to include about 30 images with varying sound clips in one web page).
Many thanks
Code:
function EvalSound(soundobj)
{
var thissound;
thissound=eval(“document.”+soundobj);
thissound.Play();
}
function EvalSoundStop(soundobj)
{
var thissound;
thissound=eval(“document.”+soundobj);
thissound.stop();
}
<EMBED src=”xxxx.wav” autostart=false name=”sound1″ enablejavascript=”true”>
<A HREF=”” onmouseover=”EvalSound(‘sound1’);” onmouseout=”EvalSoundStop(‘sound1’);”>
<IMG SRC=”xxxx.jpg”>
</A>