WEBSITE TEMPLATES       FLASH WEBSITES       FLASH INTROS   

Search Templates     
Flash Tutorials
& Resources
Dreamweaver
Tutorials
Fireworks Tutorials
& Resources
Photoshop
Tutorials
Web Design
Tutorials & Resources
Website Promotion
Tutorials
Website
Add Ons
You are here : : Home > Free Resources > Dreamweaver Tutorials > Play Sound  

 

Featured Fireworks & Dreamweaver Template

Interior Design Template 1
Interior Design
$59.95

Play Sound on Mouseover or MouseClick

Play sound, music on Rollover, on Click or on Page Load using Dreamweaver Behaviors

Sample: Click Here to Play Sound

Learn how to use Dreamweaver Behaviors to Play Sound in 2 quick steps

  1. The first step is to create a link for the sound to be played on Rollover or on Click. You can make a simple text link with the '#' symbol.
  2. The next step is to add a behavior to the link. Open the Behaviors panel by clicking on Windows/Behaviors and click on the '+' symbol in the Behaviors Panel. Click on 'Play Sound'. Browse to find the sound you want to play and click on OK.

Note: If you want the music to play on some other event, go back to the behaviors panel and in the events drop down menu choose another event e.g. If you want the music to play on Rollover then you have to choose onMouseOver

Javascript Code

<script language="JavaScript">
<!--
function MM_controlSound(x, _sndObj, sndFile) { //v3.0
var i, method = "", sndObj = eval(_sndObj);
if (sndObj != null) {
if (navigator.appName == 'Netscape') method = "play";
else {
if (window.MM_WMP == null) {
window.MM_WMP = false;
for(i in sndObj) if (i == "ActiveMovie") {
window.MM_WMP = true; break;
} }
if (window.MM_WMP) method = "play";
else if (sndObj.FileName) method = "run";
} }
if (method) eval(_sndObj+"."+method+"()");
else window.location = sndFile;
}
//-->
</script>

Dreamweaver also generates the following code that embeds the sound file within the page

<embed name='CS1022563046202' src='sound.wav' loop=false
autostart=false MASTERSOUND hidden=true width=0 height=0>
</embed>
This can be included towards the end of the page.

HTML Code

<a href="#" onClick="MM_controlSound('play','document.CS1022563046202','sound.wav')">Click
Here to Play Sound</a>
The above code is taken from Macromedia Dreamweaver 4.0

Note: Make sure a sound file called 'sound.wav' is included in your local folder.

Dreamweaver Interactive Video Tutorials - Discover Everything You Need To Know To Build Your Website Step By Step From Start To Finish With This Dreamweaver Tutorial.

Click Here for more Dreamweaver learning resources!

Dreamweaver Creative Suite 3. Design, develop, and maintain standard-based websites. Order Now!



Search
www.entheosweb.com

Template Number: 8199
Type: TEMPLATE
Price: $62

Enter your email id


Recommended Hosting

Home  |  Templates   |  Low Cost Solutions  |  Custom Services  |  Free Resources  |  Contact
Website Templates  |  Full  Flash Website Templates   |  Flash Intros  |  Logos & Corporate Identities  |  Swish Templates  |  Ecommerce Templates  |  CMS & Blog Templates
Copyright © 2004-2008 www.entheosweb.com - Entheos. All Rights Reserved.