|
|
Export a composition as an XFL file to Flash ProfessionalYou can export a composition from After Effects to the XFL format for further modification and use in Flash Professional CS4. For example, you can use ActionScript in Flash Professional to add interactive animation to each of the layers from an After Effects composition. When you export a composition as an XFL file, After Effects attempts to export individual layers and keyframes, preserving as much information for direct use in Flash Professional as it can. If After Effects can’t export an element of a composition as unrendered data in an XFL file, the element is either ignored or rendered into a PNG or FLV item, depending on whether you choose to ignore unsupported features. For a video tutorial on exporting to XFL format, go to the Adobe website at www.adobe.com/go/lrvid4098_xp. About XFL filesXFL files are essentially the XML equivalent of FLA files. An XFL file is a compressed archive folder that contains a Library folder and an XML document (DOMDocument.xml) that describes the FLA file. The Library folder contains the assets referred to by the XML file. When you open an XFL file in Flash Professional, it extracts these items from the XFL file and uses them to build a FLA document. You save the document from Flash Professional as a new FLA file; you do not change the XFL file with Flash Professional. If you want to examine or manually edit the contents
of an XFL file, you can open the compressed archive file in the
same manner as any other .zip file. Changing the filename extension
to .zip is not necessary, but it may make extracting the files for
this manual examination more convenient.Exporting a composition to XFL format
As the composition is being processed, a dialog box shows the progress of the export operation. When After Effects creates an XFL file, it also saves a report ([XFLfile_name] report.html) to the same folder as the XFL file. The report indicates the following:
Working in Flash Professional with a FLA document created from an XFL fileThe Library panel in Flash Professional is similar to the Project panel in After Effects. When Flash Professional creates a FLA document from an XFL file, it creates symbols, folders, and video clips and organizes them in the Library panel. Each item in the Library panel has a unique name—even if they are based on items with identical names in After Effects—so that these items can be manipulated using ActionScript. This requirement for unique naming causes After Effects to append underscore characters and numerals to many names when creating the XFL file. When Flash Professional builds a FLA document from an XFL file that includes FLV files, the FLV files are embedded in the timeline in Flash. Often, a more efficient way to construct a FLA document is to move the video files to an external location referenced by the SWF file to stream the video. You can unembed FLV files as appropriate within Flash Professional, by deleting the video and importing it again using the FLVPlayback component. Note: In After Effects, the composition’s timeline begins at frame
0. In Flash Professional, the timeline begins at frame 1. This difference
causes the After Effects composition timeline and the corresponding
Flash timeline to appear to be offset from one another by one frame.
In After Effects, a composition can have pixel aspect ratios other than 1.0 (square pixels). Flash Professional only supports a pixel aspect ratio of 1.0. When a composition is exported to XFL format, the FLA document is a square-pixel document with a different number of pixels so that the appearance of the document in Flash Professional matches the appearance of the composition in After Effects. Scale values in the XFL file preserve the appearance of the layers. How features and data are preserved when exporting a composition to XFL formatWhen a composition is exported as an XFL file, After Effects goes through multiple stages, attempting at each stage to export the maximum amount of information from layers and their source files. If the composition uses PNG, JPEG, and FLV files as the sources
for its layers, these source files are included in the XFL output
(passed through) unless the layers use features that
force After Effects to transcode the source files or rasterize the
layers for export to XFL.
Note: Transcoding is the conversion of
a source file from one format to another format, such as from GIF
to PNG. Rasterizing is the conversion of a layer to a bitmap image,
incorporating all of the model information—such as vectors and keyframes—into
a flattened, pixel-based image for each frame.
Stage 1: Source files are passed through unchanged, if possible.For a layer’s source file to be passed through to the XFL file, the layer must meet these requirements:
Stage 2: Remaining source files are converted to PNG sequences or FLV files, if possible.If the only reason that a layer’s source file can’t be passed through to the XFL file is that it doesn’t use a PNG sequence, JPEG sequence, or FLV file as its source, then the layer’s source is transcoded or rasterized to a PNG sequence or FLV file, which is included in the XFL file. In this case, the layer’s Position, Opacity, Scale, and Rotation keyframes are preserved and converted to keyframes in the XFL output. If multiple layers use the same source in After Effects and meet all of the other pass-through requirements listed above, they will also share a common source in the document created in Flash Professional. Precompositions can be rasterized as source items. The XFL file created from a composition preserves the animation information for the layers in the composition. Keyframes for the Position, Opacity, Scale, and Rotation properties are converted to keyframes in Flash Professional, with one keyframe per frame for each animated property. Only 2D Position (x and y) keyframes and 2D (z) Rotation keyframes are converted. In After Effects, the Anchor Point property can be animated, but the transformation point in Flash Professional can’t be animated. In Flash Professional, the transformation point is located at the top-left corner of the symbol. Keyframe animations of transform properties (including Anchor Point) in After Effects are converted to animations based around the transformation center in the exported XFL file. Stage 3: Remaining layers are rasterized as individual layers, if possible.If a layer doesn’t meet the requirements for its source file to be passed through, transcoded, or rasterized as a source item, then the layer itself must be rasterized as a layer. Rasterizing a layer means that all of its keyframe information is lost—all of the information is contained in the rasterized image frames themselves. To be rasterized as an individual layer, a layer must meet these requirements:
Stage 4: Remaining layers are rendered and rasterized together in bins.If a layer doesn’t meet the requirements for rasterization to an individual layer, then it is rendered and rasterized together with other layers in a group (bin). Bins of layers that are rasterized together are generally 3D layers, layers that are composited together with blending modes, track mattes, and layers affected by an adjustment layer. Limitations of exporting a composition to XFL formatWhen Flash Professional opens an XFL file, it must load all of the assets into memory. After Effects warns you when you export a composition for which the assets will consume more than 580 MB. Similarly, After Effects warns you if the amount of time that an XFL file will take to open in Flash Professional is very large because the number of frames in a PNG sequence is greater than 1,050. You can still export a composition to XFL format if it exceeds these limits, but you may not be able to open the XFL file with Flash Professional. To prevent the long load times related to sequences
with a large number of PNG files, consider pre-rendering layers
based on PNG sequences to FLV format.After Effects relies on the embedded version of the Adobe Media Encoder to create FLV files. The Adobe Media Encoder can’t create FLV files with pixel dimensions greater than 1920x1080. When you export a composition to the XFL format from a 32-bpc project, the rendering of colors with values under 0 and over 1 does not produce results that preserve the appearance of the composition in After Effects. You should only work in an 8-bpc or 16-bpc project when creating a composition that you intend to export to Flash Professional in XFL format. Audio is not exported to the XFL file. |