The Contents stream is the document itself: which release saved it, the
scenes in order, the library, a record for every imported bitmap and sound, the colours,
the frame rate and the publish settings. The timelines are in their own streams, and
Contents is what names them. It is an
MFC archive, little-endian, with
single-byte strings.
The layout below follows the JPEXS FLA converter, which writes these streams. The start of the stream, the scene records, the media records and the publish settings were checked against real files; the order of the later fields was not.
Document revision
The first byte of the stream is the document revision. It names the release that last saved the document, and it is how the explorer tells this format from the Flash MX 2004 to CS4 one.
| Revision | Release |
|---|---|
0x10 | FutureSplash Animator and Flash 1 (from the JPEXS converter; not seen in a file) |
0x11 | Flash 2 (from the JPEXS converter; not seen in a file) |
0x14 | Flash 3 |
0x1B | Flash 4 |
0x20 | Flash 5 |
0x29 | Flash MX |
Fields that later releases added to Contents are present when the
revision is at least the value given below.
Layout
| Field | Present from | Meaning |
|---|---|---|
| u8 | always | The document revision. |
| u32 | 0x20 | 1 in the Flash 5 and Flash MX files seen; meaning not established. |
| u32 | always | The number of embedded OLE items; 0 in every file seen. |
| u8 | 0x14 | Not established. |
| u8 | 0x15 | Not established. |
| 4 bytes | 0x21 | Not established. |
| objects | always | The scenes, one CDocumentPage each, in order, ended by 00 00. |
| … | Then, in JPEXS’s order: the next scene number, the library (from 0x0E), the media records (from 0x11), the grid, the print settings, the background colour (from 0x0B), the frame rate as a 16.16 fixed-point number (from 0x0D), the publish settings (from 0x13), the colour swatches, the library folders, the fonts and more. |
20 01 00 00 00 00 00 00 00 00 00 FF FF 01 00 0D 00 43 44 6F 63 75 6D 65 6E 74 50 61 67 65
0C 06 50 61 67 65 20 31 07 53 63 65 6E 65 20 31 …
Contents stream of a Flash 5 document20– document revision0x20: Flash 501 00 00 00– the u32 present from revision0x20: 100 00 00 00– no embedded OLE items00 00– the two bytes present from0x14and0x15; Flash 5 is below0x21, so the 4 bytes of that revision are absentFF FF 01 00 0D 00 "CDocumentPage"– the first scene, an object of a new class0C– the scene record’s revision,0x0C06 "Page 1"– the stream that holds the scene’s timeline07 "Scene 1"– the scene’s name, a CString
Scene records
Each scene is a CDocumentPage object:
| Field | Meaning |
|---|---|
| u8 revision | 3 in Flash 1 and 2, 4 in Flash 3, 8 in Flash 4, 0x0C in Flash 5, 0x11 in Flash MX. |
| Stream name | A length byte, then single bytes: Page 1, the name of the stream holding the scene’s timeline. |
| Display name | A CString: the scene’s name as the user sees it, Scene 1. |
| … | Further fields by revision. |
Revisions 4, 8, 0x0C and 0x11 were seen in files; revision 3 is
from the JPEXS converter.
Media records
Each Media stream has a record in Contents, of class
CMediaBits for a bitmap. It has the same start as a scene record, then
the file the media was imported from:
| Field | Meaning |
|---|---|
| u8 revision | The record’s revision. |
| Stream name | A length byte, then single bytes: Media 13. |
| Display name | A CString: the item’s name in the library. |
| Source path | A CString: the path of the imported file, such as .\b\020000.gif. |
| … | Further fields: for sounds, the sample rate and format. |
For a sound, the rate is given as a tag; Ed Moore’s notes give 0x0A for
22,050 Hz, 0x0E for 44,100 Hz and 0x0F for 44,100 Hz stereo.
The media data itself is described in Bitmaps
and sounds.
Publish settings
The settings of the Publish Settings dialog are kept as pairs of CStrings, a key and a
value, both as text. The key names a group and a setting, joined by
::.
| Key | Example value | Meaning |
|---|---|---|
PublishFormatProperties::flashFileName | mixer.swf | The name of the SWF file to publish. |
Vector::Version | 6 | The Flash Player version the SWF is made for. |
Vector::… | The other settings of the Flash tab, such as compression and protection. |
The explorer lists every pair it finds in a Publish settings table, and shows the SWF’s name and the target Flash Player version in its Document section.