Wednesday, May 5, 2010

The undocumented [SWF] Metadata Tag

In Flash authoring environment, developer can control actual width, height, frame rate properties of SWF. But in Flex project, these setting can be configured as a properties of Application MXML tag. Where as in ActionScript project using Flex Builder, this complier setting can be configured using undocumented [SWF] metadata.
[SWF(width='1024', height='768', frameRate='24' backgroundColor='#CCCCCC')]
Following are the list of properties that can be set using undocumented [SWF] Metadata
PropertyDescription

backgroundColor
This property is use to set background color of the stage.

pageTitle
String used to represent the title of HTML page

frameRate
This property is use to set frame rate of SWF file

width
This property is use to set the width of stage

height
This property is use to set the height of stage

widthPercentage
This property is use to set the width of stage with respect to inner
browser width.
Note: Value specified for this property needs to be appended by '%' sign.

heightPercentage
This property is use to set the height of stage with respect to inner browser height.
Note: Value specified for this property needs to be appended by '%' sign.

scriptRecursionLimit
The maximum depth or stack overflow limit of flash player, i.e., number of time a recursive script will run before flash player stops.
scriptTimeLimitMaximum duration, in seconds, that an ActionScript event listener can execute before Flash Player assume that it has stopped processing and abort it. The default value is 60 second, which is also the maximum allowable value.
These properties convey instruction to Flex compiler about how to publish SWF application. backgroundColor,pageTitle, widthPercentage, heightPercentage properties are used by Flex compiler for creating HTML wrapper, while width, height, widthPercentage, heightPercentage, scriptRecursionLimit, scriptTimeLimitproperties are used by Flex compiler for creating of SWF.
Note: Some of this properties can also be configure via compiler option in project properties settings.

1 comment: