Introduction
This is the document format of Adobe Flash Professional CS5, from 2010, and of every
release since, up to Adobe
Animate. An .fla file holds the whole editable document: its scenes,
layers and keyframes, the vector shapes, the library of symbols, the imported bitmaps
and sounds, and the scripts. Publishing it makes a .swf
file, or with Animate’s other document types an HTML5 canvas or WebGL page.
The file is a ZIP archive. Its main member, DOMDocument.xml, describes
the document and the timeline of each scene. The LIBRARY/ folder holds one
XML file for each symbol, beside the files that were imported, and bin/
holds bitmaps in Flash’s own binary form and compiled clips. The XML is called XFL.
Earlier releases saved a binary compound file instead, with
single-byte or
UTF-16 text; those are separate formats, and
all the variations are on the FLA page.
Adobe never published a specification of XFL. What is known comes from reading the files, which are mostly plain XML, and from projects that read and write them, such as the JPEXS decompiler, its unofficial XML schema, and xfl2svg for the shapes. Each release added attributes and elements to the same XML, so every XFL document is one format here.
An .fla file dropped on any page opens in the explorer, which lists the
ZIP members, shows the bitmaps, and pulls out every script, each labelled with its scene
or symbol, layer and frame.
Structure
An XFL document is an ordinary ZIP archive. Members follow one another, each with a local file header, then the central directory lists them all, and the end record says where the central directory is. All numbers are little-endian.
0Members each a local file header (50 4B 03 04), then the data, stored or compressed with Deflatevaries…Central directory one record a member (50 4B 01 02), with its name, sizes, CRC and where its local header is46 bytes and the name, a member…End of central directory50 4B 05 06, the number of members and where the central directory starts22 bytes
The members
| Member | Holds |
|---|---|
DOMDocument.xml | The document: stage size, background colour, the library lists, and the timeline of each scene. |
LIBRARY/… | One XML file for each symbol, in the library’s folders, and imported files such as PNG and JPEG images as they were. |
bin/… | Bitmaps in Flash’s own form (.dat), compiled clips and components (.swf, .swc), and a symbol cache. |
PublishSettings.xml | The publish profiles: SWF file name, Flash Player version, ActionScript version, document class. |
META-INF/metadata.xml | XMP metadata: the program that made the document, its format and dates. |
MobileSettings.xml | Settings for mobile publishing; empty in the files seen. |
mimetype | application/vnd.adobe.xfl. |
name.xfl | Nine bytes, PROXY-CS5: the file that opens the unzipped form. |
How a timeline is stored
A scene’s timeline is a <DOMTimeline> element in
DOMDocument.xml; a symbol’s is the <timeline> of its
file in LIBRARY/. Both hold the same tree:
DOMTimeline a scene or a symbol’s timeline
layers
DOMLayer a layer: name, colour, type
frames
DOMFrame a keyframe: index, duration, label, tween
Actionscript the frame script, as text
elements what is on the stage in that frame:
DOMShape a shape: fills, strokes and edges
DOMSymbolInstance an instance of a library symbol
DOMBitmapInstance a bitmap
DOMStaticText a text field
Reference pages
- The ZIP container – local headers, central directory, end record, and the oddities seen in XFL archives
- Files in an XFL document – every member and folder, and what it holds
- DOMDocument.xml – the root element’s attributes and its lists of folders, media, symbols and timelines
- Timelines, layers and frames – the timeline elements, frame numbering, elements on the stage and tweens
- Shapes and edge encoding – fills, strokes and the compact edges string
- The library – symbol, bitmap, sound and other items, and ActionScript linkage
- Bitmaps in bin/ – JPEG and lossless bitmaps in Flash’s own form
- Publish settings – PublishSettings.xml’s profiles and Flash properties
- ActionScript in FLA – frame and instance scripts, classes, the document class and includes
- Versions – the
xflVersionof each release
The uncompressed form
Flash CS5 and later can also save a document uncompressed. The result is a folder holding the same members as files and folders:
DOMDocument.xml, LIBRARY/, bin/,
META-INF/, PublishSettings.xml, and a small file named after
the document with the extension .xfl, whose content is the nine bytes
PROXY-CS5. Flash opens the document through that file. The same
.xfl marker is also found inside the ZIP form.
The unzipped form suits version control, since each symbol is a separate text file. The explorer opens single files only, so it cannot open the folder; zipping the folder’s contents gives an archive the explorer can read.
Telling it apart
The explorer’s parser for this format checks, in order:
- The file starts with
50 4B 03 04, a ZIP local file header. - An end of central directory record (
50 4B 05 06) is found at the end of the file, and the central directory it points to can be read, record by record. ZIP64 archives are turned down; XFL documents are never that large. - The central directory lists a member named
DOMDocument.xml, and once inflated its root element is<DOMDocument>.
An ordinary ZIP archive, or another ZIP-based format such as a .docx,
.jar, .epub or .idml, has no
DOMDocument.xml and is turned down. The mimetype member is
not required: in the files seen it comes first in some and last in others, so it is
not a fixed signature as it is in EPUB.
Variants
- Flash MX and earlier document (binary FLA, single-byte text) – a compound file of Flash’s object streams, every string in single bytes (FutureSplash Animator to Flash MX)
- Flash MX 2004 to CS4 document (binary FLA, UTF-16 text) – the same compound file with UTF-16LE strings and stream names (Flash MX 2004 to Flash CS4)
- XFL document (Flash CS5 and later, ZIP) – a ZIP archive of XML files and binary assets (Flash CS5 to Adobe Animate)
Links
Software
- Adobe Animate – Adobe’s animation tool, formerly Flash Professional, which opens and saves XFL documents (Windows, macOS)
- JPEXS Free Flash Decompiler – free SWF decompiler that can export a SWF as an XFL document (Windows, macOS, Linux)
Developers
- jpexs-fla-convert – library that reads and writes XFL and binary FLA documents (Java)
- xfl-schema – an unofficial XML schema for XFL documents, from the JPEXS project (XSD)
- fla-viewer – viewer for XFL documents (TypeScript)
- xfl2svg – converts the shapes of XFL documents to SVG (Python)
Reference
- APPNOTE.TXT – PKWARE’s specification of the ZIP format, the container
- xfl2svg edge.py – xfl2svg’s reader for the edges string of XFL shapes (Python)