Click to See Complete Forum and Search --> : Sound on Button click


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!

hastx
07-05-2003, 10:11 AM
It's probably a browser specific issue. THe page worked fine for me in IE5. but did not work at all in Mozilla.

Your download Manager may be interfering due to its own file associations. It sees the link as a download so it tries to take over, just a thought.

Maybe someone into Javascript can narrow down why it doesnt work in other browsers.

learninghtml
07-05-2003, 10:35 AM
Originally posted by hastx
It's probably a browser specific issue.

Thanks.

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.

I got rid of the DAP problem, as you said I removed the appropriate file association, but the browser error is still present.

Serve-side problem?

Anyother with ideas?

cjc1055
04-17-2005, 08:42 PM
dfg