Table of Contents

SWF 9 File Format

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.

Tags

The following tags have been added into the SWF9 format :

The following tags have been changed in the SWF9 format:

ActionScript 3

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.

AS3 structure

The AS3 tag structure is composed of several lists of elements. The lists are either 0-based or 1-based.

AS3 integer

The AS3 Integer can be encoded into between 1 and 5 bytes.

The format is actually quite easy to read, since you read bytes until you get one that is lower than 128.

Struture Details

Here’s the structure of the AS3 tag :

This 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.

integer table

32-bit integers used in the program

float table

64-bit floating point values used in the program

identifier table

strings are identifiers used in the program and class structure.

base-right table

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

rights group table

Each rights group is composed of the following data :

type table

Each type starts with one byte the can be one of the following :

method type table

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.

as3 value

to complete...

metadata table

to complete...

class table

to complete...

statics table

to complete...

initializers table

to complete...

function table

to complete...