A Flash document is split into streams of four kinds, all directly in the root of the compound file. One holds the document as a whole and points to the others; each of the rest holds one timeline or one imported file.
| Stream | How many | Holds | Form |
|---|---|---|---|
Contents | One | The document: scenes, library, media records, colours, frame rate, publish settings | MFC archive |
Page n | One per scene | The scene’s timeline | MFC archive |
Symbol n | One per symbol | The timeline of a movie clip, button or graphic symbol | MFC archive |
Media n | One per imported bitmap or sound | The bitmap or sound data | Raw data |
Contents
Every Flash document has one Contents stream. Its first byte is the
document revision, which names the release that saved the file, and the rest is an
archive of the document’s settings and lists: the scenes in order, the library, a record
for each Media stream, the colours, the frame rate and the publish settings. It is the
only way to know which scene or symbol each timeline stream is, and what the user called
it. See The Contents stream.
Page streams
Each scene’s timeline is a stream named Page, a space and a number:
Page 1, Page 2 and so on. Flash numbers them from 1; files
written by the Trillix SWF-to-FLA decompiler start at Page 0. The stream is
an MFC archive holding one
CPicPage object and everything under it: the layers, their keyframes and
what is on the stage in each. See
Pages, layers and frames.
The scenes are listed in order in Contents, one record for each.
Symbol streams
Each symbol in the library that has a timeline of its own, a movie clip, a button or a
graphic, is a stream named Symbol and a number: Symbol 1,
Symbol 12. The stream has exactly the same form as a Page stream, a
CPicPage tree. The symbol’s name is kept in Contents, with the
rest of the library.
Media streams
Each imported bitmap or sound is a stream named Media and a number:
Media 1, Media 13. Unlike the others it is not an archive of
objects. A JPEG is kept whole, starting FF D8; other bitmaps are kept in
Flash’s own lossless form; sounds as PCM samples or MP3 frames. What the media is, and
the file it was imported from, are in its record in Contents. See
Bitmaps and sounds.
Stream names and display names
The name a user sees, such as “Scene 1” or “Ball”, is not the stream’s name. For each
scene, each symbol and each media item, Contents holds a record that gives
first the stream’s name and then the display name. In this format the stream name is
written as one length byte followed by single bytes, and the display name is an MFC
string, also single bytes. The
directory of the compound file still stores every stream name in UTF-16, as the
container requires.
0C 06 50 61 67 65 20 31 07 53 63 65 6E 65 20 31 ..Page 1.Scene 1
Contents stream of a Flash 5 document: the record’s revision 0x0C, then the stream name Page 1 (6 bytes) and the display name Scene 1 (7 bytes)To label a timeline, a reader takes each stream name from Contents, finds
the stream of that name in the directory, and uses the display name that follows. The
explorer labels every script this way, for example Scene 1 (Page 1).