Flash for Windows was written with Microsoft’s MFC library, and it saves its documents
the MFC way: each object writes its own fields into a CArchive, and MFC adds
tags that say which class each object belongs to. Every stream of an FLA except the Media
streams is such an archive. The class tags and strings below are MFC’s own scheme; the
records inside are Flash’s. All numbers are little-endian.
The start of a stream
A Contents, Page or Symbol stream starts with
one byte. In a timeline stream it is 01, and the root object, a
CPicPage, follows with its class tag. In Contents the first
byte is the document revision, and the document’s fields follow directly; see
The Contents stream.
Strings
Text is written in MFC’s CString archive form: a length, then the
characters. In this format the characters are single bytes in the Windows code page of
the computer that saved the document, usually Windows-1252 in Western Europe and the
Americas. The explorer decodes them as Windows-1252, so Japanese or Cyrillic documents
of this era show the wrong letters. The file does not record which code page that was:
the JPEXS FLA converter (jpexs-fla-convert,
reader/FlaReadOptions.java and Main.java, read 2026-11-13) takes
the single-byte charset as an option the user chooses (--charset), with
Windows-1252 as the default, and reads nothing from the document. Only a text run’s
own character set byte, on the objects
page, says anything about it. So the code page of a document’s other single-byte
strings stays Unknown.
| Length | Written as |
|---|---|
| 0 to 254 bytes | One byte, the length |
| 255 to 65,533 bytes | FF, then the length as a u16 |
| longer | FF FF FF, then the length as a u32 |
A Flash 5 frame script of 6,688 bytes, for example, starts FF 20 1A
(0x1A20 = 6,688), followed by the text. No terminating zero is written.
MFC also has a Unicode form, marked by FF FE FF before the length. It does
not occur in this format; it is what Flash MX 2004 and later write, in the
Flash MX 2004 to CS4 format.
Stream names inside Contents are written differently from CStrings:
one length byte, then the characters. See
Stream names and display
names.
Revisions
Flash’s records version themselves. Every record starts with its own revision byte,
and each release that changed a record raised its revision and added fields at the end.
A reader reads the revision first and then only the fields that revision has, so one
reader can read every release of this format. A scene record went from revision 3 in
Flash 1 to 0x11 in Flash MX, a frame record from 4 to 0x16.
The values of each release are on the Versions
page, and each record’s fields by revision on
Pages, layers and frames.
Flash rewrites only the streams that changed, so a timeline stream can be older than
the document around it. A reader should take each stream’s revisions from the stream
itself, starting with the byte after the class name CPicPage, not from the
document revision.
Classes
Every class a binary FLA is known to hold. Those marked “seen” were found in the Flash 3 to MX files examined for this site; the others are known from the JPEXS reader and from later releases. The schema number in the class tag is 1, except for the four classes marked 0.
| Class | Where | What it is |
|---|---|---|
CPicPage (seen) | timelines | A timeline, the root of a Page or Symbol stream: page. |
CPicLayer (seen) | timelines | A layer. |
CPicFrame (seen) | timelines | A keyframe, with the shape drawn on it, its sound, label and actions. |
CPicObj | timelines | The bare object part. |
CPicShape (seen) | timelines | A shape object; also the root of a stream that holds a bare shape. |
CPicMorphShape (seen), CMorphSegment, CMorphCurve, CMorphHintItem | timelines | A shape tween and its parts: morph shapes. |
CPicSymbol (seen) | timelines | A graphic symbol’s instance. |
CPicSprite (seen) | timelines | A movie clip instance. |
CPicButton (seen) | timelines | A button instance. |
CPicText (seen) | timelines | A text field. |
CPicBitmap (seen) | timelines | A bitmap on the stage: other objects, as are the next five. |
CPicVideoStream, CPicVideo | timelines | Embedded and linked video on the stage. |
CPicOle, CSketchCntrItem (schema 0) | timelines, Contents | An OLE object on the stage, and the embedded OLE item. |
CCommandObj | timelines | A Generator command object. |
CPicTempClipboardObj | timelines | A clipboard placeholder. |
CDocumentPage (seen) | Contents | A scene or symbol record. |
CMediaElem | Contents | The bare media record. |
CMediaBits (seen), CMediaSound (seen), CMediaVideoStream (seen), CMediaVideo | Contents | The media records of bitmaps, sounds, embedded and linked video. |
CColorDef (seen, schema 0) | Contents | A swatch. |
CColorList (schema 0) | Contents | A list of swatches, when written as an object. |
CObList (schema 0) | anywhere | MFC’s own list class: a count, then the objects. Older files keep shape hints in one. |
CQTAudioSettings | not established | QuickTime audio settings: a u32 byte count and that many bytes, not established. |
Classes that belong to later features, and were not found in this format’s files
(CPicRect, CPicOval,
CPicShapeObj, CPicScreen, CPicSwf,
CSwfPage, CPicFont, CPicSoundCreator,
CPicASObj, CPicThreeDObject, CPicTLFText) are
on the Flash MX 2004 to CS4
page. The class names are Flash’s own, as they appear in the files; Macromedia never
documented them. An unknown class stops a reader, since nothing says how long its
object is; the explorer reports where.
Worked example
The first 64 bytes of a symbol’s timeline stream in a Flash MX document:
00000000 01 FF FF 01 00 08 00 43 50 69 63 50 61 67 65 01 .......CPicPage.
00000010 00 FF FF 01 00 09 00 43 50 69 63 4C 61 79 65 72 .......CPicLayer
00000020 01 00 FF FF 01 00 09 00 43 50 69 63 46 72 61 6D ........CPicFram
00000030 65 01 00 FF FF 01 00 08 00 43 50 69 63 54 65 78 e........CPicTex
01– the stream’s first byte: the root object followsFF FF 01 00 08 00 "CPicPage"– a new class, schema 1, an 8-byte name (index 1; the page takes index 2)01 00– the page’s object part: revision 1, flags 0; its children followFF FF 01 00 09 00 "CPicLayer"– the first child, a layer of a new class (indexes 3 and 4)01 00– the layer’s object part: revision 1, flags 0; its children, the frames, followFF FF 01 00 09 00 "CPicFrame"– the layer’s first frame (indexes 5 and 6), then01 00FF FF 01 00 08 00 "CPicText"– the first thing on the stage in that frame, a text field
Only after the text field, the frame’s other children and the end tag
00 00 come the frame’s own fields, and after all the frames, the layer’s
name. See Pages, layers and
frames.