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

Chapter 12. Working with Video > Controlling Video Through Movie Clips

Controlling Video Through Movie Clips

While it's an easy matter to drag a video file onto the Stage and then use start and stop ActionScripts to control the playing of the video, it's better to create a movie clip, and then load the video file into the clip. It's a bit more work, but the additional rewards are great. For example, you can instruct a movie clip to stop playing without affecting anything else on the Stage. As a matter of fact, you can have as many movie clips on the Stage as you want, and each one can be controlled individually. It's exactly that kind of control that leads to awesome Flash movies. To control a video using a movie clip you will need to have a flash document that contains one or more video files, in the Library.

Control Video Through Movie Clips

Click the Insert button, and then click New Symbol.

Name the symbol, and then select the Movie Clip option.

Click OK.

Drag a video file from your Library into the movie clip symbol.

Click the Scene button, to return to the Stage of the active scene.

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

Drag the movie clip to the Stage, and then select the clip.

Enter a unique Instance name in the Property Inspector.

IMPORTANT The Instance name you enter will be used in the ActionScript to identify the movie clip to the button object "with (instance name)".

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.

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.

IMPORTANT ActionScripting is a relatively easy language to learn, but it is also a very unforgiving language. For example, the gotoAndStop script must be written exactly as shown, including the capital "A" and "S". While ActionScripting, remember to keep an eye on syntax.


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


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