473,769 Members | 6,739 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

sounds on mouseovers that will work with most browsers?

I'm trying to get sounds to play on image mouseovers using dreamweaver
8, and I found out that the code it generates to do this only works
for IE. Is there a way to do this so that it will work with most of
the popular browsers? I don't care if it can be done with dreamweaver
or if I have to hand code or copy code from somewhere, I just want it
to work.
Here is what DW creates
function MM_controlSound (x, _sndObj, sndFile) { //v3.0
var i, method = "", sndObj = eval(_sndObj);
if (sndObj != null) {
if (navigator.appN ame == 'Netscape') method = "play";
else {
if (window.MM_WMP == null) {
window.MM_WMP = false;
for(i in sndObj) if (i == "ActiveMovi e") {
window.MM_WMP = true; break;
} }
if (window.MM_WMP) method = "play";
else if (sndObj.FileNam e) method = "run";
} }
if (method) eval(_sndObj+". "+method+"( )");
else window.location = sndFile;
}

Mar 26 '07 #1
4 1914
On 26 Mar, 02:01, "alice" <a...@fearofdol ls.comwrote:
I'm trying to get sounds to play on image mouseovers using dreamweaver
8, and I found out that the code it generates to do this only works
for IE. Is there a way to do this so that it will work with most of
the popular browsers? I don't care if it can be done with dreamweaver
or if I have to hand code or copy code from somewhere, I just want it
to work.
Here is what DW creates
function MM_controlSound (x, _sndObj, sndFile) { //v3.0
var i, method = "", sndObj = eval(_sndObj);
if (sndObj != null) {
if (navigator.appN ame == 'Netscape') method = "play";
else {
if (window.MM_WMP == null) {
window.MM_WMP = false;
for(i in sndObj) if (i == "ActiveMovi e") {
window.MM_WMP = true; break;
} }
if (window.MM_WMP) method = "play";
else if (sndObj.FileNam e) method = "run";
} }
if (method) eval(_sndObj+". "+method+"( )");
else window.location = sndFile;

}
if mp3 files you /could/ do this using a hidden iframe, and just
dynamically set the src attribute to a flash player with autostart
enabled.
http://musicplayer.sourceforge.net/ would be useful here.
you could use lame to change from wav to mp3. (-mm mono)
lame --priority 1 --resample 22050 -b40 -mm audio.wav audio.mp3
while mplayer or vlc would probably convert from mid to wav/mp3 as
well
I know this isn't a pretty method but it can work well.
I use a README in conjunction with apache fancy indexing to provide a
javascript function which attaches to all links of mimetype mp3,
setting the target of the link to point to an iframe of this type in
the README include, then I can just use standard apache indexing to
provide browseable interface to stream the colleciton.

Mar 26 '07 #2
"alice" <al***@fearofdo lls.comwrote in message
news:11******** **************@ e65g2000hsc.goo glegroups.com.. .
I'm trying to get sounds to play on image mouseovers using dreamweaver
8, and I found out that the code it generates to do this only works
for IE. Is there a way to do this so that it will work with most of
the popular browsers? I don't care if it can be done with dreamweaver
or if I have to hand code or copy code from somewhere, I just want it
to work.
Here is what DW creates
function MM_controlSound (x, _sndObj, sndFile) { //v3.0
var i, method = "", sndObj = eval(_sndObj);
if (sndObj != null) {
if (navigator.appN ame == 'Netscape') method = "play";
else {
if (window.MM_WMP == null) {
window.MM_WMP = false;
for(i in sndObj) if (i == "ActiveMovi e") {
window.MM_WMP = true; break;
} }
if (window.MM_WMP) method = "play";
else if (sndObj.FileNam e) method = "run";
} }
if (method) eval(_sndObj+". "+method+"( )");
else window.location = sndFile;
}
You could use flash: http://www.flashsoundapi.com/?preload=true
Works pretty good, check the samples!
Mar 26 '07 #3
On Mar 25, 11:41 pm, "Marc" <sorry...@dirty mail.comwrote:
"alice" <a...@fearofdol ls.comwrote in message

news:11******** **************@ e65g2000hsc.goo glegroups.com.. .


I'm trying to get sounds to play on image mouseovers using dreamweaver
8, and I found out that the code it generates to do this only works
for IE. Is there a way to do this so that it will work with most of
the popular browsers? I don't care if it can be done with dreamweaver
or if I have to hand code or copy code from somewhere, I just want it
to work.
Here is what DW creates
function MM_controlSound (x, _sndObj, sndFile) { //v3.0
var i, method = "", sndObj = eval(_sndObj);
if (sndObj != null) {
if (navigator.appN ame == 'Netscape') method = "play";
else {
if (window.MM_WMP == null) {
window.MM_WMP = false;
for(i in sndObj) if (i == "ActiveMovi e") {
window.MM_WMP = true; break;
} }
if (window.MM_WMP) method = "play";
else if (sndObj.FileNam e) method = "run";
} }
if (method) eval(_sndObj+". "+method+"( )");
else window.location = sndFile;
}

