These tags say something about the whole movie: where it ends, its colour, its flags, its metadata, which characters it shares with other movies and which classes its symbols belong to. Each table gives the body, after the record header. A character ID is a UI16. Strings are UTF-8, ending with a zero byte.
End (0)
No body: the record header 00 00. It ends the movie’s tag run, and the
tag run inside each DefineSprite.
Bytes after the movie’s End tag are ignored by players.
SetBackgroundColor (9)
| Offset | Size | Type | Name | Meaning |
|---|---|---|---|---|
| 0 | 3 | RGB | BackgroundColor | The colour of the stage |
Only the main timeline’s counts. 43 02 FF FF FF sets white.
FileAttributes (69, SWF 8)
Four bytes of flags for the whole movie. From SWF 8 it should be the first tag. A movie without it still plays; the explorer notes when it is missing or not first. The flags are read most significant bit first:
| Bits | Type | Name | Meaning |
|---|---|---|---|
| 0 | UB[1] | Reserved | 0 |
| 1 | UB[1] | UseDirectBlit | Use hardware acceleration to draw to the screen (Flash Player 10) |
| 2 | UB[1] | UseGPU | Use the graphics processor to composite (Flash Player 10) |
| 3 | UB[1] | HasMetadata | The movie has a Metadata tag |
| 4 | UB[1] | ActionScript3 | The movie’s code is ActionScript 3 in DoABC tags, run by the AVM2 (SWF 9) |
| 5–6 | UB[2] | Reserved | 0 |
| 7 | UB[1] | UseNetwork | For a local file: give it network access, but not local file access |
| 8–31 | UB[24] | Reserved | 0 |
As values of the first byte: 0x01 UseNetwork, 0x08 ActionScript3, 0x10 HasMetadata, 0x20 UseGPU, 0x40 UseDirectBlit. JPEXS gives names to the reserved bits 0x02 and 0x04 (relative URLs and no cross-domain caching); those are not confirmed here.
The ActionScript3 flag decides the virtual machine: with it set, the player runs the ABC code and ignores DoAction and DoInitAction tags; without it, it runs AVM1 actions. UseNetwork decides a local file’s sandbox: network only, or local files only.
Metadata (77)
| Offset | Size | Type | Name | Meaning |
|---|---|---|---|---|
| 0 | to the end | STRING | Metadata | XMP: RDF/XML in UTF-8 |
Usually Dublin Core and XMP properties written by the authoring tool. The specification lists it as SWF 1, but it appears with Flash 8 and FileAttributes’ HasMetadata flag. The explorer shows the XML as text.
SymbolClass (76, SWF 9)
| Offset | Size | Type | Name | Meaning |
|---|---|---|---|---|
| 0 | 2 | UI16 | NumSymbols | The number of entries |
| 2 | 2 each | UI16 | Tag | A character ID; 0 is the main timeline |
| … | varies | STRING | Name | The fully qualified ActionScript 3 class name |
Each entry is a Tag and a Name, NumSymbols times. It links library symbols to ActionScript 3 classes: the player makes an instance of the class whenever it creates that character. The class for character 0 is the movie’s document class. The classes themselves are in the DoABC tags.
ExportAssets (56, SWF 5)
| Offset | Size | Type | Name | Meaning |
|---|---|---|---|---|
| 0 | 2 | UI16 | Count | The number of entries |
| 2 | 2 each | UI16 | Tag | A character ID |
| … | varies | STRING | Name | The name it is exported under |
Gives characters names that other movies can import and ActionScript can use, as in
attachMovie("name", …). The name is the symbol’s “linkage identifier” in
the authoring tool. An ActionScript 2.0 class is compiled into a sprite exported as
__Packages. followed by the class name, with its code in a
DoInitAction tag; see ActionScript in
SWF.
ImportAssets (57, SWF 5)
| Offset | Size | Type | Name | Meaning |
|---|---|---|---|---|
| 0 | varies | STRING | URL | The movie to import from |
| … | 2 | UI16 | Count | The number of entries |
| … | 2 each | UI16 | Tag | The ID this movie gives the imported character |
| … | varies | STRING | Name | Its export name in the other movie |
Replaced by ImportAssets2 in SWF 8.
ImportAssets2 (71, SWF 8)
| Offset | Size | Type | Name | Meaning |
|---|---|---|---|---|
| 0 | varies | STRING | URL | The movie to import from |
| … | 1 | UI8 | Reserved | Must be 1 |
| … | 1 | UI8 | Reserved | Must be 0 |
| … | 2 | UI16 | Count | The number of entries |
| … | 2 each | UI16 | Tag | The ID this movie gives the imported character |
| … | varies | STRING | Name | Its export name in the other movie |
Protect (24, SWF 2)
Asks authoring tools not to import the movie. The body is empty, or, when a password is set (Flash 5 and later):
| Offset | Size | Type | Name | Meaning |
|---|---|---|---|---|
| 0 | 2 | UI16 | Reserved | 0 |
| 2 | varies | STRING | Password | An MD5 crypt hash of the password |
It does not stop decompilers, which ignore it.
EnableDebugger (58, SWF 5)
| Offset | Size | Type | Name | Meaning |
|---|---|---|---|---|
| 0 | varies | STRING | Password | An MD5 crypt hash of the debugging password |
Lets a debugger connect. A SWF 6 and later movie uses EnableDebugger2 instead.
EnableDebugger2 (64, SWF 6)
| Offset | Size | Type | Name | Meaning |
|---|---|---|---|---|
| 0 | 2 | UI16 | Reserved | 0 |
| 2 | varies | STRING | Password | An MD5 crypt hash of the debugging password |
DebugID (63, not in the specification)
| Offset | Size | Type | Name | Meaning |
|---|---|---|---|---|
| 0 | 16 | UI8[16] | UUID | Matches the movie to its .swd debugging file |
The Flash authoring tool writes the .swd file beside a movie published
for debugging.
ScriptLimits (65, SWF 7)
| Offset | Size | Type | Name | Meaning |
|---|---|---|---|---|
| 0 | 2 | UI16 | MaxRecursionDepth | The deepest call stack allowed; 256 by default |
| 2 | 2 | UI16 | ScriptTimeoutSeconds | How long a script may run before the player offers to stop it; the default is 15 to 20 seconds, by platform |
SetTabIndex (66, SWF 7)
| Offset | Size | Type | Name | Meaning |
|---|---|---|---|---|
| 0 | 2 | UI16 | Depth | The depth of the object |
| 2 | 2 | UI16 | TabIndex | Its place in the tab order |
DefineBinaryData (87, SWF 9)
| Offset | Size | Type | Name | Meaning |
|---|---|---|---|---|
| 0 | 2 | UI16 | Tag | The character ID |
| 2 | 4 | UI32 | Reserved | 0 |
| 6 | to the end | bytes | Data | Any data |
A blob of data linked to an ActionScript 3 class with SymbolClass. Flex writes one for
[Embed(source="…", mimeType="application/octet-stream")].
EnableTelemetry (93, SWF 19)
| Offset | Size | Type | Name | Meaning |
|---|---|---|---|---|
| 0 | 2 | UI16 | Reserved | 0 |
| 2 | 32 | UI8[32] | PasswordHash | Optional: the SHA-256 hash of a password |
Allows advanced telemetry, read by Adobe Scout, a profiler.
ProductInfo (41, not in the specification)
Written by the Flex compiler, mxmlc. The layout below is from JPEXS
and the Flex SDK’s sources as remembered; it is not in the specification.
| Offset | Size | Type | Name | Meaning |
|---|---|---|---|---|
| 0 | 4 | UI32 | ProductId | 0 unknown, 1 Macromedia Flex for J2EE, 2 Macromedia Flex for .NET, 3 Adobe Flex |
| 4 | 4 | UI32 | Edition | 0 Developer, 1 Full commercial, 2 Non-commercial, 3 Educational, 4 Not for resale, 5 Trial, 6 None |
| 8 | 1 | UI8 | MajorVersion | The compiler’s major version |
| 9 | 1 | UI8 | MinorVersion | The compiler’s minor version |
| 10 | 4 | UI32 | BuildLow | The build number, low half |
| 14 | 4 | UI32 | BuildHigh | The build number, high half |
| 18 | 8 | UI64 | CompilationDate | Milliseconds since 1 January 1970, UTC |
A real one, from a Flex debug build of SWF 14, fits this layout:
00000219 5A 0A 03 00 00 00 06 00 00 00 04 06 A1 5A 00 00
00000229 00 00 00 00 60 E2 E9 11 36 01 00 00