Controlling Shockwave and Flash Movies with Behaviors

Team-Fly    

Macromedia® DreamWeaver® MX Unleashed
By Matthew Pizzi, Zak Ruvalcaba
Table of Contents
Chapter 14.  Inserting Flash and Shockwave


Dreamweaver has built-in behaviors that enable you to control a Flash or a Director movie. You can create buttons that communicate directly with these files. To demonstrate this, I've set up a file that contains four pictures. What you're going to do in Dreamweaver is import four image files that look like buttons, each labeled picture1 through picture4.

After you insert the Flash movie into Dreamweaver, you can import each of the button graphics. You can then apply the behaviors to each of the button graphics, telling the Flash file to move to a specific frame that corresponds with the picture number.

To follow along in this exercise, visit the companion Web site located at http://www.dreamweavermxunleashed.com to download the file called slide_show.zip. Unzip the file, and you'll see a FLA file along with four GIF files.

Controlling a Flash with Behaviors

In this exercise, you'll control how a Flash movie plays.

  1. Create a new basic HTML document. Choose File, Save As and save it as slide.html.

  2. Under the Media tab of the Insert panel, click the Flash button to insert a Flash movie. Search for the slide_show.swf file you downloaded from the site.

  3. After the file is placed within the document, name the movie in the Properties Inspector. Name it Show.

  4. In the Properties Inspector, be sure to uncheck Autoplay and Loop.

  5. Next, insert the four images named pic1, pic2, pic3, and pic4.

  6. Make sure you highlight the image named Picture 4 in the document. You'll apply the behavior to this button first.

  7. Open the Behaviors panel by choosing Window, Behaviors.

  8. Click the plus (+) button to add a behavior, and in this case, choose the Control Flash or Shockwave behavior to open the dialog box.

  9. In the drop-down list, you'll see all the Flash or Shockwave movies in your document. Because you have only one, all you should see is Show, the Flash movie you named and inserted earlier.

  10. When the end user clicks this button, you want the movie to advance to the fourth frame. So highlight the Go To option and in the text field type in 4.

  11. Choose OK. After you return to the document, look in the Behaviors panel. Make sure the event is set to onClick. If that event is not available in the drop-down menu, choose Show Events For toward the bottom of the list. Be sure that 4.0 and Later Browsers is showing.

  12. Repeat steps 10 and 11 until all four buttons have behaviors.

  13. Back inside the document, choose File, Preview in Browser, Internet Explorer. Notice the slide show is being controlled by the buttons you've created in Dreamweaver.

In most real-world situations, you'll probably have the navigation system right within Flash or Director. However, if you want to create disjointed controls, this is one solution.


    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