Made to Order Software Corporation Logo

body

DefineShape2

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

Brief Description: 

Define a simple geometric shape.

Tag Structure: 

Tag Structure: 
struct swf_defineshape {
	swf_tag				f_tag;		/* 2, 22, 32, 46, 83, or 84 */
	unsigned short			f_shape_id;
	swf_rect			f_rect;
	is_morph = f_tag == DefineMorphShape || f_tag == DefineMorphShape2;
	has_strokes = f_tag == DefineShape4 || f_tag == DefineMorphShape2;
	if(is_morph) {
		swf_rect			f_rect_morph;
	}
	if(has_strokes) {
		swf_rect			f_stroke_rect;
		if(is_morph) {
			swf_rect			f_stroke_rect_morph;
		}
		unsigned			f_define_shape_reserved : 6;
		unsigned			f_define_shape_non_scaling_strokes : 1;
		unsigned			f_define_shape_scaling_strokes : 1;
	}
	if(is_morph) {
		unsigned long			f_offset_morph;
		swf_morph_shape_with_style	f_morph_shape_with_style;
	}
	else {
		swf_shape_with_style		f_shape_with_style;
	}
};

These are probably the most important tags in this reference. They are used to define a shape using Bezier curves and lines with different styles. The DefineShape of V1.0 is usually enough unless you need a large number of styles or you want to specify colors with an alpha channel (RGBA).

The DefineMorphShape and DefineMorphShape2 can be used to render an intermediate shape between two defined shapes. All the points and control points of both shapes must match. This is because the rendering of the morphing shapes is just an interpolation between both shapes points and control points positions. The interpolation is a very simple linear function (note however that you still can use a non-linear transformation effect in the end.) Most of the parameters in a shape definition are doubled when this tag is used. It otherwise looks very similar.

The f_stroke_rect and f_stroke_rect_morph rectangles define the boundaries around their respective shapes without the line strokes (excluding the thickness of the line.)

The f_define_shape_non_scaling_strokes flag should be set to 1 if at least one of the line strokes always stays the same while morphing.

The f_define_shape_scaling_strokes flag should be set to 1 if at least one of the line strokes is changing while morphing.

The f_offset_morph 32 bits value gives the offset from after that value to the start of the second shape (the shape to morph to.) In other words, this value can be used to skip the styles and the first shape at once.

DefineBitsJPEG2

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

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.

Tag Structure: 

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.) This alpha channel is compressed using the ZLIB scheme as defined with the DefineBitsLossless image formats and appears at the end.

With Flash 10, DefineBitsJPEG4 was introduced to support a deblocking filter parameter. This parameter should be set to a value between 0.0 and 1.0 (0x0000 and 0x0100--so really a value from 0 to 256 inclusive.)

WARNING: These tags require you to save the swf_tag in long format (i.e. f_tag_and_size & 0x3F == 0x3F even if the size is smaller.)

f_encoding should include 0xFF 0xDB and 0xFF 0xC4 entries.

The f_image_data buffer should include the 0xFF 0xE0, 0xFF 0xC0 and 0xFF 0xDA.

Since Flash 10 the f_encoding and f_image_data fields defined in the DefineBitsJPEG2, DefineBitsJPEG3 and DefineBitsJPEG4 tags, are viewed as one single large buffer and thus it can be a verbatim JPEG, PNG or GIF89a file.

When the buffer represents a JPEG, it starts with 0xFF 0xD8 and ends with 0xFF 0xD9.

When the buffer represents a PNG, it starts with 0x89 0x50 'P' 0x4E 'N' 0x47 'G' 0x0D '\r' 0x0A '\n' 0x1A '^Z' 0x0A '\n'.

When the buffer represents a GIF89a, it starts with 0x47 'G' 0x49 'I' 0x46 'F' 0x38 '8' 0x39 '9' 0x61 'a'.

WARNING: Up to Flash 7, both buffers (f_encoding and f_image_data) need to start with a 0xFF 0xD8 (SOI) and end with 0xFF 0xD9 (EOI). Since Flash 8, this practice should not be used anymore.

The f_alpha buffer is compressed with ZLIB as defined in the DefineBitsLossless tag (this is similar to the PNG format). WARNING: this field only works with JPEG data. A PNG or GIF89a cannot make use of this field (but they can make use of their own alpha channel.)

Note:   The Flash 10 documentation says that the f_alpha field is optional. This means you can save a JPEG in a DefineBitsJPEG4 without the Alpha Channel but still make use of the deblocking filter parameter. Before Flash 10, use DefineBitsJPEG2 instead (safer).

The DefineBitsJPEG tag may fail if it includes any encoding tables. These tables shall be defined within the JPEGTables instead.

Note that the Adobe SWF player better enforces the correctness of these tags since version 8. Some older movies may not work properly with Flash Player 8+.

Terms & Conditions

Made to Order Software Corporation
Terms and Conditions for the Online Services
offered by Made to Order Software Corporation

This Agreement ("Agreement") is by and between Made to Order Software Corporation ("m2osw") a Californian Corporation and You, your heirs, your agents, successors and assigns ("You" and "Your"), and is made effective as of the date of electronic execution, which is when you register for an electronic account to use the Web site of m2osw. This Agreement sets forth the terms and conditions of Your use of the Online Services ...

Cutemenu Overview

Introduction

The Cute Menu Drupal Module is used to create advanced dropdown menus. The module is free and can be found on the Drupal website.

The list of items can be grouped under a title. The title is a menu entry which cannot be clicked on.

The dropdown panes can include a header and a footer with images and text.

Note that to make full use of the Cute Menu capabilities, you will be required to write your own CSS to make it look the way you want it to look in your theme.

Table of Contents Overview

The Table of contents module is used to generate a table with a list of all the content of your pages.

The module searches for the header tags (H1 to H6) and transforms those into a list of items used in the table of contents. Note that this module does not have the capability to generate a table of contents for multiple pages. However, used with the Views module, it is possible to create pages referencing multiple sub-pages.

The features include a way to number the items either with the automatic HTML ordered list feature (OL) or with an internal system that counts the headers and generates numbers as expected for sub-lists (i.e. 1., 1.1, 1.1.1, 1.1.2, 1.2, 2., etc.)

The table of contents can also reference all the attachments present on your page.

This documentation proposes to teach you how to install and make the most out of the filter.

Can an iPod break your jaw?

Also I have an iPod, I won it (Yes. I did not buy it!) And I rather rarely listen to music in general anyway. In other words, I think I’m not at risk! However…

Many people have their iPod on their ears while running outside. Nothing wrong with that until… lightning strikes.

I’m not too sure why people would be running outside when there is a lightning storm, but the fact is that happens.

One document with all translations

Have you ever thought that it would be great to write one document including all the translations in a single file? Outside of the fact that this makes the document relatively large, it makes the translation really fast, the translator can see the sentence in all the other languages and translate from that.

I actually wrote an HTML test file with two styles. One is named English and the other is named Français. And since a style entry can depend on the currently selected language, you can write style entries that get hidden when on or the other language is selected.

So, if you ...