You could use flash:http://www.flashsoundapi.com/?preload=true
Works pretty good, check the samples!- Hide quoted text -

- Show quoted text -
That looks like it might just be the answer, but part of me still
wants to know if there is a way to get create a javascript mouseover
that plays a sound that works in Safari and Firefox. It seems to me
like this would be possible, but then that code may, of course, not
work in IE.

Mar 26 '07 #4
On Mar 27, 12:24 am, "alice" <a...@fearofdol ls.comwrote:
On Mar 25, 11:41 pm, "Marc" <sorry...@dirty mail.comwrote:
"alice" <a...@fearofdol ls.comwrote in message
news:11******** **************@ e65g2000hsc.goo glegroups.com.. .
I'm trying to get sounds to play on image mouseovers using dreamweaver
8, and I found out that the code it generates to do this only works
for IE. Is there a way to do this so that it will work with most of
the popular browsers? I don't care if it can be done with dreamweaver
or if I have to hand code or copy code from somewhere, I just want it
to work.
Here is what DW creates
function MM_controlSound (x, _sndObj, sndFile) { //v3.0
var i, method = "", sndObj = eval(_sndObj);
if (sndObj != null) {
if (navigator.appN ame == 'Netscape') method = "play";
else {
if (window.MM_WMP == null) {
window.MM_WMP = false;
for(i in sndObj) if (i == "ActiveMovi e") {
window.MM_WMP = true; break;
} }
if (window.MM_WMP) method = "play";
else if (sndObj.FileNam e) method = "run";
} }
if (method) eval(_sndObj+". "+method+"( )");
else window.location = sndFile;
}
You could use flash:http://www.flashsoundapi.com/?preload=true
Works pretty good, check the samples!- Hide quoted text -
- Show quoted text -

That looks like it might just be the answer, but part of me still
wants to know if there is a way to get create a javascript mouseover
that plays a sound that works in Safari and Firefox. It seems to me
like this would be possible, but then that code may, of course, not
work in IE.
it /is/ x-browser, i personally have not used dw code since 2004

Mar 27 '07 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
4674
by: Knocked Wood | last post by:
Hi, I looked around and can't find anything on this at all and can not get it to work for IE. I'm trying to loop multiple sounds on a game, with three unique variables, when a link is clicked. Something like... <Script Language="JavaScript"> <!-- function playSound(soundName, loops, timeLength){
2
1653
by: bsanderson | last post by:
I am trying to build the same text link mouseover as yahoo has on each news item. when you hover over the link, a small box pops up and displays a photo wtih text. I can get the box to pop up, but I can get it to position away from the mouse icon. I want the menu box to display 25 pix down and 10 to the right of the mouse icon on the hover. I have tried using fixed, absolute etc css position on the menu but it will not position...
7
2283
by: Priti | last post by:
<td align="center" bgcolor="#6699cc" onMouseOver="white4.bgColor='#ffffff'" onMouseOver="this.bgColor='#993300'" onMouseOut="this.bgColor='#6699cc'" onMouseOut="white4.bgColor='#6699cc'"> I am having a problem changing the color of 2 differnt table cells when mouseing over of 1cell. The issue is I want to change the bgcolor of my cell that I am mouseing over as well as an adjacent cell, but not the whole row. The script changes only one,...
7
1984
by: Trvl Orm | last post by:
I am working with 2 frames, Left and Right and the main code is in the left frame, which has been attached. Can someone please help me with this code. I am new to JavaScript and can't figure it out. What needs to happen is this: On the left frame you should have a series of buttons, which when pushed makes things happen on the right frame.
6
2332
by: Jimnbigd | last post by:
I want to write a game, and sounds will really add to it. Note that I would always make the sounds optional. I hate it when I go to a URL and unexpectedly get sounds or music. I have played with bgsound in IE, and found I can have simultaneous sounds using multiple bgsound tags. I have done a google search, and the only results I found were for "multiple sounds", and all of these really meant "consecutive sounds" -- one sound...
1
1418
by: Dot net work | last post by:
Like most people I guess, I'd like my ASP.NET app to work and look good under as many browsers as possible. I left all of my webform pages to the default ms_positioning grid style setting. Will my app be okay for NN and Opera for instance? Unfortunately, due to lack of disk space (fear really!), I have not installed these products and so don't know what my website looks like using them. -dnw.
5
1571
by: ramadeviirrigireddy | last post by:
Hi All, I'm new to this group. I'm working on Java/J2ee. In my project i have one bricklet with header it will have some default color.But when mouseovers on this header i need to change the backgorund color of the header. can anyone suggest me how to do it plz?
4
2408
by: Yohan N. Leder | last post by:
Hello all, I have a problem with an horizontal menu which is managed using HTML/CSS combination. All sounds right in most of the major Windows's browsers (not tried until now under Linux, will do after), but not using Netscape, Mozilla (not the FireFox one) and Opera. I've made a test page in which you can see the CSS code, snapshots in
0
9423
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10216
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
9997
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9865
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7413
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6675
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5448
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3965
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2815
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.