| Instance of flash definition
This object represents flash file format's PlaceObject2 as well as PlaceObject tags.
PlaceObject2 can both add a character to the display list, and modify the attributes of a
character that is already on the display list.
The tag begins with a group of flags that indicate which fields are present in the tag.
The optional fields are def , matrix , cxform ,
ratio , clip and name .
The depth field is the only field that is always required.
The depth value determines the stacking order of the character. Characters with lower depth values
are displayed underneath characters with higher depth values. A depth value of 1 means the character
is displayed at the bottom of the stack. There can be only one character at any given depth.
This means a character that is already on the display list can be identified by its depth alone.
(i.e. a def is not required).
Flag Move and flag HasCharacter indicate whether a new character is being added to the display list,
or a character already on the display list is being modified. The meaning of the flags is as follows:
- PlaceFlagMove = 0 and PlaceFlagHasCharacter = 1
A new character (with ID of CharacterId) is placed on the display list at the specified Depth.
Other fields set the attributes of this new character.
- PlaceFlagMove = 1 and PlaceFlagHasCharacter = 0
The character at the specified Depth is modified. Other fields modify the attributes of this character.
Because there can be only one character at any given depth, no CharacterId is required.
- PlaceFlagMove = 1 and PlaceFlagHasCharacter = 1
The character at the specified Depth is removed, and a new character (with ID of CharacterId) is
placed at that depth. Other fields set the attributes of this new character.
The optional fields in PlaceObject2 have the following meaning:
- The
def field specifies the character to be added to the display list.
It only used only when a new character is being added. If a character that is already on
the display list is being modified, the def field is absent.
- The
matrix field specifies the position, scale and rotation of the character being added or modified.
- The
cxform field specifies the color effect applied to the character being added or modified.
- The
ratio field specifies a morph ratio for the character being added or modified.
This field applies only to characters defined with DefineMorphShape,
and controls how far the morph has progressed.
A ratio of zero displays the character at the start of the morph. A ratio of 65535 displays the character
at the end of the morph. For values between zero and 65535 the player interpolates between the start and end
shapes, and displays an 'in-between' shape.
- The
clip field specifies the top-most depth that will be masked by the character being added.
A clip of zero indicates no clipping.
- The
name field specifies a name for the character being added or modified. This field is typically used
with sprite characters, and is used to identify the sprite for SetTarget actions.
It allows the main movie (or other sprites) to perform actions inside the sprite.
author: Dmitry Skavish See Also: RemoveObject |