Made to Order Software Corporation Logo

documentation

SWF Gradient (swf_gradient)

SWF Structure Info
Tag Flash Version: 
3
SWF Structure: 
struct swf_gradient {
	if(tag == DefineShape4) {
		unsigned		f_spread_mode : 2;
		unsigned		f_interpolation_mode : 2;
		unsigned		f_count : 4;
	}
	else {
		unsigned		f_pad : 4;
		unsigned		f_count : 4;
	}
	swf_gradient_record	f_gradient_record[f_count];
	/* f_type is defined in the swf_fill_style encompassing this gradient */
	if(f_type == 0x13) {
		signed short fixed	f_focal_point;
	}
};

This structure defines a gradient. This is a set of colors which are used to define an image with colors smoothly varying from one color to the next. The gradient can be radial (circular) or linear (rectangular).

The f_count field is limited depending on the tag used and the version of SWF as defined below:

We have completely switched to Drupal!

Made to Order Software is proud to announce a complete switch-over of our main site to Drupal! With this switch we are introducing new features which we hope will make your visit to our site more enjoyable. cool

PlaceObject2

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

Place, replace, remove an object in the current display list.

Tag Structure: 
struct swf_placeobject2 {	/* and swf_placeobject3 */
	swf_tag			f_tag;		/* 26 or 70 */
	/* NOTE: the following flags can be read as one or two bytes also */
	if(version >= 8) {
		unsigned	f_place_reserved : 5;
		unsigned	f_place_bitmap_caching : 1;
		unsigned	f_place_blend_mode : 1;
		unsigned	f_place_filters : 1;
	}
	if(version >= 5) {
		unsigned	f_place_has_actions : 1;
	}
	else {
		unsigned	f_place_reserved : 1;
	}
	unsigned		f_place_has_clipping_depth : 1;
	unsigned		f_place_has_name : 1;
	unsigned		f_place_has_morph_position : 1;
	unsigned		f_place_has_color_transform : 1;
	unsigned		f_place_has_matrix : 1;
	unsigned		f_place_has_id_ref : 1;
	unsigned		f_place_has_move : 1;
	unsigned short		f_depth;
	if(f_place_has_id_ref) {
		unsigned short		f_object_id_ref;
	}
	if(f_place_has_matrix) {
		swf_matrix		f_matrix;
	}
	if(f_place_has_color_transform) {
		swf_color_transform	f_color_transform;
	}
	if(f_place_has_morph_position) {
		unsigned short		f_morph_position;
	}
	if(f_place_has_name) {
		string			f_name;1
	}
	if(f_place_has_clipping_depth) {
		unsigned short		f_clipping_depth;
	}
	/* 3 next entries since v8.0 */
	if(f_place_filters) {
		unsigned char		f_filter_count;
		swf_any_filter		f_filter;
	}
	if(f_place_blend_mode) {
		unsigned char		f_blend_mode;
	}
	if(f_place_bitmap_caching) {
		/* WARNING: this is not defined in the Macromedia documentation
		 * it may be that it was part of the blend mode whenever the person
		 * who defined this byte was testing (I copied that from somewhere else!).
		 */
		unsigned char		f_bitmap_caching;
	}
	/* since v5.0 */
	if(f_place_has_actions) {
		unsigned short		f_reserved;
		if(version >= 6) {
			unsigned long	f_all_flags;
		}
		else {
			unsigned short	f_all_flags;
		}
		swf_event		f_event[<variable>];
		if(version >= 6) {
			unsigned long	f_end;	/* always zero */
		}
		else {
			unsigned short	f_end;	/* always zero */
		}
	}
};
  • 1. Assuming that this PlaceObject2 references a DefineSprite, this name becomes the name of this instance of the sprite. This feature enables you to place the same DefineSprite multiple times in your display list each time using a different name.

This tag will be used to specify where and how to place an object in the next frame. The PlaceObject is much different and is presented separately.

The f_depth field is used to indicate at which depth the character is inserted in the current frame. There can be only one object per depth value (thus a maximum of 65536 objects can appear on a single frame).

The f_place_has_move and f_place_has_id_ref flags are used to indicate what to do at the given depth. The following table presents what happens depending on the current value.

f_place_has_move ...

DefineBitsJPEG

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

Define a JPEG bit stream.

