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: 1 in Flash 3, 2 in Flash 4, 3 in Flash 5 and MX. |
| 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: the layer’s row is shown this many times the normal height. |
| u8 | always | The layer type, below. |
| object | always | The parent: the folder the layer is in, or the mask or guide layer it is masked or guided by, as an object reference; a null tag for none. |
| object | revisions 7 and 8 | A second layer reference, as the JPEXS reader names it a legacy parent. |
| u8 | revisions 2 to 5 | Not established; 0, 1 and 2 seen in Flash 3 files. |
| u8 | from revision 3 | Up to revision 8 a legacy mask flag (1 on some Flash 4 and 5 layers); from 9, whether a folder is open. |
| u8 | from revision 10 | Whether the name is the automatic one Flash gave it. |
| Layer type | Meaning |
|---|---|
| 0 | Normal. |
| 1 | Guide. |
| 2 | Guided (a layer drawn along a guide). |
| 3 | Folder (Flash MX). |
| 4 | Mask (seen from Flash MX). |
Types 0, 1 and 2 occur in Flash 3, 4 and 5 files; 3 and 4 only in Flash MX files, where layer folders were new. How Flash 4 and 5 mark a mask layer is not established beyond the legacy mask flag. Later releases add types 5 and 6 (see the Flash MX 2004 to CS4 page). The names are the JPEXS converter’s.
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, 6 × s32, data | always | The rest of the shape part: the shape drawn on the frame itself. In the example below the matrix’s first and fourth words are 0x00010000 and the rest zero, the identity. |
| u8 | always | The frame record’s revision: 4 in Flash 1, 8 in Flash 2, 0x10 in Flash 3, 0x12 in Flash 4, 0x15 in Flash 5, 0x16 in Flash MX. |
| u16 | always | The duration, in frames. |
| u16 | always | The key mode (a u8 up to revision 2). |
| u16 | from revision 2 | The easing of a tween. |
| u16 | from revision 5 | The sound: the media number of a sound record, 0 for none. |
| u16, then 8 bytes each | from revision 6 | The sound’s envelope points: a u32 position and a u16 level for each channel. |
| u16, u8, u32, u32 | from revision 7 | The sound’s loop count, sync, in point and out point; 0x3FFFFFFF is an unset out point. |
| u16 | from revision 8 | The sound editor’s zoom. |
| CString | from revision 9 | The frame label, empty for none. |
| actions | from revision 4 | Revisions 4 to 9: one action command. 10 to 18: a u32 count and that many commands. 19 on: the ActionScript block. |
| u32, u32 | from revision 11 | Motion tween rotation (below) and the number of turns. |
| u32 | from revision 12 | The label type: 0 a name, 1 a comment. |
| object | from revision 13 | The morph shape of a shape tween, or a null tag. |
| u32 | from revision 14 | Shape tween blend: 0 distributive, 1 angular. |
| object | from revision 15 | An object of sound settings, or a null tag. |
| CString | from revision 16 | Not established. |
| u16, 6 × s32, u8, colour transform, u8 | revision 17 only | A block not established, with a matrix and a colour transform. |
| u32 | from revision 20 | Not established. |
| u32 | from revision 21 | The sound effect. |
| u32 | from revision 22 | A bookmark flag, as the JPEXS reader names it; not established further. |
Flash MX’s revision 0x16 ends there. Later releases add custom eases,
the CS4 motion tween and armature poses (see the
Flash MX 2004 to CS4 page).
Key mode
The low byte is the tween kind: 0 none, 1 motion tween, 2 shape tween. The bits
above it are the tween’s settings: 0x0100 orient to path,
0x0200 scale, 0x0400 rotate, 0x0800 sync,
0x1000 snap. 0x0600 is the usual value of a frame with no
tween, and 0x1E01 of a motion tween; values such as 0x0301,
0x1F01 and 0x1301 also occur. No other bits are set in this
format’s files.
Sound and rotation codes
| Field | Values |
|---|---|
| Sync | 0 event, 1 start, 2 stop, 3 stream. |
| Effect | 0 none, 1 left channel, 2 right channel, 3 fade left to right, 4 fade right to left, 5 fade in, 6 fade out, 7 custom (the envelope). |
| Rotation | 0 auto, 1 clockwise, 2 counter-clockwise, as the JPEXS reader maps them. The panel’s “none” has no number of its own in that mapping; whether the key mode’s rotate bit is what stores it is not established. |
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: a
CPicSymbol for a graphic, CPicSprite for a movie clip and
CPicButton for a button. Their fields, with every other object on the
stage, are on the Objects on the stage
page. From Flash 5 a movie clip carries an
ActionScript block with
its onClipEvent handlers, and a button one with its on
handlers; earlier buttons hold action commands.
The explorer labels each instance’s handlers with the instance name and the timeline, layer and frame where the instance sits.