A Page or Symbol stream holds one timeline as a tree of
objects in an MFC archive. The page is
the root; its children are the layers; each layer’s children are its keyframes; and each
keyframe’s children are what is on the stage in it. Every object writes its children
before its own fields, so a reader meets the deepest objects first, and a layer’s name
only after all of its frames.
The layouts here are those of the JPEXS FLA converter, which writes these records for every release. The fields the explorer reads were checked one by one against files from Flash MX 2004 to CS4. Every field is little-endian, and every field marked “from revision n” is present only when the record’s revision byte is at least n; the values of each release are on the Versions page.
The object part
Pages, layers, frames, shapes and instances all start with the same part, the
CPicObj fields:
| Field | Present | Meaning |
|---|---|---|
| u8 | always | The object part’s revision: 2 in Flash MX 2004, 4 in Flash 8, 5 in CS3 and CS4. |
| u8 | always | Flags. |
| objects | always | The children, each with its class tag, ended by 00 00. |
| s32, s32 | revision not 0 | The transformation point, x and y; 0x80000000 when not set. |
| u8 | from revision 3 | Not established. |
| u8 | from revision 4 | Cache as bitmap, the setting Flash 8 introduced. |
| ASCII text ending in 0 | from revision 6 | An identifier; not written by any release of this format. |
Page
The root of the stream, class CPicPage: the object part, whose children
are the layers, then:
| Field | Present | Meaning |
|---|---|---|
| u8 | always | The page record’s revision. |
| u16 | revision not 4 | The number the next new layer will get. |
| u16 | from revision 5 | The number the next new layer folder will get. |
| u32 | from revision 7 | The current frame, where the playhead was left. |
| u32, then that many pairs of u32 | from revision 3 | The guide points. |
Layer
Class CPicLayer: the object part, whose children are the layer’s
keyframes in order, then:
| Field | Present | Meaning |
|---|---|---|
| u8 | always | The layer record’s revision: 0x0B in Flash MX 2004, 8 and CS3, 0x0D in CS4. |
| CString | always | The layer’s name, such as Layer 1 or [actionscript]; in Unicode form, marked FF FE FF. |
| u8, u8, u8 | from revision 4 | The state as three flags: current, hidden, locked. (Revisions up to 3 had one state byte.) |
| u32 | from revision 5 | The layer’s height; FFFFFFFF seen. |
| u32 | from revision 6 | The outline colour: red, green and blue bytes, then FF. 4F 80 FF FF is #4F80FF. |
| u32 | from revision 6 | Whether the layer is shown as outlines. |
| u32 | from revision 8 | The height multiplier. |
| u8 | from revision 8 | The layer type. |
| object | from revision 8 | The parent layer, as an object reference. |
| … | Further fields by revision. |
The fields from the height multiplier on are as the JPEXS converter reads them.
Frame
Class CPicFrame: one keyframe and the frames it lasts for. It starts with
a shape part, because a frame is also the shape drawn directly on the stage in it:
| Field | Present | Meaning |
|---|---|---|
| object part | always | Its children are the instances, text fields and shapes on the stage. |
| u8 | always | The shape part’s revision. |
| 6 × u32 | always | A matrix. |
| … | always | The shape’s data. |
| u8 | always | The frame record’s revision: 0x17 in Flash MX 2004, 0x18 in Flash 8, 0x1A in CS3, 0x1D in CS4. |
| u16 | always | The duration, in frames. |
| u16 | always | The key mode. 0x0600 in the Flash 8 files seen; Flash CS4 writes 0x2600 (9,728), the same value XFL documents write as keyMode="9728". |
| u16 | from revision 2 | The easing of a tween. |
| u16 | from revision 5 | The sound: the number of a media item, 0 for none. |
| u16, then 8 bytes each | from revision 6 | The sound’s envelope points. |
| u16, u8, u32, u32 | from revision 7 | The sound’s loop count, sync mode, in point and out point; 0x3FFFFFFF is an unset out point. |
| u16 | from revision 8 | Zoom. |
| CString | from revision 9 | The frame label, empty for none. |
| block | from revision 19 | The ActionScript block, the frame’s script. (Revisions 4 to 18, in older releases, held action commands here.) |
| … | from revision 11 | Rotation (11), the label type (12), a morph shape object for shape tweens (13), and later fields: tweens, eases and, in Flash CS4, motion tween XML. |
The frame’s number is not stored. It is 1 plus the durations of the keyframes before it on the same layer.
A Flash 8 keyframe (frame revision 0x18) whose script is
stop(), from the Page 1 stream. The offsets are in the stream,
from the frame record’s revision:
0000024C 18 01 00 00 06 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0000025E FF FF FF 3F FF FF FF FE FF 00
00000268 04 00 00 00 01 00 00 00 84 67 00 00 00 00 00 00
00000278 FF FE FF 06 73 00 74 00 6F 00 70 00 28 00 29 00 ....s.t.o.p.(.).
stop()18– frame revision0x18: Flash 801 00– a duration of 1 frame;00 06– key mode0x0600- 6 zero bytes – no easing, no sound, no envelope points
- 3 zero bytes – loop count 0 and sync 0; then 4 zero bytes, the in point
FF FF FF 3F– out point not set;FF FF– zoomFF FE FF 00– the label: an empty Unicode CString04 00 00 00– ActionScript block revision 4;01 00 00 00– mode 1, text;84 67 00 00– the identifier;00 00 00 00– no breakpointsFF FE FF 06– a Unicode CString of 6 characters:stop()
Symbol instances
A symbol placed on the stage is a child of the frame it appears in. Every instance
starts the same way, as class CPicSymbol:
| Field | Meaning |
|---|---|
| object part | As above. |
| u8 | The instance record’s revision. |
| 6 × u32 | The matrix that places it on the stage. |
| u16 | The first frame to show. |
| … | By revision: the loop mode, the colour transform, the library item it is an instance of (a u32), and more. |
A graphic symbol’s instance ends there. Movie clip and button instances go on:
- A movie clip instance, class
CPicSprite: a u8 sprite revision, an ActionScript block holding its handlers, then the instance name, a CString. - A button instance, class
CPicButton: a u8 button revision, an ActionScript block holding itsonhandlers, a u8 for track as menu item, then the instance name, a CString.
The instance name is what ActionScript uses to refer to the instance. The explorer labels each instance’s handlers with that name and the timeline, layer and frame where the instance sits.