Tag Structure: 
struct swf_definebitsjpeg {
	swf_long_tag		f_tag;		/* 6, 21, 35 or 90 */
	unsigned short		f_image_id;
	if(f_tag == DefineBitsJPEG3 + f_tag == DefineBitsJPEG4) {
		/* sizeof(f_encoding_tables) + sizeof(f_image_data) + 2 when JPEG4 */
		unsigned long		f_offset_to_alpha;
	}
	if(f_tag == DefineBitsJPEG4) {
		unsigned short fixed	f_deblocking_filter_parameter;
	}
	if(f_tag != DefineBitsJPEG) {
		/* when DefineBitsJPEG, use JPEGTables instead */
		unsigned char		f_encoding_tables[<variable size>];
	}
	unsigned char		f_image_data[<variable size>];
	if(f_tag == DefineBitsJPEG3 || f_tag == DefineBitsJPEG41) {
		unsigned char		f_alpha[<variable size>];
	}
};
  • 1. JPEG4 optionally accepts the f_alpha field. [To be verified]

These tags define an image saved using the JPEG compression scheme.

DefineBitsJPEG (V1.0) does not include the encoding tables which are defined in the unique JPEGTables tag instead. All the DefineBitsJPEG of an SWF file use the only JPEGTables tag. Yes... This means you need a tool that is capable of reusing the same tables over and over again to make sure that all your DefineBitsJPEGs work properly (or use it just once.)

The other tags incorporate their own version of the JPEG encoding tables.

The DefineBitsJPEG3 and DefineBitsJPEG4 support an alpha channel bit plane (8 bits.) ...

FreeCharacter

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

Release a character which won't be used in this movie anymore.

Tag Structure: 

Unknown

This tag was intended to be used to delete a character that would not be referenced any more. The tag is not used in any movie and is not defined in the Adobe Flash documentation. 

SWF Tags

The following table is a list of all the SWF tags defined in this documentation.

This table presents the tags sorted using their number. There are tables available to find tags by name, by version of Flash releases, and by type.

IDsort icon Tag Name Type Comments Version
-1. File Header Format

Although it isn't a tag per say, we consider the file header as being a tag because it represents a block in the flash file. Since version 8, it can be complemented by the FileAttributes tag.

1
End Format

Mark the end of the file or a Sprite. It can't appear anywhere else but the end of the file or a Sprite.

1
1. ShowFrame Display

Display the current display list and pauses for 1 frame as defined in the file header.

1
2. DefineShape Define

Define a simple geometric shape.

1
3. FreeCharacter Define

Release a character which won't be used in this movie anymore.

1
4. PlaceObject Display

Place the specified object in the current display list.

1
5. RemoveObject Display

Remove the specified object at the specified depth.

1
6. DefineBitsJPEG Define

Define a JPEG bit stream.

1
7. DefineButton Define

Define an action button.

1
8. JPEGTables Define

Define the tables used to compress/decompress all the SWF 1.0 JPEG images (See also DefineBitsJPEG.)

1
9. SetBackgroundColor Display

Change the background color. Defaults to white if unspecified.

1
10. DefineFont Define

List shapes corresponding to glyphs.

1
11. DefineText Define

Defines a text of characters displayed using a font. This definition doesn't support any transparency.

1
12. DoAction Action

Actions to perform at the time the next show frame is reached and before the result is being displayed. It can duplicate sprites, start/stop movie clips, etc.

All the actions within a frame are executed sequentially in the order they are defined.

Important: many actions are not supported in Adobe Flash version 1. Please, see the reference of actions below in order to know which actions can be used with which version of Adobe Flash.

1
13. DefineFontInfo Define

Information about a previously defined font. Includes the font style, a map and the font name.

1
14. DefineSound Define

Declare a sound effect. This tag defines sound samples that can later be played back using either a StartSound or a DefineButtonSound. Note that the same DefineSound block can actually include multiple sound files and only part of the entire sound can be played back as required.

2
15. StartSound Display

Start playing the referenced sound on the next ShowFrame.

2
15. StopSound Display

Start playing the referenced sound on the next ShowFrame.

2
17. DefineButtonSound Define

Defines how to play a sound effect for when an event occurs on the referenced button.

2
18. SoundStreamHead Define

Declare a sound effect which will be interleaved with a movie data so as to be loaded over a network connection while being played.

2
19. SoundStreamBlock Define

A block of sound data (i.e. audio samples.) The size of this block of data is defined in the previous SoundStreamHead tag. It is used to download sound samples on a per frame basis instead of all at once.

