Made to Order Software Corporation Logo

more

[un]signed long fixed

Tag Flash Version: 
1
Used by PushData Action: 
Not available in PushData Action

A short fixed value1 is a 32 bit (or less) number representing a value with 16 bits on the left of the decimal point and 16 bits on the right.

When the value is smaller than 32 bits, we assume that only the least significant bits were defined (quite often only those after the decimal point.)

For more information about bit fields, check out the [un]signed type.

  • 1. The fixed long type exists since version 1, although it was properly named as such only in version 8 of Flash.

[un]signed short fixed

Tag Flash Version: 
1
Used by PushData Action: 
Not available in PushData Action

A short fixed value1 is a 16 bit (or less) number representing a value with 8 bits on the left of the decimal point and 8 bits on the right.

When the value is smaller than 16 bits, we assume that only the least significant bits were defined (quite often only those after the decimal point.)

For more information about bit fields, check out the [un]signed type.

  • 1. The fixed short type exists since version 1, although it was properly named as such only in version 8 of Flash.

[un]signed twips

Tag Flash Version: 
1
Used by PushData Action: 
Not available in PushData Action

A bit field variable defined as TWIPS represents a floating point defined in TWIPS. Load the value as a signed or unsigned integer and then divide it by 20. The floating point result is a precise dimension in pixel.

Please, see the [un]signed type for more information about fields.

DefineSound

Tag Info
Tag Number: 
14
Tag Type: 
Define
Tag Flash Version: 
2
Brief Description: 

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.

Tag Structure: 
struct swf_definesound {
	swf_tag			f_tag;		/* 14 */
	unsigned short		f_sound_id;
	unsigned		f_sound_format : 4;
	unsigned		f_sound_rate : 2;
	unsigned		f_sound_is_16bits : 1;
	unsigned		f_sound_is_stereo : 1;
	unsigned long		f_sound_samples_count;
	unsigned char		f_sound_data[<variable size>];
};

A DefineSound tag declares a set of samples of a sound effect or a music.

The sound samples can be compressed or not, stereo or not and 8 or 16 bits. The different modes are not all available in version 2, although the same tag is used in newer versions with additional capabilities.

The f_sound_is_16bits is always set to 1 (16bits samples) if the samples are compressed (neither Rawnor Uncompressed).

The f_sound_rate represents the rate at which the samples are defined. The rate at which it will be played on the target computers may differ. The following equation can be used to determine the ...

SWF Type Definitions

This documents makes use of structure definitions that very much look like C structures. It is important to note that this is not all that true since the data saved in a SWF file are very specific and they don't follow the default, inflexible (as in static,) C definitions.

The following pages define the basic types used in this document. The comments explain in more details how each type is used.

Note that except for bit fields, all types start on a byte boundary. Nothing will be aligned on more than one byte.

RemoveObject

Tag Info
Tag Number: 
5
Tag Type: 
Display
Tag Flash Version: 
1
Brief Description: 

Remove the specified object at the specified depth.

Tag Structure: 
struct swf_removeobject {
	swf_tag			f_tag;		/* 5 or 28 */
	if(f_tag == RemoveObject) {
		unsigned short		f_object_id_ref;
	}
	unsigned short		f_depth;
};

Remove the specified object from the display list. If the same object was placed multiple times at the specified depth1 only the last copy is removed. When only a depth is specified, the last object placed at that depth is removed from the list. Note that since version 3 it is possible to use the PlaceObject2 in order to replace an object at a given depth without having to remove it first.

  • 1. It is illegal, yet possible, to place more than one object at the same depth.

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. 

File Header

Tag Info
Tag Number: 
-1
Tag Type: 
Format
Tag Flash Version: 
1
Brief Description: 

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.

Tag Structure: 
struct swf_header {1
	unsigned char		f_magic[3];	/* 'FWS' or 'CWS' */
	unsigned char		f_version;
	unsigned long		f_file_length;
}

struct swf_header_movie {2
	swf_rect		f_frame_size;
	unsigned short fixed	f_frame_rate;
	unsigned short		f_frame_count;
};
  • 1. This part is never compressed
  • 2. Although considered part of the header, this part is compressed in the 'CWS' format.

The file header is found at the very beginning of the file. It should be used to determine whether a file is an SWF file or not. Also, it contains information about the frame size, the speed at which is should be played and the version (determining the tags and actions possibly used in the file).

The f_magic[3] array is defined as the characters: 'FWS' (it is going backward probably because it was supposed to be read in a little endian as a long word). A movie can be compressed when the version is set to 6 or more. In this case, the magic characters are: 'CWS'.

The f_version ...

About SWF

Brief History

At the very beginning, a company created the SWF format to generate small vector animations on the Internet called Shockwave Flash (hence the name of the format, SWF.) It also included images. This company was bought by Macromedia around 1997 (if I recall properly). This is when Flash v3 was created. Since then, Macromedia created a new version about once a year up to version 8. At that time (in 2005/2006), Macromedia sealed a deal with Adobe which wanted to use the SWF format in their PDF files.

Today (May 1st, 2008), the SWF format is available for free to all.

There was ...

Notes about Copyrights

SSWF™ name

The name SSWF™ is used by Made to Order Software to reference its SWF library. You are welcome to use this name in reference the SSWF library if you use it in your own software.

SWF Format

Please, note that there is no restriction in using this document. However, the SWF format copyright holders are Macromedia and Adobe. There may be limits in what you can do using this format. If you are not sure, I suggest you contact a knowledgeable copyright and Software attorney who can help you decide what you can do with the SWF format.