View Full Version : Audio on MouseOver

09-26-2012, 06:50 PM
I am trying to get the code below to pronounce a word when that word is moused over. I am able to do that, but the problem is....after it is initially announced, it may play the word (audio) no matter where the mouse is on the page. I only want the audio to play when the mouse touches the word. Any suggestions on how to prevent this is appreciated.

<script language="javascript" type="text/javascript">
function playSound(soundfile)
"<embed src=\""+soundfile+"\" hidden=\"true\" autostart=\"true\" loop=\"false\" />";


<span id="dummy"></span>

<span onmouseover="playSound('what.wma');">What</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<span onmouseover="playSound('can.wma');">can</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<span onmouseover="playSound('we.wma');">we</span>