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

Importing Video

As with sound and artwork, you must import video files into your Flash movie before you can use them. When you import a video file, it is added to your current movie's library. You can then use instances of the same video file throughout your movie. In the next exercise you will import some video into a movie clip. You will then add that movie clip to the main timeline.

Choose File > New From Template. In the New Document dialog box, select Flash TFS from the Category list, make sure the Zoo Template is selected, and click Create.

You're going to make a new file, based on the template you created in Lesson 5.

Select the Contents layer and import feature.swf from the Lesson06/Assets folder on the CD-ROM that comes with this book.

To import the file, choose File > Import and in the Import dialog box browse to the Lesson06/Assets folder. Select feature.swf, and click Open. The feature.swf file contains text and graphics. You can use your drawing skills to recreate the contents of this file. Just use the figure above as a guide.

Create a new, empty movie clip named Video Clip.

You are going to place the video you import into this movie clip. To create the movie clip, choose Insert > New Symbol, or press Ctrl+F8 (Windows) or Command+F8 (Macintosh). When the Symbol Properties dialog box opens, set the Name to Video Clip and the Behavior to Movie Clip. Then click OK, and Flash opens the new symbol in symbol-editing mode.

Choose File > Import. When the Import dialog box opens, browse to the Lesson06/ Assets folder, and import seals.mov. When the Import Video dialog box opens, choose “Embed video in Macromedia Flash document” and click OK.

When you attempt to import a QuickTime movie into Flash, you have the option of embedding the movie in the Flash document, or linking to the external video file. If you choose to link to the external file, the video will only be visible when you export the Flash movie as a QuickTime file.

With QuickTime 4 installed, Flash can import Audio Video Interleaved (AVI), Digital Video (DV), Motion Picture Experts Group (MPEG), and QuickTime Movie (MOV) file formats in both Windows and on a Macintosh. On a Windows computer with DirectX 7 or higher installed, you can import Windows Media File (WMV or ASF), AVI, and MPEG file formats. You can also import Macromedia Flash Video format (FLV) directly into Flash in Windows and on a Macintosh. FLV files are created when you export a video clip from Flash.

Flash imports and exports video using the Sorenson Spark codec, which is an algorithm that controls how multimedia files are compressed and decompressed. Additional video codecs, may be supported on your system. If you try to import a file that is not supported on your system, Flash will display a warning message.


If for some reason you are unable to import seals.mov, try to import seals.flv from the Lesson06/Assets folder. The file is saved in Macromedia Flash Video format, and you should be able to import it regardless of your system's setup. If you import seals.flv, you can skip to step 7 in this exercise.

In the Import Video Settings dialog box, set the Quality to 75, Keyframe interval to 24, and Scale to 100%.

When you attempt to import most video files, the Import Video Settings dialog box should open.

The Quality setting specifies the level of compression for the video. A smaller value in this setting will import the video at a lower quality and higher compression; a higher setting will import the video at a higher quality and lower compression (larger file size). You can set this value by dragging the slider, or typing a number between 0 and 100 in the space provided.

The Keyframe interval controls the frequency of keyframes in the video clip. A video keyframe is a frame that contains complete data, while the frames between store only the data that changes from the preceding frame. A keyframe interval of 24 will store a keyframe every 24 frames in the video clip. Smaller intervals store more complete frames, resulting in a larger file size. Drag the slider to modify this setting, or type a number between 0 and 48 in the Keyframe interval box.


Video keyframes don't necessarily correspond to Flash keyframes.

The Scale setting modifies the video's pixel size. You can set the Scale as low as 1% and as high as 100%. You can't use the Scale setting to make the video larger than its original size. A smaller pixel size reduces the file size of the imported video clip. Drag the slider to set the Scale, or type a number between 1 and 100 in the Scale box.

Make sure the “Synchronize video to Macromedia Flash document frame rate” option is checked, and deselect the Import Audio option. Leave the Number of video frames to encode per number of Macromedia Flash frames setting at 1:1.

The Synchronize video to Macromedia Flash document frame rate setting, when selected, lets you match the speed of the imported video clip to the speed of the Flash movie. So if the frame rate of your Flash movie is set to 12 frames per second (fps) the imported video clip will also play at 12 fps.

When the Import Audio setting is selected, Flash imports the video clip's audio track. If you leave Import Audio selected, and import the audio track, the file size will increase. If the audio codec used in the audio track is not installed on your system, you will not be able to import it. Flash will display a warning telling you so; you can then import the video without sound, or modify the original video file so it uses an audio codec supported on your system.

The Number of video frames to encode per number of Macromedia Flash frames setting specifies the ratio of imported video frames to Flash frames. The default setting is 1:1, which will encode one video frame per Flash frame. If you change the setting to 1:2, one imported video frame will be encoded for every two Flash frames which can result in choppier playback.

When you click OK, a message should appear asking if you'd like to expand the timeline to fit the frames of the video clip. Click Yes, otherwise only the first frame of the video will appear in the finished file.

The video clip will be imported. Flash should expand the timeline to fit the frames of the video clip.

Choose Edit > Edit Document to return to the main timeline. Select the Contents layer and add an instance of the Video Clip symbol to the stage. Use the Property inspector to set the X and Y of this instance to 321 and 196, respectively.


You can also return to the main timeline by clicking the Scene 1 icon.

You should be able to locate the Video Clip movie clip symbol in the Library (Window > Library). Select the Contents layer and drag an instance of the movie clip onto the stage. With the Video Clip movie clip instance selected, use the Property inspector to position it precisely on the stage.

Choose Control > Test Movie.

When you test the movie, you should see that the video clip, which is inside the Video Clip symbol, plays as part of the Flash movie. Notice that when the video reaches the end, it loops back to its first frame and plays again. If you'd like to make the movie stop at the last frame, you can simply add a keyframe in the last frame and add a stop action.

Save the file as feature1.fla in the FlashTFS folder on your hard drive.

You now have some sound and video in your project. In Lesson 12, you will learn more about working with sound and video.



Not a subscriber?

Start A Free Trial

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