Play Sound

Team-Fly    

Macromedia® DreamWeaver® MX Unleashed
By Matthew Pizzi, Zak Ruvalcaba
Table of Contents
Chapter 19.  Behaviors


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.

  1. 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.

  2. 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.

    graphics/19fig15.jpg

  3. Press the Browse button and search for a file in one of the following file formats: WAV, MID, AU, and AIFF.

  4. After you've found the file, click OK. You will return to the document.

  5. 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.


    Team-Fly    
    Top


    Macromedia Dreamweaver MX Unleashed
    Macromedia Dreamweaver MX 2004 Unleashed
    ISBN: 0672326310
    EAN: 2147483647
    Year: 2002
    Pages: 321

    flylib.com © 2008-2017.
    If you may any questions please contact us: flylib@qtcs.net