Made to Order Software Corporation Logo

table

Logical Not

SWF Action
Action Category: 
Logical and Bitwise
Action Details: 
0
Action Identifier: 
18
Action Structure: 
<n.a.>
Action Length: 
0 byte(s)
Action Stack: 
pop 1 (b), push 1 (b)
Action Operation: 
b1 := pop();
r := ! b1;
push(r);
Action Flash Version: 
4

Pop one value, compute the Logical NOT and put the result back on the stack.

Logical And

SWF Action
Action Category: 
Logical and Bitwise
Action Details: 
0
Action Identifier: 
16
Action Structure: 
<n.a.>
Action Length: 
0 byte(s)
Action Stack: 
pop 2 (b), push 1 (b)
Action Operation: 
b1 := pop();
b2 := pop();
r := b2 && b1;
push(r);
Action Flash Version: 
4

Pop two values, compute the Logical AND and put the Boolean result back on the stack.

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.

Call Function

SWF Action
Action Category: 
Control
Action Details: 
0
Action Identifier: 
61
Action Structure: 
<n.a.>
Action Length: 
0 byte(s)
Action Stack: 
pop 1 (s), pop 1 (i), pop i2 (a), push 1 (a)
Action Operation: 
s1 := pop();
i2 := pop();
for(idx := 3; idx < i2 + 3; ++idx) {
  aidx = pop();
}
r := call s1(a3, a4, a5...a(i2+2));
push(r);
Action Flash Version: 
5

Pops one string that represents the name of the function to call, pop one integer indicating the number of arguments following, pop each argument, call the named function, push the result of the function on the stack. There is always a result1.

  • 1. When nothing is returned by the function, the result undefined is pushed on the stack.

DefineFontAlignZones

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

Define advanced hints about a font glyphs to place them on a pixel boundary.

Tag Structure: 
struct swf_definefontalignzones {
	swf_tag			f_tag;		/* 73 */
	unsigned short		f_font2_id_ref;
	unsigned		f_csm_table_hint : 2;
	unsigned		f_reserved : 6;
	swf_zone_array		f_zones[corresponding define font3.f_font2_glyphs_count];
};

Since SWF8, this tag was added to allow a clear definition of where a glyph starts. This is a hint to ensure that glyphs are properly drawn on pixel boundaries. Note that it is only partially useful for italic fonts since only vertical hints really make a difference.

The f_font2_id_ref needs to reference the font identifier of a DefineFont3. Each DefineFontAlignZones shall have a different f_font2_id_ref.

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.

DefineEditText

Tag Info
Tag Number: 
37
Tag Type: 
Define
Tag Flash Version: 
4
Brief Description: 

An edit text enables the end users to enter text in a Flash window.

Tag Structure: 
struct swf_defineedittext {
	swf_tag			f_tag;		/* 37 */
	unsigned short		f_edit_id;
	swf_rect		f_rect;
	unsigned		f_edit_has_text : 1;
	unsigned		f_edit_word_wrap : 1;
	unsigned		f_edit_multiline : 1;
	unsigned		f_edit_password : 1;
	unsigned		f_edit_readonly : 1;
	unsigned		f_edit_has_color : 1;
	unsigned		f_edit_has_max_length : 1;
	unsigned		f_edit_has_font : 1;
	if(version >= 6) {
		unsigned		f_edit_reserved : 1;
		unsigned		f_edit_auto_size : 1;
	}
	else {
		unsigned		f_edit_reserved : 2;
	}
	unsigned		f_edit_has_layout : 1;
	unsigned		f_edit_no_select : 1;
	unsigned		f_edit_border : 1;
	unsigned		f_edit_reserved : 1;
	unsigned		f_edit_html : 1;
	unsigned		f_edit_use_outlines : 1;
	if(f_edit_has_font) {
		unsigned short		f_edit_font_id_ref;
		unsigned short		f_edit_font_height;
	}
	if(f_edit_has_color) {
		swf_rgba		f_edit_color;
	}
	if(f_edit_has_max_length) {
		unsigned short		f_edit_max_length;
	}
	if(f_edit_has_layout) {
		unsigned char		f_edit_align;
		unsigned short		f_edit_left_margin;
		unsigned short		f_edit_right_margin;
		signed short		f_edit_indent;
		signed short		f_edit_leading;
	}
	string			f_edit_variable_name;
	if(f_edit_has_text) {
		string			f_edit_initial_text;
	}
};

Additional interactivity has been added in V4.0 of the SWF format. This is given by the use of edit boxes offering the end users a way to enter text as if the SWF movie was in fact an interactive form.

The text is defined in a variable (accessible in action scripts). It can be dynamically assigned and retrieved. It is legal to have an empty string as the variable name (not dynamically accessible).

Since version 8, the text drawn by a DefineEditText tag can be tweaked by adding a CSMTextSettings tag.

