learninghtml
07-04-2003, 02:44 PM
Hi,
I'm scratching my head over this one!
I have a page where I want users to be able to click a button and hear a particular sound. But I am having problems...
Here's the code
In the head...
<script type="text/javascript">
<!--
function playsound(sdnumber) {
document.embeds[sdnumber].play();
}
// -->
</script>
In the body...
<embed src="Sounds/doorslam.mp3" hidden=true autostart=false>
and for the button link...
<a href="#" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('DoorSlam','','Buttons/snd_doorslam_down.gif',1)"
onClick="playsound('0');return false; ">
<img src="Buttons/snd_doorslam_up.gif" alt="A door slamming in a cavernous space. " name="DoorSlam" width="150" height="30" border="0" align="absmiddle"></a>
I've cut out irrelevant code and there is more than one sound (and button). In preview on Dreamweaver it works fine but when uploaded (same browser - IE6) it does two things firstly it invokes my Download Accelerator (DAP) and then displays the following script error....
"Could not complete the operation due to error ffffffce"
Website: www.codsalldramaticsociety.co.uk
Page is a test hence it's 'hidden' - Click on the logo top-left corner to access the page.
Please help!
I'm scratching my head over this one!
I have a page where I want users to be able to click a button and hear a particular sound. But I am having problems...
Here's the code
In the head...
<script type="text/javascript">
<!--
function playsound(sdnumber) {
document.embeds[sdnumber].play();
}
// -->
</script>
In the body...
<embed src="Sounds/doorslam.mp3" hidden=true autostart=false>
and for the button link...
<a href="#" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('DoorSlam','','Buttons/snd_doorslam_down.gif',1)"
onClick="playsound('0');return false; ">
<img src="Buttons/snd_doorslam_up.gif" alt="A door slamming in a cavernous space. " name="DoorSlam" width="150" height="30" border="0" align="absmiddle"></a>
I've cut out irrelevant code and there is more than one sound (and button). In preview on Dreamweaver it works fine but when uploaded (same browser - IE6) it does two things firstly it invokes my Download Accelerator (DAP) and then displays the following script error....
"Could not complete the operation due to error ffffffce"
Website: www.codsalldramaticsociety.co.uk
Page is a test hence it's 'hidden' - Click on the logo top-left corner to access the page.
Please help!