Controlling media components by using behaviors

Behaviors are prewritten ActionScript scripts that you add to an instance, such as a MediaDisplay component, to control that object. Behaviors let you add the power, control, and flexibility of ActionScript coding to your document without having to create the ActionScript code yourself.

To control a media component with a behavior, you use the Behaviors panel to apply the behavior to a given media component instance. You specify the event that triggers the behavior (such as reaching a specified cue point), select a target object (the media components that are affected by the behavior), and, if necessary, select settings for the behavior (such as the movie clip within the media to navigate to).

The following behaviors are packaged with Flash and are used to control embedded media components.

Behavior

Purpose

Parameters

Associate Controller

Associates a MediaController component with a MediaDisplay component

Instance name of target MediaController components

Associate Display

Associates a MediaDisplay component with a MediaController component

Instance name of target MediaController components

Labeled Frame CuePoint Navigation

Places an action on a MediaDisplay or MediaPlayback instance that tells an indicated movie clip to navigate to a frame with the same name as a given cue point

Name of frame and name of cue point (the names should be equal)

Slide CuePoint Navigation

Makes a slide-based Flash document navigate to a slide with the same name as a given cue point

Name of slide and name of cue point (the names should be equal)

To associate a MediaDisplay component with a MediaController component:

  1. Confirm that your Publish Settings specify ActionScript 2.0.
  2. Place a MediaDisplay instance and a MediaController instance on the Stage.
  3. Select the MediaDisplay instance and, using the Property inspector, enter the instance name myMediaDisplay.
  4. Select the MediaController instance that will trigger the behavior.
  5. In the Behaviors panel, click the Add (+) button and select Media > Associate Display.
  6. In the Associate Display window, select myMediaDisplay under _root and click OK.

    NOTE

     

    If you have associated the MediaDisplay component with the MediaController component, you do not need to associate the MediaController component with the MediaDisplay component.

To associate a MediaController component with a MediaDisplay component:

  1. Confirm that your Publish Settings specify ActionScript 2.0.
  2. Place a MediaDisplay instance and a MediaController instance on the Stage.
  3. Select the MediaController instance and, using the Property inspector, enter the instance name myMediaController.
  4. Select the MediaDisplay instance that will trigger the behavior.
  5. In the Behaviors panel, click the Add (+) button and select Media > Associate Controller.
  6. In the Associate Controller window, select myMediaController under _root and click OK.

To use a Labeled Frame CuePoint Navigation behavior:

  1. Confirm that your Publish Settings specify ActionScript 2.0.
  2. Place a MediaDisplay or MediaPlayback component instance on the Stage.
  3. Select the desired frame that you want the media to navigate to and, using the Property inspector, enter the frame name myLabeledFrame.
  4. Select your MediaDisplay or MediaPlayback instance.
  5. In the Component inspector, click the Add (+) button and enter the cue point time in the format HH:MM:SS:mmm or HH:MM:SS:FF, and give the cue point the name myLabeledFrame.

    The cue point indicates the amount of time that should elapse before you navigate to the selected frame. For example, if you want to jump to myLabeledFrame 5 seconds into the media, enter 5 in the SS text box and enter myLabeledFrame in the Name text box.

  6. In the Behaviors panel, click the Add (+) button and select Media > Labeled Frame CuePoint Navigation.
  7. In the Labeled Frame CuePoint Navigation window, select the _root clip and click OK.

To use a Slide CuePoint Navigation behavior:

  1. Open an existing Flash slide presentation. (Flash CS3 doesn't support the creation of new presentation FLA files.)
  2. Place a MediaDisplay or MediaPlayback component instance on the Stage.
  3. In the Screen Outline pane to the left of the Stage, click the Insert Screen (+) button to add a second slide; then select the second slide and rename it mySlide.
  4. Select your MediaDisplay or MediaController instance.
  5. In the Component inspector, click the Add (+) button and enter the cue point time in the format HH:MM:SS:mmm or HH:MM:SS:FF, and give the cue point the name MySlide.

    The cue point indicates the amount of time that should elapse before you navigate to the selected slide. For example, if you want to jump to mySlide 5 seconds into the media, enter 5 in the SS text box and enter mySlide in the Name text box.

  6. In the Behaviors panel, click the Add (+) button and select Media > Slide CuePoint Navigation.
  7. In the Slide CuePoint Navigation window, select Presentation under the _root clip and click OK.

Flash CS3