Philip WATTS wrote:
Quote:
I am trying to put a simple sound to a link image. I have used the following
code, but every time the image is clicked the media player controls pop up
and have to be used to play the sound.
a href="../../images/till.wav" hidden="true"><img
src="../../images/till.gif"></a
What have I omitted?
Many thanks
Phil |
It's messy; but try using the <embed...> tag. Not too hot on it myself,
so try looking on
http://www.webmonkey.com or elsewhere for it.
Also, you could try playing it with Javascript; which would be a neater
solution but may require you to change the format of the sound.
Sorry I can't help more, I've never needed to implement that.
Hang on....
Put THIS in between your <head> tags:
<script>
function Define_Sounds(){
VARIABLE_NAME = '../../images/till.wav'
}
function playSound(SOUND_NAME)
{
Define_Sounds()
eval(SOUND_NAME+".play(false)")
}
</script>
PUT THIS NEXT PART IN YOUR BODY:
<embed src="SOUND.wav" hidden=true autostart=false>
This will NOT SHOW ANYTHING VISIBLE on the page.
To PLAY the sound:
<a href="#" onClick="playSound('VARIABLE_NAME')"><img
src="../../images/till.gif"></a>
If you want the sound already playing, omit that link and change
auto-start in your embed tag to true
This is untested, but should work. Reply with any problems; good luck!
-Will