Trying to get a javascript function to play a sound
Hey, I am trying to get a sound to play when the user moves the mouse over on of my links. I don't know javascript, I just copied this code from a book, so it's probably something simple. Here is my code:
<script language="JavaScript" type="text/javascript">
function playSound()
{
src="misc020.wav";
}
</script>
<A HREF="http://www.newhorizondesigns.org" onMouseOver="playSound()">Home</A></td>
adaykin
Junior Poster in Training
73 posts since Feb 2007
Reputation Points: 10
Solved Threads: 0
That's weird looking script. I can't see any way that it could work - in that context; 'src' wont relate to anything useful.
This page has some example code (lots of examples); it won't work for me; but I'm not on a computer with many media plugins:
http://www.phon.ucl.ac.uk/home/mark/audio/play.htm
Hope that helps some...
MattEvans
Veteran Poster
1,386 posts since Jul 2006
Reputation Points: 522
Solved Threads: 64
That's weird looking script. I can't see any way that it could work - in that context; 'src' wont relate to anything useful.
This page has some example code (lots of examples); it won't work for me; but I'm not on a computer with many media plugins:
http://www.phon.ucl.ac.uk/home/mark/audio/play.htm
Hope that helps some...
thanks I used #4 on that list, and it works, check it out, the links on the left side of the page are where it is designed to play: http://www.newhorizondesigns.org
adaykin
Junior Poster in Training
73 posts since Feb 2007
Reputation Points: 10
Solved Threads: 0