The f_edit_word_wrap flag will be set to true (1) in order to have words going beyond the ...

DefineFont2

Tag Info
Tag Number: 
48
Tag Type: 
Define
Tag Flash Version: 
3
Brief Description: 

Define a list of glyphs using shapes and other font metric information.

Tag Structure: 
struct swf_definefont2 {
	swf_tag			f_tag;		/* 48 or 75 */
	unsigned short		f_font2_id;
	unsigned		f_font2_has_layout : 1;
	if(version >= 6) {
		unsigned	f_font2_reserved : 1;
		if(version >= 7) {
			unsigned	f_font2_small_text : 1;
		}
		unsigned	f_font2_reserved : 1;
	}
	else {
		unsigned	f_font2_shiftjis : 1;
		unsigned	f_font2_unicode : 1;
		unsigned	f_font2_ansii : 1;
	}
	unsigned		f_font2_wide_offsets : 1;
	unsigned		f_font2_wide : 1;	/* always 1 in v6.x+ */
	unsigned		f_font2_italic : 1;
	unsigned		f_font2_bold : 1;
	if(version >= 6) {
		unsigned char	f_font2_language;
	}
	else {
		unsigned char	f_font2_reserved;
	}
	unsigned char		f_font2_name_length;
	unsigned char		f_font2_name[f_font2_name_length];
	unsigned short		f_font2_glyphs_count;
	if(f_font2_wide_offsets) {
		unsigned long		f_font2_offsets[f_font2_glyphs_count];
		unsigned long		f_font2_map_offset;
	}
	else {
		unsigned short		f_font2_offsets[f_font2_glyphs_count];
		unsigned short		f_font2_map_offset;
	}
	swf_shape		f_font2_shapes[f_font2_glyphs_count];
	if(f_font_info_wide) {
		unsigned short		f_font2_map[f_font2_glyphs_count];
	}
	else {
		unsigned char		f_font2_map[f_font2_glyphs_count];
	}
	if(f_font2_has_layout) {
		signed short		f_font2_ascent;
		signed short		f_font2_descent;
		signed short		f_font2_leading_height;
		signed short		f_font2_advance[f_font2_glyphs_count];
		swf_rect		f_font2_bounds[f_font2_glyphs_count];
		signed short		f_font2_kerning_count;
		swf_kerning		f_font2_kerning[f_font2_kerning_count];
	}
};
/* DefineFont3 is the same as DefineFont2 */
typedef struct swf_definefont2 swf_definefont3;

It is common to use the DefineFont2 tag in order to create an array of shapes later re-used to draw strings of text on the screen. This tag must be used whenever a DefineEditText references a font; and in that case it is suggested you include a full description of the font with layouts.

The array of glyphs must be ordered in ascending order (the smaller glyph number saved first; thus 'a' must be saved before 'b', etc.).

All the characters should be defined in a 1024x1024 square (in pixels) to be drawn with the best possible quality. This square is called the EM square.

The ...

Appendix B — History of the SSWF reference

Dec 2, 2009

Moved the monolithic documentation to a multi-page hierarchical document that includes everything we had before plus many links, many terms attached to all pages (tags, English words.) And revision of most of the text for better English and clarification in some places.

Strengthen the formatting with CCK fields so all declarations look alike.

Broken up the actions from one large table to a set of pages.

Dec 14, 2008

Started work on the Load() feature of the SSWF library. This helped fixing several small mistakes in the documentation.

May 18, 2008

Fixed the ...

SWF Condition (swf_condition)

SWF Structure Info
Tag Flash Version: 
1
SWF Structure: 
struct swf_condition {
	unsigned short		f_condition_length;1
	unsigned		f_condition_key : 7;
	unsigned		f_condition_menu_leave : 1;
	unsigned		f_condition_menu_enter : 1;
	unsigned		f_condition_pointer_release_ouside : 1;
	unsigned		f_condition_pointer_drag_enter : 1;
	unsigned		f_condition_pointer_drag_leave : 1;
	unsigned		f_condition_pointer_release_inside : 1;
	unsigned		f_condition_pointer_push : 1;
	unsigned		f_condition_pointer_leave : 1;
	unsigned		f_condition_pointer_enter : 1;
	swf_action		f_action_record[variable];
};
  • 1. The number of actions is variable, the f_condition_length parameter indicates the number of bytes and can be used to skip one condition and all of its actions at once. The action array must always be terminated by an End action entry (i.e 0x00).

A condition is defined in a DefineButton2 tag. It is a record of conditions. The record terminates when the size of the current (i.e. last) condition is zero. The length of that condition can be deduced from the total size of the tag minus the offset where the condition starts. Conditions are similar to events.

The f_key field represents a key code since version 4. The following table gives the code equivalence. Note that 0 means no key.