Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
Hello. I'm new to javascript but have been trying out the image swapping code a bit lately for my site, which is pretty cool. Then recently I saw on a site that you can "mouseover" an image and a sound can play.
My question is, is it possible to mouseover a swapping image AND have it play a sound? I tried combining the codes, but it didn't work, and frankly I don't really know what I'm doing. Any info would be greatly appreciated! Thank you!

The answer to your question is yes. Perhaps if you were to post the code you have it would be easier for us to help you.

Oh sorry! I thought the codes were pretty standard. It won't paste correctly so go to the link below and view the source.
http://freefilehosting.net/file/?id=rdjwlKzb
Btw- I know the image doesn't show up...it's just because of where I uploaded it at. I assume this won't be a problem.
Anyway, as you can see, it's not a very complex code, so I'm not sure how the sound code would work into it. Hopefully you can enlighten me. Thanks.

Just wanted to say I found how to do it. If anyone else needs to know, check this link:
http://www.codingforums.com/archive/index.php/t-17345.html
It's just a matter of using the mouseover sound code (http://javascriptkit.com/script/script2/soundlink.shtml), and then adding it into the the image swap code, like so:
onMouseOver="playSound(0);rollimg()" onMouseOut="stopSound(0);unRoll()"
I wanted to post that in case that link ever stops working. Anywho, thanks anyway!

![]() |
Ftp Upload program
|
static or dynamic page
|

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.
| Ads by Google |