Computing.Net > Forums > Web Development > Mouseover- Swap Image & Play Sound?

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

Mouseover- Swap Image & Play Sound?

Reply to Message Icon

Name: LollyFrost
Date: September 3, 2005 at 18:44:06 Pacific
OS: XP
CPU/Ram: AMD Athlon
Comment:

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!



Sponsored Link
Ads by Google

Response Number 1
Name: Michael J (by mjdamato)
Date: September 3, 2005 at 23:19:19 Pacific
Reply:

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.


0

Response Number 2
Name: LollyFrost
Date: September 3, 2005 at 23:49:39 Pacific
Reply:

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.



0

Response Number 3
Name: LollyFrost
Date: September 4, 2005 at 17:28:46 Pacific
Reply:

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!


0

Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More


Ftp Upload program static or dynamic page



Post Locked

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


Go to Web Development Forum Home


Sponsored links

Ads by Google


Results for: Mouseover- Swap Image & Play Sound?

Not loading! www.computing.net/answers/webdevel/not-loading/897.html

background mp3 www.computing.net/answers/webdevel/background-mp3/1293.html

xhtml validation errors using www.computing.net/answers/webdevel/xhtml-validation-errors-using-/1695.html