Made to Order Software Corporation Logo

structure

[un]signed

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

A signed or unsigned bit field which width does not directly correspond to an existing C type.

In structures, the width of the field is specified after the field name like in C bit fields. In case of Flash, it can be dynamic in which case a variable name is specified.

Signed bit fields have an implied sign extend of the most significant bit of the bit field. So a signed bit field of 2 bits support the following values:

DefineFont

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

List shapes corresponding to glyphs.

Tag Structure: 
struct swf_definefont {
	swf_tag			f_tag;		/* 10 */
	unsigned short		f_font_id;
	/* there is always at least one glyph */
	f_font_glyphs_count = f_font_offsets[0] / 2;
	unsigned short		f_font_offsets[f_font_glyphs_count];
	swf_shape		f_font_shapes[f_font_glyphs_count];
};

It is common to use the DefineFont tag in order to create an array of shapes later re-used to draw strings of text on the screen. Note that the definition of the shape within a font is limited since it can't include any specific fill and/or line style. Also, each shape is assumed to be defined within a 1024x1024 square. This square is called the EM Square. Fig 1. below shows you the EM Square and how it is used. The characters baseline can be placed anywhere within the EM Square (it certainly can be outside too if you wish?!?).

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.

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 ...

Space going green!

Today, the only way to go in Space is to use rockets or fast planes (although the latter does not get you as far as needed to reach even the IST.) Either one of those uses a tremendous amount of quite poluting carburant.

In the future, however, we definitively need to find a way to build an elevator. The building of such a structure has not started though. At this time there are two main reasons why: (1) we think we do not have the technology, and (2) what we have thought about can break with the consequences of getting the debris all over Earth and that could be quite dangerous.

Now there ...