This is Interesting: Free Magazines for Graphics designers and webmasters  


Home > Archive > Dreamweaver > October 2005 > Embedding Sound in a Rollover Button





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author Embedding Sound in a Rollover Button
bulletproof_monk

2005-10-08, 10:16 pm

How do I embed sound (i.e., CLICK) in a Rollover Button in Studio MX
Dreamweaver 6.1?

Ideally, that should be an additional choice in the create a rollover image
function.

Yes, there are different sound formats and players (RealPlayer, QuickTime,
WMF, etc.).

Isn't there a relatively simple way to embed an audio file in a rollover
button so when one clicks the button, one hears a sound? (That could be
whatever brief audio file that one wants -- click, etc.)

Please post your how-to answer in this forum for the benefit of all forum
folks.

Thanks!

NedTheDog

2005-10-09, 10:16 pm

Here is what I did i DW 6
I had a problem with this, too. Theoretically, you would select your button or
text and choose the menu Insert->Media->Plugin. I couldn't get it to work
properly. What I did (with text as the link to an mp3 sound file) was to 1.
Highlight the text 2. Browse to the link sound and the text (I suppose you
could point to the file if you want) 3. Then, in the behaviors panel, hold
down the + sign and choose "Check Plugin". Choose a player, like QuickTime. I
put the same link to the sound in both boxes. (If found go to & Otherwise go
to.) DW will generate this code in the head of your document.
<head>
<script language="JavaScript" type="text/JavaScript">
<!--
function MM_checkPlugin(plgIn, theURL, altURL, autoGo) { //v4.0
var ok=false; document.MM_returnValue = false;
with (navigator) if (appName.indexOf('Microsoft')==-1 || (plugins &&
plugins.length)) {
ok=(plugins && plugins[plgIn]);
} else if (appVersion.indexOf('3.1')==-1) { //not Netscape or Win3.1
if (plgIn.indexOf("Flash")!=-1 && window.MM_flash!=null)
ok=window.MM_flash;
else if (plgIn.indexOf("Director")!=-1 && window.MM_dir!=null)
ok=window.MM_dir;
else ok=autoGo; }
if (!ok) theURL=altURL; if (theURL) window.location=theURL;
}
//-->
</script>
</head>
(My folder is called "SteveSongs", the song is "Track One", and the sound
file is called "01track.mp3")
The link will look something like this;
<a href="/stevesongs/01track.mp3" onclick="MM_checkPlugin('QuickTime
Plug-In','SteveSongs/01track.mp3','SteveSongs/01track.mp3',false);return
document.MM_returnValue">Track One / QuickTime Plug-In</a>

NedTheDog

2005-10-09, 10:16 pm

I forgot - to add more players, click the + sign in the Behaviors Panel and repeat the process. If not listed, click the "Enter" radio button and type in the name of the player in the field.
bulletproof_monk

2005-10-10, 3:18 am

Thanks, Ned.

will review your advice and see how it works in my situation.

Another possible solution: Convert WAV file to MP3 format. Then, create
rollover button (sounds to buttons) in Flash. Finally, import Flash object into
Dreamweaver.

However, an easier way to do this would be to have an embed sound to button
line item in the set nav bar dialog box.

Will bring that up in and upcoming Macromedia on-line seminar later this week.

Go to the macromedia.com web site and sign up for the free on-line seminar
(read: sales presentation) on the new and improved Studio MX.

zarathustra_MX

2005-10-10, 3:18 am

I did it like this some time ago, but I only had to do it once, and never
really invested the time to see if it was the very best way. It worked fine
however, perhaps someone more knowledgable can review the process:

*IN THE HEAD*

<script language=javaScript>

function makesound(soundobj){
var thissound= eval("document."+soundobj)
thissound.play()
}

</script>
</head>

<body>
<EMBED SRC="duck.mp3" autostart=false HIDDEN=TRUE NAME="quack" MASTERSOUND>

*AND ON THE BUTTON:*

<td width="116" valign="top"><a href="index2.html"
onmouseover="makesound('quack')"><img src="images/typo03.gif" width="116"
height="32" border="0" /></a></td>

bulletproof_monk

2005-10-10, 6:21 am

Thanks for the Javascript rollover button w/sound solution.

Will review it and see if it works for me.

Thanks!


Sponsored Links


Copyright 2003 - 2008 forum4designers.com  Software forum  Computer Hardware reviews