DefineSprite

Tag Info
Tag Number: 
39
Tag Type: 
Define
Tag Flash Version: 
3
Unknown SWF Tag: 
This tag is defined by the Flash documentation by Adobe
Brief Description: 

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.

Tag Structure: 
struct swf_definesprite {
	swf_tag			f_tag;		/* 39 */
	unsigned short		f_sprite_id;
	unsigned short		f_frame_count;
	...			<data>;
	swf_tag			f_end;
};

A sprite is a set of SWF tags defining an animated object which can then be used as a simple object. A sprite cannot contain another sprite. hHowever, you can use PlaceObject2 to place a sprite in another.

The following are the tags accepted in a Sprite:

DoAction
End
FrameLabel
PlaceObject
PlaceObject2
PlaceObject3
RemoveObject
RemoveObject2
ShowFrame
SoundStreamBlock
SoundStreamHead
SoundStreamHead2
StartSound

The data array of tags should always be terminated by an End tag though this can be inferred some players may not support a non-terminated list.

In order to initialize a sprite once, you can use the DoInitAction. This tag comes along (after) a DefineSprite tag and not inside it.

Note that in newer animations (since version 5,) it is possible to load a movie using an external link. Adobe calls them movies, although, really, once loaded, they are sprites. Those sprites can include all sorts of tags since it is the same as a complete Flash animation. The same concept is also available via ActionScript, i.e. you can create a new movie which in fact is a Sprite.