469,333 Members | 4,670 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,333 developers. It's quick & easy.

Playing a sound onmouseover

Hi,

On a rollover I am looking to change an image AND have a sound play. I was hoping to do this with javascript. The image is done but the sound - I have been looking into it (sound with javascript) and it seems like this is a thing of the past - and is difficult to do cross browser etc. Anyone have any info on whether this is possible, or how difficult it would be? I was hoping to do this without flash, but will use it if no other options present themselves.

Thanks for you help,
Aug 15 '07 #1
7 1825
pbmods
5,821 Expert 4TB
Heya, Steve.

To do this, you'd have to embed a sound file into the page and then call the element's play() method when mousing over the image (and stop() on mouseout, maybe). No promises as to synchronization, though.
Aug 15 '07 #2
and this is cross-browser compliant you reckon?




Heya, Steve.

To do this, you'd have to embed a sound file into the page and then call the element's play() method when mousing over the image (and stop() on mouseout, maybe). No promises as to synchronization, though.
Aug 15 '07 #3
pbmods
5,821 Expert 4TB
Heya, Steve.

and this is cross-browser compliant you reckon?
Presumably; all browsers support embedded objects, and they are controllable. This is about the extent of my knowledge in this area, though.
Aug 15 '07 #4
acoder
16,027 Expert Mod 8TB
The object element is the standard element to use. See link. Read up on the object element reference (and other refs.) on the left hand side menu.
Aug 16 '07 #5
pbmods
5,821 Expert 4TB
Changed thread title to better describe the problem.
Aug 16 '07 #6
Logician
210 100+
Hi,

On a rollover I am looking to change an image AND have a sound play. I was hoping to do this with javascript. The image is done but the sound - I have been looking into it (sound with javascript) and it seems like this is a thing of the past - and is difficult to do cross browser etc. Anyone have any info on whether this is possible, or how difficult it would be? I was hoping to do this without flash, but will use it if no other options present themselves.
If you're still stuck, you could try PlayMedia, which works most of the time.
Aug 18 '07 #7
jx2
228 100+
sound in javascript i think you might want to see this one
Aug 18 '07 #8

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

4 posts views Thread by Brian Basquille | last post: by
1 post views Thread by Kiteman \(Canada\) | last post: by
1 post views Thread by Peter Schmitz | last post: by
2 posts views Thread by laredotornado | last post: by
7 posts views Thread by Lee Moody | last post: by
6 posts views Thread by =?Utf-8?B?VmVybm9uIFBlcHBlcnM=?= | last post: by
5 posts views Thread by gazza67 | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by zhoujie | last post: by
reply views Thread by suresh191 | last post: by
reply views Thread by Marylou17 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.