movie Element

The movie element is a root element of the flash movie described. Includes all tags that describe child elements of a movie, their styles, order of appearance, and possible transformations.

Syntax

<movie [width="objectWidth"] [height="objectHeight"]
            [frameRate="objectFrameRate"] [bgColor="color"]
            [SWFVersion="versionOfTargetSWF"] [compressed="shouldBeCompressed"]
            [useNetwork="canUseNetwork"] [saveObjectsFirts="saveObjectsFirst"]


  <styles>
    <!-- Defining styles -->
    ...
  </styles>


  <objects>
    <!-- Defining objects -->
    ...
  </objects>


  <layers>
    <!-- Showing and modifying objects -->
    ...
  </layers>


</movie>

Attributes

Name

Description

Value type

Optional

Default Value

width

Defines movie clip width in pixels or twips.

coordinate

yes

550px

height

Defines movie clip height in pixels or twips.

coordinate

yes

400px

frameRate

Defines movie clip frame rate (FPS, frames per second). Positive value more than 0.0 up to 255.0

float

yes

12

bgColor

Defines movie clip background color.

color

yes

#FFFFFF

SWFVersion

Defines SWF file format version. Possible values are: 4, 5, 6, 7, 8, 9, 10

integer

yes

6

compressed

SWF content generated will be compressed using ZLIB algoruthm. Supported only by Flash Player version 6 and above.

boolean

yes

false

saveObjectsFirst

If set to true, ActiveSWF will store all objects declared in XML objects collection in the beginning of SWF file. Object will be stored into SWF file even if they are not used / instantiated. This might be useful if you just need to embed resources into Flash file and manipulate them via ActionScript.

If set to false, objects will appear in generated SWF file in the same frame they are used (via show, startSound tags, etc). This is useful for large Flash movies and allows stream-like loading of Flash movies so users will see Flash contents as soon as possible.

boolean

yes

true

useNetwork

Setting this property to true gives the same effect as setting "Local Playback Security" option to "Access network files only" in Adobe Flash Publish Settings. Please look at Flash documentation for more information.

boolean

yes

true

Description

A movie is a starting point in ActiveSWF XML descriptions of flash movies.

Child Elements

The following elements occur in movie: styles collection, objects collection, layers collection.

Remarks

If we set SWFVersion value to 6 and above, all character data in movie generated will be provided in UTF-8. When we generate movie with SWFVersion set to 5 all character data are converted to ANSI using system default locale on the computer where ActiveSWF is running.

Example Code

<?xml version="1.0" encoding="UTF-8"?>
<movie width="400px" height="400px" frameRate="5" bgColor="#EEEEEE">
  <styles>
    <lineStyle id="redLine" color="red" width="1"/>
    <solidFillStyle id="blueFill" color="blue"/>
  </styles>
  <objects>
    <rectangle id="rect1" x="5" y="5" width="200" height="200" lineStyle="redLine" fillStyle="blueFill"/>
  </objects>
  <layers>
    <layer>
      <frame index="0">
        <show objectId="rect1" id="showRect1" scaleX="1"/>
      </frame>
      <frame index="5">
        <hide showId="showRect1"/>
      </frame>
      <frame index="5"/>
    </layer>
  </layers>
</movie>

The example above describes a flash movie 400x400 pixels. The movie will display a blue rectangle 200x200 pixels with a red frame 1 pixel wide. The rectangle is visible for one second, then it disappears for one second. If you loop the movie playback in your flash player, the rectangle will blink.

See Also

XML Schema Reference, styles collection, objects collection, layers collection