Made to Order Software Corporation Logo

more

Wait For Frame (dynamic)

SWF Action
Action Category: 
Movie
Action Details: 
(dynamic)
Action Identifier: 
141
Action Structure: 
unsigned char    f_skip;
Action Length: 
1 byte(s)
Action Stack: 
pop 1 (a)
Action Operation: 
a1 := pop();
if(_root.get_frame() >= a1) {
  // execute f_skip bytes of instructions
  ...
}
else {
  // ignore f_skip bytes of instructions
  pc += f_skip;
}
Action Flash Version: 
4

Pop a value or a string used as the frame number or name to wait for. The frame can be specified as with the Goto Expression. If the frame was not reached yet, skip the following f_skip actions.

WARNING

Push Data

SWF Action
Action Category: 
Stack
Action Details: 
0
Action Identifier: 
150
Action Structure: 
struct {
	unsigned char   f_type
	<type>          f_data
} f_push_data[<variable>];
Action Length: 
-1 byte(s)
Action Stack: 
push <variable> (a)
Action Operation: 
a1 = f_data[0];1
push(a1);
a2 = f_data[1];
push(a2);
a3 = f_data[2];
push(a3);
...
an = f_data[n];
push(an);
  • 1. Notice that the first data in the action is the last accessible on your stack.
Action Flash Version: 
4
See Also: 

Push some immediate data on the stack. This action was introduced in V4.0. The supported data types vary depending on the version of the player you have. As many values as necessary can be pushed at once. The f_push_data structure will be repeated multiple times as required. For instance, to push two strings on the stack at once, you would use the following code:

Instance Of

SWF Action
Action Category: 
Objects
Action Details: 
0
Action Identifier: 
84
Action Structure: 
<n.a.>
Action Length: 
0 byte(s)
Action Stack: 
pop 1 (s), pop 1 (o)
Action Operation: 
s1 := pop();
o2 := pop();
r := o2 instance of s1;
push(r);
Action Flash Version: 
6

Pop the name of a constructor (s1 - ie. "Color") then an object (o2). Checks whether the object is part of the class defined by the named constructor. If so, then true is push on the stack, otherwise false.

Since SWF version 7, it is possible to cast an object to another using the Cast Object action. This action returns a copy of the object or Null, which in many cases can be much more practical.

Implements

SWF Action
Action Category: 
Objects
Action Details: 
0
Action Identifier: 
44
Action Structure: 
<n.a.>
Action Length: 
0 byte(s)
Action Stack: 
pop 1 (o), pop 1 (i), pop i2 (o)
Action Operation: 
o1 := pop();
i2 := pop();
for (idx := 3; idx <= i2 + 2; ++idx) {
  oidx := pop();
}
o1 implements o3, o4, o5, ... , o(i2 +2)
Action Flash Version: 
7

This action declares an object as a sub-class of one or more interfaces. The syntax here is simple, the real implementation is quite unbelievably difficult to fathom.

The following shows you how you can add an implements of interfaces "A" and "B" to the class "C". Notice that class "C" needs to already exist. Here we assume that all classes are defined in the global scope.

	push data "_global"
	get variable
	push data "A"
	get member
	push data "_global"
	get variable
	push data "B"
	get ...

Get URL2

SWF Action
Action Category: 
Movie
Action Details: 
0
Action Identifier: 
154
Action Structure: 
unsigned char    f_method;
Action Length: 
1 byte(s)
Action Stack: 
pop 2 (s)
Action Operation: 
s1 := pop();
s2 := pop();
s1.load(s2, f_method);
Action Flash Version: 
4

Pop two strings, the URL (s2) and the target name (s1).

All the usual HTML target names seem to be supported (_top, _blank, <frame name>, etc.) You can also use the special internal names _level0 to _level10. _level0 is the current movie. Other levels, I'm still not too sure how these can be used.

Sprite Properties

The following is the list of currently accepted properties or fields for the Get Property and the Set Property actions. Note that the properties can be specified with either an integer (type 7, requires V5.0+) or a single precision floating point (type 1, V4.0 compatible). And since strings are automatically transformed in a value when required, one can use a string to represent the property number (type 0).

Duplicate Sprite

SWF Action
Action Category: 
Movie
Action Details: 
0
Action Identifier: 
36
Action Structure: 
<n.a.>
Action Length: 
0 byte(s)
Action Stack: 
pop 1 (i), pop 2 (s)
Action Operation: 
i1 := pop();
s2 := pop();
s3 := pop();
duplicate_sprite(s3, s2, i1);
Action Flash Version: 
4

s3 is the name of an existing sprite1 which is copied by this action.

The new sprite is given  the name s2 and is placed at depth i1.

  • 1. Remember that a sprite, movie, thread and other terms that I forget, are all the same thing.

Chr (multi-byte)

SWF Action
Action Category: 
String and Characters
Action Details: 
(multi-byte)
Action Identifier: 
55
Action Structure: 
<n.a.>
Action Length: 
0 byte(s)
Action Stack: 
pop 1 (i), push 1 (s)
Action Operation: 
i1 := pop();
r := mbchr(i1);
push(r);
Action Flash Version: 
4
See Also: 

Pop one integer, use it as a multi-byte string character code and push the newly created string on the stack.

The integer can be any number from 0 to 65535, although many codes are not valid characters.

For more information about valid characters, please, check out the Unicode Consortium.

DefineScalingGrid

Tag Info
Tag Number: 
78
Tag Type: 
Define
Tag Flash Version: 
8
Brief Description: 

Define scale factors for a window, a button, or other similar objects.

Tag Structure: 
struct swf_definescalinggrid {
	swf_tag				f_tag;		/* 78 */
	unsigned short			f_button_id_ref;
	swf_rect			f_rect;
};

This definition is used so the scaling factors applied on an object affects only the center of the object fully. The borders are only affected in one direction and the corners are not scaled (note, restrictions apply, see below.) This is quite useful to draw a scalable button or window.


Fig 1 — Sample button being scaled with a scaling grid

Metadata

Tag Info
Tag Number: 
77
Tag Type: 
Format
Tag Flash Version: 
8
Brief Description: 

This tag includes XML code describing the movie. The format is RDF compliant to the XMP as defined on W3C.

Tag Structure: 
struct swf_metadata {
	swf_tag			f_tag;		/* 77 */
	string			f_metadata;
};

The Metadata tag is used to describe the SWF movie in a robot readable form. It will be used by search engines to index your Flash movies.

The f_metadata string is an XML buffer defined using the RDF definition compliant with the XMP specification. You can find more information on the W3C and other websites:

RDF Primer
RDF Specification
Dublin Core

Note that this description can describe everything, from the entire movie to each single line of code in your action scripts.

The string must be UTF-8 encoded.