2
20. DefineBitsLossless Define

A bitmap compressed using ZLIB (similar to the PNG format).

2
21. DefineBitsJPEG2 Define

Defines a complete JPEG image (includes the bit stream and the tables all in one thus enabling multiple tables to be used within the same SWF file).

Since Flash version 10, the data can also be set to a valid PNG or GIF89a. There is no need to specify the image format in the tag since the data describing the image includes the necessary information.

2
22. DefineShape2 Define

Brief Description: 

Define a simple geometric shape.

2
23. DefineButtonCxform Define

Setup a color transformation for a button.

2
24. Protect Define

Disable edition capabilities of the given SWF file. Though this doesn't need to be enforced by an SWF editor, it marks the file as being copyrighted in a way.

WARNING: this tag is only valid in Flash V2.x, V3.x, and V4.x, use the EnableDebugger instead in V5.x and EnableDebugger2 in V6.x and newer movies.

2
25. PathsArePostscript Define

The shape paths are defined as in postscript?

3
26. PlaceObject2 Define

Place, replace, remove an object in the current display list.

3
28. RemoveObject2 Display

Remove the object at the specified level. This tag should be used in movies version 3 and over since it compressed better than the standard RemoveObject tag. Note that a PlaceObject2 can also be used for this task.

3
29. SyncFrame Display

Tag used to synchronize the animation with the hardware.

3
31. FreeAll Define

Probably an action that would be used to clear everything out.

3
32. DefineShape3 Define

Brief Description: 

Define a simple geometric shape.

3
33. DefineText2 Define

Defines a text of characters displayed using a font. Transparency is supported with this tag.

3
34. DefineButton2 Define

Define an action button. Includes a color transformation. 

3
35. DefineBitsJPEG3 Define

Defines a complete JPEG image, i.e. a verbatim JPEG image file. The JPEG image is then followed by an alpha channel. Note that the alpha channel uses the Z-lib compression. Since Flash 10, the supported image formats are JPEG, PNG and GIF89a.

3
36. DefineBitsLossless2 Define

Defines an RGBA bitmap compressed using ZLIB (similar to the PNG format).

3
37. DefineEditText Define

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

4
38. DefineVideo Define

Apparently, Macromedia did have a first attempt in supporting video on their platform. It looks, however, as if they reconsidered at that point in time.

4
39. DefineSprite Define

Declares an animated character. This is similar to a shape with a display list so the character can be changing on its own over time.

3
40. NameCharacter Define

Define the name of an object (for buttons, bitmaps, sprites and sounds.)

3
41. ProductInfo Define

This tag defines information about the product used to generate the animation. The product identifier should be unique among all the products. The info includes a product identifier, a product edition, a major and minor version, a build number and the date of compilation. All of this information is all about the generator, not the output movie.

3
42. DefineTextFormat Define

Another tag that Flash ended up not using.

1
43. FrameLabel Define

Names a frame or anchor. This frame can later be referenced using this name.

3
45. SoundStreamHead2 Define

Declare a sound effect which will be interleaved with a movie data so as to be loaded over a network connection while being played.

3
46. DefineMorphShape Define

This is similar to a sprite with a simple morphing between two shapes.

3
47. GenerateFrame Define

This may have been something similar to a New in an action script and thus was removed later.

3
48. DefineFont2 Define

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

3
49. GeneratorCommand Define

Gives some information about the tool which generated this SWF file and its version.

3
50. DefineCommandObject Define

?

5
51. CharacterSet Define

It looks like this would have been some sort of DefineSprite extension... did not make it out either.

5
52. ExternalFont Define

It looks like accessing a system font was going to be another tag, but instead Macromedia made use of a flag in the existing DefineFont2 tag.

5
56. Export Define

Exports a list of definitions declared external so they can be used in other movies. You can in this way create one or more movies to hold a collection of objects to be reused by other movies without having to duplicate these in each movie. A single export is enough for an entire movie (and you should have just one).

5
57. Import Define

Imports a list of definitions that are to be loaded from another movie. You can retrieve objects that were exported in the specified movie. You can have as many import as you like, though you should really only have one per referenced movie.

5
58. EnableDebugger Format

The data of this tag is an MD5 password like the EnableDebugger2 tag. When it exists and you know the password, you will be given the right to debug the movie with Flash V5.x and higher.

