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 3 to Flash MX. 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: 1 in every release of this format. |
| 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. |
| ASCII text ending in 0 | from revision 6 | An identifier. |
The last three fields belong to later releases; in this format the object part is always revision 1 and ends after the transformation point.
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: 2 in Flash 1 and 2, 3 in Flash 3, 8 in Flash 4 and 5, 0x0A in Flash MX. |
| CString | always | The layer’s name, such as Layer 1 or Actions. |
| u8 | up to revision 3 | The state: 0 hidden, 1 locked, 2 normal, 3 current. |
| u8, u8, u8 | from revision 4 | The state as three flags: current, hidden, locked. |
| 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. In the example below the first and fourth words are 0x00010000 and the rest zero, which reads as the identity with 16.16 fixed-point scale. |
| … | always | The shape’s data. |
| u8 | always | The frame record’s revision. |
| u16 | always | The duration, in frames. |
| u16 | always | The key mode (a u8 up to revision 2). 0x0600 in the files seen here; Flash CS4 writes 0x2600. |
| 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. |
| actions | from revision 4 | Revisions 4 to 9: one action command. Revisions 10 to 18: a list of commands. Revision 19 and later: the ActionScript block. |
| … | from revision 11 | Rotation (11), the label type (12), a morph shape object for shape tweens (13), and later fields. |
The frame’s number is not stored. It is 1 plus the durations of the keyframes before it on the same layer.
A Flash MX keyframe (frame revision 0x16) with nothing on the stage and a
frame script, from the start of a symbol stream. The offsets are in the stream:
00000031 01 00 00 00 00 00 00 80 00 00 00 80
0000003D 02 00 00 01 00 00 00 00 00 00 00 00 00 00 00 01 00
0000004E 00 00 00 00 00 00 00 00
00000056 05 00 00 00 00 00 00 00 00 00 00 00 00 00
00000064 16 01 00 00 06 00 00 00 00 00 00 00 00 00 00 00 00 00
00000076 FF FF FF 3F FF FF 00
0000007D 01 00 00 00 01 00 00 00 BE 18 00 00 00 00 00 00 FF 20 1A 0A 2F 2F 2D 2D …
01 00,00 00– the object part: revision 1, flags 0, and no children (nothing on the stage)00 00 00 80 00 00 00 80– no transformation point02– the shape part’s revision, then the identity matrix (a and d are0x00010000) and 14 bytes of an empty shape16– frame revision0x16: Flash MX01 00– a duration of 1 frame;00 06– key mode0x0600- 13 zero bytes – no easing, no sound, no envelope points, loop count 0, sync 0, in point 0
FF FF FF 3F– out point not set;FF FF– zoom;00– an empty label- From
0x7D– the ActionScript block: revision 1, mode 1 (text), identifier0x18BE, no breakpoints, then a CString of 6,688 bytes (FF 20 1A) starting with a line feed and//----
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; from sprite revision 2, an ActionScript block holding itsonClipEventhandlers; then the instance name, a CString. - A button instance, class
CPicButton: a u8 button revision; its actions, which are one command at revision 2, a list of commands at revisions 3 and 4, and an ActionScript block holding itsonhandlers from revision 5; from revision 4 a u8, track as menu item; from revision 6 the instance name, a CString.
The explorer labels each instance’s handlers with the instance name and the timeline, layer and frame where the instance sits.