Render and export a composition as a SWF file



SWF files are small files that play in Flash Player. They are often used to deliver animated vector graphics (such as cartoons), audio, and other data types over the Internet. SWF files also allow viewer interaction, such as clicking to follow a web link, control animation, or provide input to a rich internet application (RIA). SWF files are the output created from FLA files.

While rendering and exporting a movie to a SWF file, After Effects maintains vector graphics as vector objects as much as possible. However, raster images, blending modes, motion blur, some effects, and the contents of nested compositions cannot be represented as vectors in the SWF file and are rasterized.

You can choose to ignore these unsupported items so that the SWF file includes only the After Effects features that can be converted into native SWF elements, or you can choose to rasterize frames that contain unsupported features and add them to the SWF file as JPEG-compressed bitmap images, which may reduce the efficiency of the SWF file.

Audio is encoded in MP3 format and added to the SWF file as an audio stream.

When After Effects creates a SWF file, it also saves a report ([SWFfile_name]R.htm) to the same folder as the SWF file. The report also contains a link to the SWF file so that you can preview the output using the Flash Player plug-in. Open the report in a browser to view the SWF file and see which items in the composition are unsupported.

The exported SWF file includes each unchanged item in the After Effects composition once, and then references it for each use. If a layer is used in multiple frames, each use refers to the same object, even if the layer’s transform properties (such as Position) are animated. However, if the content of the layer changes—for example, if a mask on the layer is animated or if the source footage item for the layer is video—a new object is created for each frame in which the layer is visible. If multiple layers in the composition share the same source footage item, the source is added once and is then referenced for every additional layer that shares the source. If the source is an Illustrator file, a SWF movie clip is created and referenced. Text characters are added as vectors once and then referenced on all subsequent frames, unless you choose Fill Over Stroke from the Fill And Stroke options menu; in that case, the characters are added as vectors on every frame.

Note: If color management is enabled for the project, then colors are converted from the working color space of the project to the sRGB IEC61966-2.1 color space for output. This output color space is appropriate for movies shown in a web browser. (See Color management.)
  1. Select the composition you want to export, and then choose File > Export > Adobe Flash Player (SWF).
  2. Enter a filename (making sure to include the .swf extension) and location, and then click Save.
  3. Specify options as appropriate, and then click OK.

Chris Jackson provides tips for rendering and exporting SWF files from After Effects in an excerpt from his book Flash + After Effects on the Focal Press website.

SWF export settings

JPEG Quality
Specifies the quality of rasterized images. The higher the quality, the larger the file. (If you select Rasterize for Unsupported Features, the JPEG Quality setting is used for all JPEG-compressed bitmap images exported to the SWF file, including bitmap images generated from composition frames or Adobe Illustrator files.)

Unsupported Features
Specifies whether to rasterize features that SWF format doesn’t support. Choose Ignore to exclude unsupported features, or choose Rasterize to render all frames that contain unsupported features as JPEG-compressed bitmap images and include them in the SWF file. If you choose Rasterize, the SWF exporter rasterizes source files for each layer in the composition (except layers that use Illustrator files or solids as the source footage) and nested compositions with Collapse Transformations enabled.

Audio Bit Rate
The bit rate of the exported audio. Choose Auto to get the lowest bit rate available for the specified Sample Rate and Channels settings. Higher bit rates increase file size. Audio in a SWF file is in MP3 format.

Loop Continuously
Specifies that the exported SWF file loops continuously during playback. If you plan to specify looping by writing HTML code to control Flash Player, deselect Loop Continuously.

Prevent Import
Creates a SWF file that digital image or video-editing programs can’t import.

Include Object Names
Includes layer, mask, and effect names in the file, for use as input to ActionScript programs. Selecting this option increases file size. Rasterized objects are not named.

Each mask is exported as a separate SWF object, the name of which is the layer name followed by the mask name. If all masks use Difference mode, all masks are exported as one SWF object, and the name is the layer name. Each text character is exported as a separate SWF object.

