Click here to Skip to main content
16,019,129 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
anybody can help me....
i want to know why my sound can't play when i click the button...
this is my code...

<div>
<embed id="sound" src="edited jawi/1alif.mp3" autostart="false" hidden="true" a href="huruf-huruf jawi/1alif.html" target="main" onmouseover="image1.src="nombor/1.gif;" onmouseout="image1.src="button/1alif.gif;"  önclick="document.getElementById('sound').play()><img name="image1" src="button/1alif.gif" width="100" height="70"></div>


the mouse event are running normally but when it come to sound, the sound doesn't play it... why...

thank for your attention....
Posted

1 solution

Unfortunately, this is not like the tag embed is supposed to work. Please see: http://www.htmlcodetutorial.com/embeddedobjects/_EMBED.html[^]. It depends on plug-in, browser-dependent and can suggest plug-in download, but not really playing the audio file right away.

See also this: http://www.htmlcodetutorial.com/help/ftopic7098.html[^].

Something similar to what you want is HTML5 (http://en.wikipedia.org/wiki/HTML5[^]) tag audio, see, for example, http://www.w3schools.com/html5/tag_audio.asp[^].

Unfortunately, HTML5 is not yet fully supported by any browser, see this: http://en.wikipedia.org/wiki/Comparison_of_layout_engines_(HTML5)[^]. Its standardization process by W3C is not yet complete.

—SA
 
Share this answer
 
v3

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900