The Play Sound behavior is designed to attach a sound to your document to play hidden in the background. The browser will generally use the Netscape LiveAudio plug-in or Microsoft's Windows Media Player. To apply the Play Sound behavior, follow these steps. -
Highlight whichever object you want to trigger the behavior in the document. Typically the sound will play in the background and will start playing on load. If this is the desired effect, highlight the <body> tag in the Tag Inspector. -
In the Behaviors panel, click the Add Behavior (+) button and choose Play Sound from the drop-down menu. This opens the Play Sound dialog box, as pictured in Figure 19.15. Figure 19.15. In the Play Sound dialog box, you can enter the location of the sound you want to play. -
Press the Browse button and search for a file in one of the following file formats: WAV, MID, AU, and AIFF. -
After you've found the file, click OK. You will return to the document. -
Preview the document in a browser, and notice that after the page loads, the audio file starts playing in the background. Dreamweaver uses the <embed> tag, and if you look in the code, you'll notice some attributes are also applied. You can change these attributes to better serve your desired effect. The attributes are loop=false, autostart=false, mastersound, hidden=true, width=0, height=0. If you are a Mac user and you're using Internet Explorer, the sound may pop open in a new window for the QuickTime Player to play the sound. If you want to use this behavior, keep in mind that this will happen on occasion with the Mac. |