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 | In Flash CS4 | How many | Holds | Form |
|---|---|---|---|---|
Contents | Contents | One | The document: scenes, library, media records, colours, frame rate, publish settings | MFC archive |
Page n | P n stamp | One per scene | The scene’s timeline | MFC archive |
Symbol n | S n stamp | One per symbol | The timeline of a movie clip, button or graphic symbol | MFC archive |
Media n | M n stamp | 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
Up to Flash CS3, each scene’s timeline is a stream named Page, a space and
a number: Page 1, Page 2 and so on, from 1. Flash CS4 names it
P, the number and a time stamp, as below. 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 or
Symbol 12, or in Flash CS4 S, a number and a time stamp. 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 or Media 13, or in Flash CS4 M, a number
and a time stamp. 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.
Flash CS4’s stream names
Flash CS4 names its timeline and media streams with a letter, the number and a time stamp, separated by spaces:
| Up to Flash CS3 | Flash CS4 |
|---|---|
Page 1 | P 1 1227523356 |
Symbol 75 | S 75 1328565261 |
Media 3 | M 3 … |
The time stamp is a Unix time in decimal: seconds since 1 January 1970.
1227523356 is 24 November 2008. Such names were seen in Flash CS4
documents (Contents revision 0x47) and in one Flash CS3 document
(0x43). They are written in Contents like any other stream
name, so a reader that follows Contents finds them. Whether Flash CS3 or
earlier can open a document named this way is not known; Flash CS4 documents cannot be
opened by CS3 in any case, and CS4 offers Save As CS3 for that.
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, the number of characters, followed by UTF-16LE, with no
marker. The display name is an MFC
string in its Unicode form,
which starts FF FE FF.
17 06 50 00 61 00 67 00 65 00 20 00 31 00 FF FE FF 07 53 00 63 00 65 00 6E 00 65 00 20 00 31 00
Contents stream of a Flash 8 document: the record’s revision 0x17, then the stream name Page 1 (6 characters, no marker) and the display name Scene 1 (marker, 7 characters)This unmarked stream name is the change that makes this a separate format. A reader
made for Flash MX and earlier reads the 06 as six single bytes,
P.a.g., and loses its place; the marked strings, by contrast, say what they
are. The directory of the compound file stores every stream name in UTF-16 in both
formats, as the container requires.
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).