Flash Player 9 is now available, which means additions to the SWF file format. This page is dedicated to documenting the new things that have been added.
As a side note, the method used to document the format is Discovery through Observation which is perfectly legal.
Note: More accurate information on the ABC format has been released by Adobe through the open source Tamarin project. In addition, the official SWF and FLV File Format Specification is available under certain license terms.
The following tags have been added into the SWF9 format :
The following tags have been changed in the SWF9 format:
The AS3 tag content is completely different from previous AS2 one. In particular, the complete classes and methods types are included in the format, whereas AS1/AS2 was only opcodes needed to run the program.
The AS3 tag structure is composed of several lists of elements. The lists are either 0-based or 1-based.
n items.(n-1) items following.The AS3 Integer can be encoded into between 1 and 5 bytes.
(i & 0x7F) | 0×80(i » 7)(i & 0x7F) | 0×80(i » 7) | 0×80(i » 14)(i & 0x7F) | 0×80(i » 7) | 0×80(i » 14) | 0×80(i » 21)(i & 0x7F) | 0×80(i » 7) | 0×80(i » 14) | 0×80(i » 21) | 0×80(i » 28)The format is actually quite easy to read, since you read bytes until you get one that is lower than 128.
Here’s the structure of the AS3 tag :
\0 byte ???n AS3 static declarations : static tableThis is very similar to Java Bytecode structure. Several tables are declared, with everytime indexes into previously declared tables. For instance base-rights table will consists in indexes into the identifier table, and rights table of indexes into the base-rigths table.
Indexes into table can start either at 1 or 0, depending on the data structure. It is unrelated to the way the table is stored. Optional indexes are stored are either 0 (no binding) or (index + 1).
The meaning of each table is following.
32-bit integers used in the program
64-bit floating point values used in the program
strings are identifiers used in the program and class structure.
Each base-right is composed of the following data :
The byte can be one of the following :
The integer in the identifier table is the namespace associated with the rights
Each rights group is composed of the following data :
Each type starts with one byte the can be one of the following :
Each method type has the following datas :
The optional default parameters data consist of the following :
For instance if the method has 5 arguments and a default value for the second one, it will store “4” as the default values count, then the value itself followed by three 0.
to complete...
to complete...
to complete...
to complete...
to complete...
to complete...