Flash CS3 Documentation |
|||
| ActionScript 2.0 Components Language Reference > Media components > Using media components > 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) |
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. |
myMediaController under _root and click OK.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.
_root clip and click OK.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.
Presentation under the _root clip and click OK.Flash CS3