sprite Element

The sprite element allows creating movie clips in ActiveSWF projects. Also movie clips can be loaded into ActiveSWF project from external images or Flash movies.
The sprite element supports loading external images in WMF format and conversion of them to Flash movie clips in vector format.
External raster images are converted to Flash movie clips with only specified raster image embedded.

Syntax

<sprite id="objectId" [src="url"] [name="spriteName"] [width="spriteWidth"] [height="spriteHeight"]
          [exportAsRaster="exportAsRaster"] [clipped="isMasked"] [lockroot="lockRoot"] >
  <content>
    <!-- Binary content in Base64 format -->
  </content>
  <styles>
    <!-- Defining styles -->
    ...
  </styles>
  <objects>
    <!-- Defining objects -->
    ...
  </objects>
  <layers>
    <!-- Showing and modifying objects -->
    ...
  </layers>
</sprite>

Attributes

Name

Description

Value type

Optional

Default Value

id

Object identifier

id

no

-

src

External rester image or vector WMF image or SWF movie file name may be specified here to be embeded into sprite. If WMF image file name is specified, WMF image is converted to vector shapes in resulting SWF movie.

Use following notation for src attribute:
For resources located in local filesystem: "C:\My folder\myflashmovie.swf"
For web resources use HTTP URLs: "http://mysite.com/myimage.gif"

If both src attribute and content element are specified, content is ignored.

string

yes

-

name

If specified, it will be possible to instantiate the sprite via ActionScript using MovieClip.attachMovie method.

string

yes

-

width

Width of the sprite. If src attribute points to a SWF file and clipped attribute is set to "true" then width attribute controls width of the clipping rectangle.

If src attribute points to a WMF file:

  • If specified, WMF image will be resized horizontally to the specified width.
  • If not specified, or set to "0" WMF image will be converted with original width.

integer

yes

0

height

Height of the sprite. If src attribute points to a SWF file and clipped attribute is set to "true" then height attribute controls height of the clipping rectangle.

If src attribute points to a WMF file:

  • If specified, WMF image will be resized vertically to the specified height.
  • If not specified, or set to "0" WMF image will be converted with original height.

integer

yes

0

exportAsRaster

Used only if src attribute points to a WMF file. If set to true WMF image will not be converted to vector graphics and appear rasterized in resulting SWF movie.

boolean

yes

false

clipped

Used only if src attribute points to SWF file. If set to "true", embedded Flash movie will be clipped / masked with rectangle sized by values specified in width and height attributes.

boolean

yes

true

lockroot

When embedding external SWF movie into sprite enables/disables root movie access from ActionScript using _root variable in embedded sprite.

boolean

yes

true

Parent Elements

objects collection

Children Elements

content element, styles collection, objects collection, layers collection,

See Also

XML Schema Reference, objects collection.