Push

TODO: Document behavior with padding (most likely not allowed). Eg: 01 00000000 00 00 00 00 seems to cause a corrupted data error.

The Adobe documentation has an error. It indicates that Float64 (double) values are encoded using a Little-Endian representation when in fact it uses LE32_FLOAT64.

Abstract AS2

This corresponds to a sequence of @push(...); statements. One statement per value, in the same order.

Here are some examples:

// {
//   action: "push",
//   values: []
// }

// (Empty statement)
;
// {
//   action: "push",
//   values: [
//     {type: "null"},
//     {type: "string", value: "foo"},
//     {type: "boolean", value: true}
//   ]
// }

@push(null);
@push("foo");
@push(true);

Adobe documentation

ActionPush

ActionPush pushes one or more values to the stack.

Field Type Comment
ActionPush ACTIONRECORDHEADER ActionCode = 0x96
Type UI8

0 = string literal
1 = floating-point literal

The following types are available in SWF, 5 and later:
2 = null
3 = undefined
4 = register
5 = boolean
6 = double
7 = integer
8 = constant 8
9 = constant 16

String If Type = 0, STRING Null-terminated character string
Float If Type = 1, FLOAT 32-bit IEEE single-precision little-endian floating-point value
RegisterNumber If Type = 4, UI8 Register number
Boolean If Type = 5, UI8 Boolean value
Double If Type = 6, DOUBLE 64-bit IEEE double-precision little-endian double value
Integer If Type = 7, UI32 32-bit little-endian integer
Constant8 If Type = 8, UI8 Constant pool index (for indexes < 256) (see ActionConstantPool)
Constant16 If Type = 9, UI16 Constant pool index (for indexes >= 256) (see ActionConstantPool)

ActionPush pushes one or more values onto the stack. The Type field specifies the type of the value to be pushed.

If Type = 1, the value to be pushed is specified as a 32-bit IEEE single-precision little-endian floating-point value. PropertyIds are pushed as FLOATs. ActionGetProperty and ActionSetProperty use PropertyIds to access the properties of named objects.

If Type = 4, the value to be pushed is a register number. Flash Player supports up to 4 registers. With the use of ActionDefineFunction2, up to 256 registers can be used.

In the first field of ActionPush, the length in ACTIONRECORD defines the total number of Type and value bytes that follow the ACTIONRECORD itself. More than one set of Type and value fields may follow the first field, depending on the number of bytes that the length in ACTIONRECORD specifies. ActionPop