Sound on Button click

windows

Guest
Hi,<br />
I'm scratching my head over this one!<br />
<br />
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...<br />
<br />
Here's the code<br />
In the head...<br />
<script type="text/javascript"><br />
<!--<br />
function playsound(sdnumber) {<br />
document.embeds[sdnumber].play();<br />
}<br />
// --><br />
</script><br />
<br />
In the body...<br />
<embed src=http://www.webdeveloper.com/forum/archive/index.php/"Sounds/doorslam.mp3" hidden=true autostart=false> <br />
<br />
and for the button link...<br />
<br />
<a href=http://www.webdeveloper.com/forum/archive/index.php/"#" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('DoorSlam','','Buttons/snd_doorslam_down.gif',1)" <br />
<br />
onClick="playsound('0');return false; "><br />
<br />
<img src=http://www.webdeveloper.com/forum/archive/index.php/"Buttons/snd_doorslam_up.gif" alt="A door slamming in a cavernous space. " name="DoorSlam" width="150" height="30" border="0" align="absmiddle"></a><br />
<br />
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 <!--more--> Accelerator (DAP) and then displays the following script error....<br />
<br />
"Could not complete the operation due to error ffffffce"<br />
<br />
Website: <!-- w --><a class="postlink" href="http://www.codsalldramaticsociety.co.uk">www.codsalldramaticsociety.co.uk</a><!-- w --><br />
<br />
Page is a test hence it's 'hidden' - Click on the logo top-left corner to access the page.<br />
<br />
Please help!<!--content-->It's probably a browser specific issue. THe page worked fine for me in IE5. but did not work at all in Mozilla.<br />
<br />
Your Download <!--more--> Manager may be interfering due to its own file associations. It sees the link as a Download <!--more--> so it tries to take over, just a thought. <br />
<br />
Maybe someone into Javascript can narrow down why it doesnt work in other browsers.<!--content-->Originally posted by hastx <br />
It's probably a browser specific issue. <br />
<br />
Thanks.<br />
<br />
When previewed using "Internet Exploder 6" it works fine and not at all in "Netscrape". It's only when upload to host and viewed on-line it generates the errors.<br />
<br />
I got rid of the DAP problem, as you said I removed the appropriate file association, but the browser error is still present.<br />
<br />
Serve-side problem?<br />
<br />
Anyother with ideas?<!--content-->dfg<!--content-->
 
Back
Top