WARNING: this tag is only valid in Flash V5.x, use the EnableDebugger2 instead in V6.x and newer movies and Protect in older movies (V2.x, V3.x, and V4.x).

5
59. DoInitAction Action

Actions to perform the first time the following Show Frame tag is reached. All the initialization actions are executed before any other actions. You have to specify a sprite to which the actions are applied to. Thus you don't need a set target action. When multiple initialization action blocks are within the same frame, they are executed one after another in the order they appear in that frame.

6
60. DefineVideoStream Define

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.

6
61. VideoFrame Define

Show the specified video frame of a movie.

6
62. DefineFontInfo2 Define

Defines information about a font, like the DefineFontInfo tag plus a language reference. To force the use of a given language, this tag should be used in v6.x+ movies instead of the DefineFontInfo tag.

6
63. DebugID Define

This tag is used when debugging an SWF movie. It gives information about what debug file to load to match the SWF movie with the source. The identifier is a UUID.

6
64. EnableDebugger2 Format

The data of this tag is a 16 bits word followed by an MD5 password like the EnableDebugger tag. When it exists and you know the password, you will be given the right to debug the movie with Flash V6.x and over.

WARNING: this tag is only valid in Flash V6.x and over, use the EnableDebugger instead in V5.x and Protect in older movies (V2.x, V3.x, and V4.x).

6
65. ScriptLimits Define

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.

7
66. SetTabIndex Define

Define the order index so the player knows where to go next when the Tab key is pressed by the user.

7
69. FileAttributes Format

Since version 8, this tag is required and needs to be the very first tag in the movie. It is used as a way to better handle security within the Flash Player.

8
70. PlaceObject3 Display

Place an object in the display list. The object can include bitmap caching information, a blend mode and a set of filters.

8
71. Import2 Define

Imports a list of definitions from another movie. In version 8+, this tag replaces the original Import tag. You can retrieve objects which were exported in the specified movie. You can have as many import as you like, although you should really only have one per referenced movie.

8
72. DoABCDefine Action

New container tag for ActionScripts under SWF 9. Includes only actions. This tag is not defined in the official Flash documentation.

9
73. DefineFontAlignZones Define

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

8
74. CSMTextSettings Define

Define whether CSM text should be used in a previous DefineText, DefineText2 or DefineEditText.

8
75. DefineFont3 Define

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

8
76. SymbolClass Action

Instantiate objects from a set of classes.

9
77. Metadata Format

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

8
78. DefineScalingGrid Define

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

8
82. DoABC Action

New container tag for ActionScripts under SWF 9. Includes an identifier, a name and actions.

9
83. DefineShape4 Define

Declare a shape which supports new line caps, scaling and fill options.

8
84. DefineMorphShape2 Define

Declare a morphing shape with attributes supported by version 8+.

8
86. DefineSceneAndFrameData Define

Define raw data for scenes and frames.

9
87. DefineBinaryData Define

Defines a buffer of any size with any binary user data.

9
88. DefineFontName Define

Define the legal font name and copyright.

9
90. DefineBitsJPEG4 Define

Defines a complete JPEG (the image formats supported are JPEG, PNG and GIF89a) and includes a deblocking filter parameter. The JPEG image is then followed by an alpha channel. Note that the alpha channel uses the Z-lib compression.

10

The entire SSWF project license

The following license covers the entire SSWF project.

Copyright (c) 2002-2009 Made to Order Software Corp.

SWF File Format Reference

The Flash File Format Explained

Stay up to date,
register to receive the
SSWF Newsletter

The SWF file format is used for Flash. SWF stands for Shockwave Format1, the very first company that created the Flash animation format later bought by Macromedia and now owned by ...

  • 1. There are many people who found other names for the acronym such as Shockwave Flash, Shock Wave File, Small Web Format, Serious Wow Factor, and SWIFF. History of man kind is confronted with the same problems, unfortunately. And no... it really has nothing to do with the Swiss Wrestling Federation!

PHP eFax FAQ

PHP eFax is very popular and generates many questions from our customers and potential customers. We try to answer those questions on our website for a quick read from our users. You can always ask us additional questions by contacting us directly or by posting a comment on the FAQ page.

Page not found

Baby with a shirt saying "I'm here!"The page you tried to access either does not exist or it was removed.

If you are trying to access a documentation, it is likely that it was removed by the auto-generator we use for reference documentation (namely Doxygen.)

Also, we moved from an older site and some pages may not have made it here yet.