Made to Order Software Corporation Logo

parameter

Insert Node Usage

Syntax

The Insert node tag syntax is:

   [node:<name of node> <parameters>]

Name of node

The <name of node> can either be

  • The name of the node, i.e. it's URL without the protocol and domain1, or
  • The node identifier (the number you see in your URL when you edit the node), or
  • An asterisk (*) in which case the current node applies2
    • 1. For instance, to insert this very node, I would use the name doc_insert_node_usage.
    • 2. The asterisk is useful to repeat something from the node in a block. This could be the title of the node or a CCK field. I would suggest ...

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

Throw

SWF Action
Action Category: 
Control
Action Details: 
0
Action Identifier: 
42
Action Structure: 
<n.a.>
Action Length: 
0 byte(s)
Action Stack: 
pop 1 (a)
Action Operation: 
a1 := pop();
throw a1;
Action Flash Version: 
7
See Also: 
Try

This action pops one item from the stack and returns its value as the exception parameter. You can catch exceptions using the Try action.

Swap

SWF Action
Action Category: 
Stack
Action Details: 
0
Action Identifier: 
77
Action Structure: 
<n.a.>
Action Length: 
0 byte(s)
Action Stack: 
pop 2 (a), push 2 (a)
Action Operation: 
a1 := pop();
a2 := pop();
push(a1);
push(a2);
Action Flash Version: 
5
See Also: 

Pop two items and push them back the other way around.

This action is very useful when you just called a function and need to swap that parameter with the previous function call when all you should have to do is call.

Greater Than (typed)

SWF Action
Action Category: 
Comparisons
Action Details: 
(typed)
Action Identifier: 
103
Action Structure: 
<n.a.>
Action Length: 
0 byte(s)
Action Stack: 
pop 2 (a), push 1 (b)
Action Operation: 
a1 := pop();
a2 := pop();
if(is_int(a1) && is_int(a2)) {
  i1 := (int)a1;
  i2 := (int)a2;
  r := i2 > i1;    // compare integers
}
else if(is_numeric(a1) && is_numeric(a2)) {
  f1 := (float)a1;
  f2 := (float)a2;
  r := f2 > f1;    // compare floating points
}
else {
  s1 := (string)a1;
  s2 := (string)a2;
  r := s2 > s1;    // compare characters, case sensitive
}
push(r);
Action Flash Version: 
6

Similar to Swap + Less Than. It checks whether the second parameter is greater than the first and return the Boolean result on the stack.

This is the preferred way of applying the Greater Than and Less Than or Equal, i.e. Not(Greater Than), test since version 5.

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.

Declare Function (V7)

SWF Action
Action Category: 
Control
Action Details: 
(256 variables)
Action Identifier: 
142
Action Structure: 
string     f_name;
unsigned short   f_arg_count;
unsigned char   f_reg_count;
unsigned short   f_declare_function2_reserved : 7;
unsigned short   f_preload_global : 1;
unsigned short   f_preload_parent : 1;
unsigned short   f_preload_root : 1;
unsigned short   f_suppress_super : 1;
unsigned short   f_preload_super : 1;
unsigned short   f_suppress_arguments : 1;
unsigned short   f_preload_arguments : 1;
unsigned short   f_suppress_this : 1;
unsigned short   f_preload_this : 1;
swf_params   f_params[f_arg_count];
unsigned short   f_function_length;

WARNING: the preload/suppress flags are defined on a short and thus the bytes in a Flash file will look swapped.

Action Length: 
-1 byte(s)
Action Stack: 
n.a.
Action Operation: 
create a function on the current target
Action Flash Version: 
7

Declare a function which can later be called with the Call Function action or Call Method action (when defined as a function member.) The f_function_length1 defines the number of bytes that the function declaration uses after the header (i.e. the size of the actions defined in the function.) All the actions included in this block are part of the function body.

  • 1. A function is limited to 65535 bytes.

ScriptLimits

Tag Info
Tag Number: 
65
Tag Type: 
Define
Tag Flash Version: 
7
Brief Description: 

Change limits used to ensure scripts do not use more resources than what you choose. In version 7, it supports a maximum recursive depth and a maximum amount of time scripts can be run for in seconds.

Tag Structure: 
struct swf_scriptlimits {
	swf_tag			f_tag;		/* 65 */
	unsigned short		f_max_recursion_depth;
	unsigned short		f_timeout_seconds;
};

This tag is used to change the default limits of script execution.

The maximum recursion depth is 256 by default. Any value, except zero (0) is valid.

The f_timeout_seconds parameter specifies the number of seconds before the players opens a dialog box saying that the SWF animation is stuck.

VideoFrame

Tag Info
Tag Number: 
61
Tag Type: 
Define
Tag Flash Version: 
6
Brief Description: 

Show the specified video frame of a movie.

Tag Structure: 
struct swf_startsound {
	swf_tag			f_tag;		/* 61 */
	unsigned short		f_video_id_ref;
	unsigned short		f_frame;
	unsigned char		f_video_data[variable size];
};

The VideoFrame tag is used to render one frame. It includes the data of exactly one video frame to be drawn on the screen.

The f_object_id_ref parameter is a reference to a DefineVideoStream.

DefineVideoStream

Tag Info
Tag Number: 
60
Tag Type: 
Define
Tag Flash Version: 
6
Brief Description: 

Defines the necessary information for the player to display a video stream (i.e. size, codec, how to decode the data, etc.). Play the frames with VideoFrame tags.

Tag Structure: 
struct swf_definevideostream {
	swf_tag			f_tag;		/* 60 */
	unsigned short		f_video_id;
	unsigned short		f_frame_count;
	unsigned short		f_width;	/* WARNING: this is in pixels */
	unsigned short		f_height;
	unsigned char		f_reserved : 5;
	unsigned char		f_deblocking : 2;
	unsigned char		f_smoothing : 1;
	unsigned char		f_codec;
};

This tag defines a video stream. To playback the video stream, one needs to add a list of VideoFrame tags.

The f_width and f_height are defined in pixels. This is rather uncommon in SWF so it is to be noted multiple times.