Flatten Illustrator Artwork
Splits all overlapping objects into non-overlapping pieces. When you select this option, you don’t need to convert Illustrator text to outlines before exporting. (This option supports source files from Illustrator 9.0 or later.)

Flattening Illustrator artwork has advantages and disadvantages. When you flatten Illustrator artwork, text is exported to SWF format properly, so you don’t need to convert text to outlines. Overlapping objects are removed, so composited layers appear the same in both After Effects and the SWF file. End caps, joins, and transparency groups are exported properly, and artwork outside crop marks, which is not visible in the SWF file, is not included. However, SWF files don’t necessarily become smaller. In addition, the flattening process may introduce unsupported objects that are then ignored or rasterized, and white fringes may appear around some objects. The process can be slow, memory-intensive, and possibly ineffective for complex Illustrator artwork.

Include Layer Marker Web Links
Makes layer markers behave as web links. The Include Layer Marker Web Links option adds web links and a Get URL action to the SWF file by using information from layer markers. This option also adds a frame label to each SWF frame that has a layer marker. You can specify how the browser opens the web link with standard target commands (for example, _blank). (See Web links, chapter links, cue points, and markers.)

Target commands for web links in a SWF file

_blank
Loads the web link into a new browser window.

_parent
Loads the web link into the parent frame of the frame in which the current file is playing.

_self
Loads the web link into the current frame.

_top
Loads the web link into the top frame in the current window.

_level0
Loads another SWF file into level 0. The current file typically plays at level 0; another file loaded into level 0 usually replaces the current file. The URL must refer to another SWF file.

_level1
Loads another SWF file into level 1 if the URL refers to another SWF file.

Supported features for SWF format export

Layers
After Effects text layers are exported to SWF format as vector graphics. The following layer types and layer switches aren’t supported: track mattes, 3D layers, 3D cameras, 3D lights, adjustment layers, shape layers, Preserve Transparency, Collapse Transformations, and motion blur. The Fill Over Stroke character option and the Blur animator property aren’t supported, and only Normal blending mode is supported. Nested compositions aren’t supported and are rasterized.

Masks
Only masks with Add mask mode or Difference mask mode are supported; multiple masks in a layer must use the same mask mode. If Add mode is specified, partial opacity and the Inverted option are also supported. Mask feather is not supported. The result of overlapping masks with Add mode and partial opacity may appear differently in the SWF file than in After Effects. (See Mask modes.)

Effects
Path Text, Audio Waveform, and Audio Spectrum are supported for output to SWF format.

All Path Text options are supported, except the following: Composite On Original, Fill Over Stroke, and Difference mode.

Lines drawn by the Audio Spectrum and Audio Waveform effects are converted to vectors. The following unsupported features are ignored: Outside Color (only Inside Color is used), Softness, and Composite On Original. In addition, only uniformly thick lines are included in the SWF file. For example, if you select the Use Polar Path option in Audio Spectrum, lines become thicker farther from the center in After Effects, but in the SWF file the lines remain at the same thickness.

The waveforms may increase the SWF file size, so decrease the Displayed Samples value in the Audio Waveform effect or the Frequency Bands value in the Audio Spectrum effect, or decrease the frame rate to make the SWF file smaller.

Resolution
SWF files are always created at full resolution (size of composition); JPEG-compressed bitmap images are rendered at full resolution.

Adobe Illustrator files
Only stroked paths and filled paths in CMYK or RGB color spaces are supported.

Layers that have Illustrator source files are converted to corresponding SWF items if the layer does not contain masks or have Collapse Transformations enabled. Illustrator layers that contain masks or have Collapse Transformations enabled are rasterized. The SWF file maintains the Illustrator crop marks. Artwork outside the crop marks is included in the SWF file even though it’s not visible, thereby increasing the file size.

The SWF export report lists information for unsupported features in Illustrator files for the first frame in which the Illustrator file is visible. Unsupported features are ignored or rasterized (depending on whether you’ve selected Ignore or Rasterize Unsupported Features) on all frames in which the footage is visible.