• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

Chapter 12. Working with Video > Using Video with ActionScript Behaviors

Using Video with ActionScript Behaviors

Playing a video file inside a Flash movie is one thing, controlling the movie, or better yet, letting your visitor's control the movie is something quite different. Control of a movie requires knowledge of Flash's ActionScript language. ActionScripting is a control language that instructs Flash what to do, and when to do it. For example, you could create an ActionScript that instructs Flash to play or stop a movie, or you could add buttons to move the video backward or forward, one frame at a time. One way to display video in a Flash Movie is to drag it directly from the Library to the Timeline. Once the video is on the Timeline, ActionScripts can be created to start and stop the video. Since you're using the active document's Timeline to control the video, any other layers containing animation sequences on the Timeline will stop and start along with the video.

Control Video from the Timeline

Create a new layer to hold the video file, and then select the layer.

Drag the video file from the Library to the Stage.

Create a new layer to hold the navigation buttons, and then select the layer.

Drag a Play, Stop, and Rewind button into the Navigation layer, and then place them underneath the video.

Click the Window menu, point to Development Panels, and then click Actions.

Did You Know?

You can check the syntax of any script with the click of a button. Click the Check Syntax button, located at the top of the Actions panel, and Flash will check the syntax of the your script.


Select the Play button, and then enter the script as shown in the illustration.

Select the Stop button, and then enter the script as shown in the illustration.

Select the Rewind button, and then enter the script as shown in the illustration.

Click the Control menu, and then click Test Movie.

Flash tests the ActionScript.


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


  
  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint