The Flash Video Import Wizard lets you import a video clip as a file that is streamed from a Flash server, progressively downloaded from a Web server, embedded (stored in movie) or linked (stored out of movie). It guides you through the steps for the specific deployment method. During the import process, you have the ability to compress the video using user-defined profiles, or preset values, set cue points, and trim excess video. It’s important to understand that although Flash can import a video file, it can’t make the quality of the video any better than the original. If you receive your video from outside sources, there is little you can do; however, if you’re the one shooting the footage, pay close attention to lighting, camera angles, and distractions within the video. The more time and attention you spend taking the video, the better the video will be when imported into Flash. If you do need to tweak a video file, video-editing applications such as Adobe’s Premiere (Mac/Win), and Apple’s Final Cut Pro (Mac) are excellent choice for the budding movie director.
If you have a video-editing application and Flash, you can create a movie against a blue screen and then mask the area out using alpha channel masks. They do this in the movies all the time. The process involves opening the image within a video-editing application, and creating the transparency using a specific color (referred to as blue or green screening), using luminosity levels, or actually creating a mask in an image-editing application such as, Adobe Photoshop, and then importing the mask. When you open the movie in Flash, any other background you place behind the movie will replace the original green screen.
Importing video into Flash is not much more difficult than importing a graphic or audio file. The Video Import Wizard is Flash’s way of helping you through the process of importing video files into Flash. When you import video, the Wizard lets you import a video clip as a file that is streamed from a Flash server, progressively downloaded from a Web server, embedded (stored in movie) or linked (stored out of the movie). It guides you through the steps for the specific deployment method. During the import process for some methods, you have the ability to compress the video using user-defined encoding profiles, set cue points, and trim excess video. You can choose to accept the Wizard’s recommendations or make changes. You can also attach movie playback controls with different looks, known as skins. The Wizard seamlessly uses the Skinning component to attach movie controls.
Click the File menu, point to Import, and then click Import Video.
• For the FLV format, use Import To Library since the file is native to Flash and doesn’t need to be encoded.
Flash saves the video in the active document’s Library.
Select a video file location option:
a. Click the On Your Computer option, click Browse to manually locate the video file.
Choose a video method from the following options:
i. Load external video with playback component.
ii. Embed FLV in SWF and play in timeline.
iii. Import as mobile device video bundled in SWF.
Click the Already deployed to a web server, Flash Video Steaming Service, or Flash Media Server option, and then enter in the file’s URL.
Click Next.
Options vary depending on the deployment method; select the ones you want.
• Skinning. Specify the appearance and position of the play controls.
• Embedding. Specify a symbol type, and other embedding options.
Click Next.
Click Finish.
Flash will automatically create an FLV component, and drop it into the active layer on the Timeline.
Click the Control menu, and then click Test Movie to view the video file as it will appear.
See “Working with the Video Encoder” on page 342 for information on Flash video encoding settings.
When you import video into a source document, Flash stores a copy of the video in the active document’s Library. Even if you import the video directly to the Stage, Flash will still place a copy in the Library. It’s always best to import video files first into the Library; that way you have control of the video and how it’s brought onto the Stage. Moving a video file directly to the Stage is the easiest way to incorporate video into a Flash movie. In fact, once the video file has been imported into Flash, it’s a simple drag and drop operation. However, video files should always be held within a separate layer. That gives you control over the display of the video and lets you place other Flash elements in other layers.
Open a Flash source document (.fla) that contains one or more video files in the Library.
To work directly with video files on the Timeline, you will have to Import them using the Embed video in SWF and play in Timeline (see Using the Video Import Wizard).
Click the Window menu, and then click Library to open the Library panel.
Click the Insert Layer button, and then name the new layer video_1.
Select the new layer.
Drag the video file from the Library onto the Stage.
Click Yes, if prompted to a dialog box indicating how many frames the video file will occupy on the Stage.
Click the Control menu, and then click Test Movie to view the video file as it will appear.
While placing a video file directly onto the Stage may be an easy way to bring a video file into a Flash movie, the best way to control video is to first place it into a movie clip, and then drag the movie clip onto the Stage. That gives you control of the clip with two Timelines: the Timeline on the Stage, and the Timeline of the movie clip.
Click the Window menu, and then click Library to open the Library panel.
Click the Insert menu, and then click New Symbol.
Name the new symbol, and then click the Movie Clip option.
Click OK.
Drag a video file from the Library into the movie clip Library.
Click Yes when Flash instructs you as to how many frames the video file will occupy in the movie clip.
Return to the current scene by clicking the Scene button, located in the upper-left corner of the Flash window.
Click the Insert Layer button, and name the new layer video_1.
Select the new layer.
Drag the movie clip from the Library onto the Stage.
The movie clip occupies a single frame.
Click the Control menu, and then click Test Movie to view the video file as it will appear.
Playing a video file inside a Flash movie is one thing, controlling the movie, or better yet, letting your visitors control the movie is something quite different. Control of a movie requires knowledge of Flash’s ActionScript language. ActionScript 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.
Create or open a Flash document, 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 the Play, Stop, and Rewind buttons into the Navigation layer from the Library, and then place them underneath the video.
Click the Window menu, and then click Actions to open the Actions panel.
To display scripting language commands for the scripting language you want to use, click the Language button, and then select the language you want.
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.
Do either of the following depending the your ActionScript version:
• ActionScript 2.0. select the Play, Stop, and Rewind buttons individually, and then enter the ActionScript 2.0 script as shown in the illustration.
• ActionScript 3.0. Click Frame 1 in a layer, and then enter the ActionScript 3.0 script as shown in the illustration.
ActionScript 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.
Click the Control menu, and then click Test Movie to test the ActionScript.
Although working with embedded video is a common practice, large video files can cause audio sync problems when the file is published and played. It’s always wise to thoroughly test your published documents.
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.
Create or open a Flash document, click the Insert button, and then click New Symbol.
Name the symbol, and then click 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.
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 Play, Stop, and Rewind buttons into the Navigation layer from the library, and then place them underneath the video.
Click the Window menu, and then click Actions.
To display scripting language commands for the scripting language you want to use, click the Language button, and then select the language you want.
Do either of the following depending the your ActionScript version:
• ActionScript 2.0. select the Play, Stop, and Rewind buttons individually, and then enter the ActionScript 2.0 script as shown in the illustration.
• ActionScript 3.0. Click Frame 1 in a layer, and then enter the ActionScript 3.0 script as shown in the illustration.
ActionScript 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.
Click the Control menu, and then click Test Movie to test the ActionScript.
Instead of importing video into Flash, you can also use the FLVPlayback components to dynamically play external FLV files in Flash Player. The FLVPlayback component is the display area (made up of a customizable skin with playback controls) in which you view video. Simply export your movie as an FLV file from Flash or a video editing programs using the FLV Export plug-in, and then use the FLVPlayback component in Flash to play it back. If you want to include closed captioning (W3C standard XML format Timed Text), you can use the FLVPlayback Captioning component
Create or open a Flash document.
Click the Window menu, and then click the Components and Component Inspector to open the panels.
Click the Video plus sign (+) to expand the list.
Drag the FLVPlayback component onto the Stage, and then select the component.
In the Component Inspector panel, click the Parameters tab.
Click the contentPath (2.0) or Source (3.0) value field, and then click the Magnifying Glass icon.
Click the Browse folder icon, navigate to and select the FLV video file that you want to use, and then click Open.
Click OK.
Select from the following FLVPlayback parameters:
• align (3.0). Specify FLV file alignment in the player.
• autoPlay. Specify True or False to automatically play the FLV file.
• autoRewind (2.0). Specify True or False to automatically rewind the FLV file upon completion.
• autoSize (2.0). Specify True or False to resize the component at runtime.
• bufferTime. Specify the number of seconds to buffer before beginning playback.
• cuePoints. Specify a string with the cue points for the video.
• isLive. Specify True or False whether the FLV is streaming live.
• preview (3.0). Creates a preview for authoring purposes.
• maintainAspectRatio (2.0) or scaleMode (3.0). Specify True or False to retain the source video aspect ratio.
• skin. Select a skin and color for the FLV video player.
• skinAutoHide. Specify True or False to automatically hide or show the skin.
• skinBackground Alpha (3.0). Specify a background alpha channel for the skin.
• skinBackgroundColor (3.0). Specify a background color for the skin.
• volume. Specify a volume setting for the video.
Click the Control menu, and then click Test Movie to test the video in the Flash player.
It seems obvious that you would want to keep Flash movies that contain video relatively small, in order to minimize the download time of the file. However, since Flash uses streaming technology (the file begins playing before it’s totally downloaded), it’s more important to think about the amount of time before the movie plays. For example, a Flash movie that might take three minutes to download may only take about fifteen seconds before it starts playing. That’s what streaming is all about. The Flash Media Player component (ActionScript 2.0) lets you load and control streaming media files in the FLV or MP3 formats into a Flash movie. The media components require Flash Player 6 or later and don’t support accessibility.
Create or open a Flash document (ActionScript 2.0).
Click the Window menu, and then click the Components and Component Inspector to open the panels.
Click the Media plus sign (+) to expand the list.
Drag the MediaPlayback component onto the Stage, and then select the component.
The MediaPlayback component (2.0) is a combination of the MediaDisplay and MediaController components. The combination provides the functionality to stream the video.
In the Component Inspector panel, click the Parameters tab.
Click the FLV option.
Enter the URL of the Flash movie file.
Select the Automatically Play check box to have the video automatically play when loaded.
Select the Use Preferred Media Size check box to display the video using the original file’s width and height.
Select the Respect Aspect Ratio check box to keep the video’s width and height in proportion.
Click the Top, Bottom, Left, or Right option for the placement of the control panel.
Click the Auto, On, or Off option to control when the control panel appears with the video.
Click the plus sign (+) button to add cue points to the video file, using hours, minutes, seconds, and milliseconds.
Click the Control menu, and then click Test Movie to test the video in the Flash player.
The Flash Media Controller component (ActionScript 2.0) lets you control a streaming media file that has been loaded using a Media Display component. The Media Display component gives you an easy way to create a placeholder for a video file, without any play, pause, or rewind buttons. The Media Controller component provides you with standard controls (play, pause, and rewind) for playback of any video on the screen. The Media Controller component is an excellent choice for controlling video and audio files placed on the screen using the Media Display component. The media components require Flash Player 6 or later and don’t support accessibility.
Create or open a Flash document (ActionScript 2.0).
Click the Window menu, and then click the Components and Component Inspector to open the panels.
Click the Media plus sign (+) to expand the list.
Drag the Media Display component onto the Stage, and then select the component.
In the Property Inspector, enter a unique instance name for the Display component.
You can use the Media components to give you control over precise placement of the controller. Drag the Media Controller on the Stage and place it anywhere you like. The advantage of the Media Controller is that you decide the placement of the controls in relationship to the player. This gives you a distinct design advantage over using the Media Player component.
In the Component Inspector panel, click the Parameters tab.
Click the FLV option.
Enter the URL of the Flash movie file.
Clear the Automatically Play check box to play the video when loaded.
Select the Use Preferred Media Size check box to display the video using the original file’s width and height.
Select the Respect Aspect Ratio check box to keep the video’s width and height in proportion.
Click the plus sign (+) button to add cue points to the video file, using hours, minutes, seconds, and milliseconds.
Drag the Media Controller component onto the Stage, and select the component.
In the Property Inspector, enter a unique instance name for the Controller component.
Click the Add Behavior button (+), in the Behaviors panel, point to Media, and then click Associate Display.
Select the instance name given to the Media Display component, and then click OK.
This associates the controller with the correct video.
Click the Control menu, and then click Test Movie to test the video in the Flash player.
Flash makes it easy to export a Flash document to a QuickTime video using the QuickTime Export Settings dialog box. By default, Flash creates a QuickTime video of the complete source document with the same dimensions. However, you can change the export options. In the QuickTime Export Settings dialog box, you can set movie dimensions, ignore stage color, specify when to stop exporting and where to store temporary data, and set advanced QuickTime settings. The advanced QuickTime settings are set for optimal playback. If you have experience using QuickTime, you can set the advanced settings to customize the results you want.
Click the File menu, point to Export, and then click Export Movie.
Click the Format popup (Mac) or Save As Type list arrow (Win), and then click QuickTime.
Type the new file name.
Navigate to the drive or folder location where you want to save the document.
Click Save.
The QuickTime Export Settings dialog box opens.
If available, specify the width and height in pixels you want for the QuickTime video.
• To maintain the same ratio of width and height, select the Maintain Aspect Ratio check box.
To create an alpha channel using the Stage color, select the Ignore Stage Color (Generate Alpha Channel) check box.
The alpha channel is encoded as a transparent track, letting you overlay the exported QuickTime movie on top of other content to alter the background color or scene.
Click the When Last Frame Is Reached or After Time Elapsed option and then specify the time you want in the format (hh:mm:ss.msec), where hh is hours, mm is minutes, ss is seconds, and msec is milli-seconds.
Click the In Memory or On Disk option to specify where you want to store temporary data.
Click QuickTime Settings.
Select the Video check box, and then click the buttons where you want to make video option changes.
• Settings. Select video compression type, quality, frame rate, and data rate.
• Filter. Select a video filter, such as blur, emboss, sharpen, and special effects.
• Size. Select a standardized size, such as NTSC, PAL, etc.
Select the Sound check box, and then click the buttons where you want to make audio option changes.
• Settings. Select sound compression, sample rate, sample bit size, and usage (mono or stereo).
To optimize for Internet streaming, select the Prepare For Internet Streaming check box, and then select the option you want.
Click OK.
Click Export.
Upon completion, click OK.
If you have QuickTime software developed by Apple Computer installed on your computer, you can publish a Flash document to Flash 5 or earlier as a QuickTime video in the same format you have installed. The Flash document plays in the QuickTime video the same as it does in the Flash Player. If the Flash document also contains a QuickTime video, Flash copies it to its own track in the published QuickTime video file. To publish a QuickTime video, you use the QuickTime tab in the Publish Settings dialog box, where you can set the options you want.
Click the Edit (Win) or Flash (Mac), click Preferences, click QuickTime, click Advanced Media Types, select the Enable the use of Flash Tracks check box, and then click OK twice.
Click the File menu, and then click Publish Settings.
Click the Formats tab.
Select the QuickTime with Flash Track (.mov) check box.
• If a warning appears, click OK. Click the Flash tab, click the Version popup, and then select Flash Player 5. However, this may change when a newer version of the QuickTime Player is released.
Click the QuickTime tab.
Select the Match Movie check box or specify the width and height in pixels you want for the QuickTime video.
Click the Alpha popup, and then select from the following options:
• Auto. Creates a transparent Flash track when it’s on top of any other tracks, or an opaque track when it’s at the bottom or the only track.
• Alpha-transparent. Creates a transparent Flash track SWF file and shows any content in tracks behind it.
• Copy. Creates an opaque Flash track and masks all content in tracks behind it.
Click the Layer popup, and then select from the following options:
• Auto. Puts the Flash track in front of other tracks when Flash objects are in front of video objects, or behind other tracks when Flash objects are not in front.
• Top. Puts the Flash track on top of all other tracks.
• Bottom. Puts the Flash track at the bottom behind all other tracks.
To stream the video/sound, select the Streaming sound check box.
If you select Streaming sound, click Settings, select sound compression, sample rate, sample bit size, and usage (mono or stereo), and then click OK.
Click the Controller popup menu, and then select the type of QuickTime controller you want to use to play the video: None, Standard, or QuickTime VR.
Select the playback options you want:
• Loop. Select to repeat the video when it reaches the last frame.
• Paused At Start. Select to pause the video at the start until the user clicks a button.
• Play Every Frame. Select to play every frame, which maintains time and does not play sound.
To combine the Flash content and imported video into a single QuickTime video, select Flatten (Make Self-Contained) check box.
Click OK.
To improve workflow for those of us who love to work with video, Adobe Media Encoder CS4 (New!) includes a stand-alone video encoder that you can install on a computer dedicated to video encoding. The Adobe Media Encoder CS4 lets you batch process video encoding, allowing you to encode several video clips, using different codecs at the same time. The Adobe Media Encoder CS4 also lets you edit video clips, add cue points (to trigger other actions), and crop (change viewable area of video) and trim (edit beginning and end points) the video.
Open the Adobe Media Encoder CS4.
• Use the Start menu (Win) or Applications folder (Mac).
• If you’re importing a video, click File, point to Import, click Import Video, and then click Launch Adobe Media Encoder.
Click Add to add video files to the batch list
• Click the File menu, and then click Add Adobe Premiere Pro Sequence or Add Adobe After Effects Composition to add these file types.
Click Duplicate to make a copy of the selected video file, which saves the same video file using different compression settings.
Click Remove to remove the selected video file from the batch list.
Select the video that you want to change settings.
Click the Format menu, and then select a format with which to encode the video or audio clip.
The selected format displays a list of available presets designed for the delivery format.
Click the Preset menu, and then select an encoding preset for your intended application.
Click the Output filename, specify a location and file name for the encoded file or use the default filename from the source clip.
Click the Edit menu, and then click Export Settings.
The Export Settings dialog box appears, displaying tabs for Source and Output.
Click the Advanced Mode button.
This button toggles between Simple Mode and Advanced Mode.
Click the Source tab.
Select the Export Video check box, click the Video tab, and then specify a frame rate, and other video options.
Select the Export Audio check box, c lick the Audio tab, and then select a kbps data rate, quality setting, and other options.
Click the Crop button, enter edge values to crop the video, and then drag the in and out point markers below the scrubber bar to set the video trim points.
Click the Output tab to preview the cropped image. Use the Crop Setting popup to select an option.
Use the cursor to move the playback head to the frame location you want to embed, click Add Cue Point, and then specify the type of cue point you want.
Click OK.
Click Start Queue to begin batch processing all the files in the batch list. Click Stop Queue to halt the process.
The status column provides information for each video during the encoding process.
One of the cool features in Flash is its ability to work alpha channel masks. Alpha masks are typically created within video-editing applications, such as Apple’s Final Cut Pro or Adobe’s Premiere. The process involves opening the image within the video-editing application and creating the transparency using a specific color (referred to as blue or green screening), using luminosity levels, or actually creating a mask in an image-editing application such as Adobe Photoshop, and then importing the mask. For example, you could film yourself against a green screen, and then mask those areas out. When you open the movie in Flash, any other background you place behind the movie will replace the original green screen. They do this in the movies all the time.
Open your video-editing application, and create a specific alpha channel mask.
The mask represents the areas of the movie for which you want to maintain transparency.
Use your video-editing Export command and then select the Flash FLV format.
Click Options or select options for exporting a Flash FLV file.
• If Options is not available, open the Adobe Media Encoder CS4 (from the desktop), add the FLV file to the queue select a FLV preset format, and then open the Export Settings dialog box. Click the Edit menu, and then click Export Settings.
The Export Settings dialog box appears, displaying tabs for Source and Output.
Click the Advanced Mode button.
This button toggles between Simple Mode and Advanced Mode.
Click the Source tab.
Select the Export Video check box.
Click the On2 VP6 option.
Select the Encode Alpha Channel check box.
Click OK.
Click Save to save the file.
Open Flash Professional.
Click the File menu, point to Import, and then click Import Video.
Use the steps outlined in “Using the Video Import Wizard” on page 324.
Move to the Timeline and create a new layer directly underneath the video layer, and name it backdrop.
Place an image in the backdrop layer.
Click the Control menu, and then click Test Movie to view the video file as it will appear.
When you view the movie, the areas designated as transparent by the alpha channel mask will display the contents of the backdrop layer, directly through the running video.
See “Using the Video Import Wizard” on page 324 for more information on using the Video wizard.
See “Working with the Video Encoder” on page 342 for information on Flash video encoding settings.
The FLV (Flash Video) file format allows you to import or export a static video stream including encoded audio. For example, you could use the FLV format to save video for use with communications applications, such as video conferencing. When an FLV clip is exported with streaming audio, the audio is compressed using the Streaming Audio settings in the Publish Settings dialog box, and the file is compressed. FLV files can be used with Flash’s new media components to create streaming video files directly in a Flash movie. In order to use the FLV format, you must first set up the video files for exporting. Any Flash document that contains video clips will work.
Select a video clip in the Library panel.
Click the Libraries Options button, and then click Properties.
Click Export.
Enter a name for the exported file.
Select a location where it will be saved.
Click Save.
Click OK.
You can use the Property Inspector to modify a Flash FLV video clip. Drag the FLV video file onto the Stage, select the video clip, and then open the Property Inspector. The Property Inspector lets you give the clip an instance name; change the width, height, and registration point of the clip; and even swap a video clip with another video clip.