Flash File Format Description
SWF File Header
Field
Type
Comment
Signature
8 bits
Signature byte:
F indicates uncompressed
C indicates compressed (specific to SWF6 and later)
Signature
8 bits
Represents W
Signature
8 bits
Represents S
Version
8 bits
Represents the SWF file version, e.g. 0x06 represents SWF6
File Length
32 bits
The total number of bytes occupied by the entire file
Frame Size
RECT structure
The size of the SWF stage, in units of 1 twip (1/20 pixel)
Frame Rate
16 bits
Frame Count
16 bits
The total number of frames in the movie
The file header begins with three signature bytes, which are either 0x46, 0x57, 0x53 (“FWS”) or 0x46, 0x57, 0x43 (“CWS”). An FWS signature indicates that the file is uncompressed. A CWS signature indicates that the entire file, after the first eight bytes — that is, after the file length field — is compressed using the open standard ZLIB. It uses the ZLIB library data format, which is described in the Request for Comments (RFCs) 1950 through 1952 documents. CWS is only permitted in SWF6 and later.
The byte following the signature is the version number. This version number is not an ASCII character, but an 8-bit number. For example, the version number of an SWF4 file is 0x04, not the ASCII character “4” (0x35).