beautypg.com

Using actionscript to play external flash video, Playing back external flv files dynamically – Adobe Flash Professional CS3 User Manual

Page 327

background image

FLASH CS3

User Guide

321

Both applications can be used to create original graphics and animation. Both use a timeline and offer scripting
capabilities for controlling animation programmatically. After Effects includes a larger set of effects, while the Flash
ActionScript™ language is the more robust of the two scripting environments.

Both applications allow you to place graphics on separate layers for compositing. These layers can be turned on and
off as needed. Both also allow you to apply effects to the contents of individual layers.

In Flash, composites do not affect the video content directly; they affect only the appearance of the video during
playback in Flash Player. In contrast, when you composite with imported video in After Effects, the video file you
export actually incorporates the composited graphics and effects.

Because all drawing and painting in After Effects is done on layers separate from any imported video, it is always
non-destructive. Flash has both destructive and non-destructive drawing modes.

Exporting After Effects content for use in Flash

You can export After Effects content for use in Flash. You can export a SWF file that can be played immediately in
Flash Player or used as part of another Flash project. When you export content from After Effects in SWF format,
the some of the content may be flattened and rasterized in the SWF file.

Importing Flash SWF files into After Effects

Flash has a unique set of vector art tools that make it useful for a variety of drawing not possible in After Effects or
Adobe Illustrator®. You can import SWF files into After Effects to composite them with other video or render them
as video with additional creative effects. When After Effects imports a SWF file, its internal keyframes are preserved
so that you can continue to use them for timing other effects.

Each SWF file imported into After Effects is flattened into a single continuously rasterized layer, with its alpha
channel preserved. Continuous rasterization means that graphics stay sharp as they are scaled up. This import
method allows you to use the root layer or object of your SWF files as a smoothly rendered element in After Effects,
allowing the best capabilities of each tool to work together.

Using ActionScript to play external Flash Video

Playing back external FLV files dynamically

An alternative to importing video into the Flash authoring environment it to use either the FLVPlayback component
or ActionScript to dynamically play external FLV files in Flash Player. You can play FLV files posted as HTTP
downloads or as local media files.

Create FLV files by importing video into the Flash authoring tool and exporting it as an FLV file. If you have
Macromedia Flash Professional 8 or Flash CS3 Professional, you can use the FLV Export plug-in to export FLV files
from supported video-editing applications.

To play back an external FLV file, post an FLV file to a URL (either an HTTP site or a local folder) and add either the
FLVPlayback component or ActionScript code to the Flash document to access the file and control playback during
runtime.

Using external FLV files provides the following capabilities that are not available when using imported video:

You can use longer video clips without slowing down playback. External FLV files are played using cached memory,
which means that large files are stored in small pieces and accessed dynamically; they do not require as much
memory as embedded video files.