Archive for February, 2009

SWF metadata in pure AS3 projects

Wednesday, February 11th, 2009

When creating pure AS3 projects a metadata is required to define how the swf functions. This metadata is inserted after your import statements and before the main class definiton.

Here are the parameters you can use with the swf metadata tag:

[SWF(width=”x”,
height=”x”,
widthPercent=”x”,
heightPercent=”x”,
scriptRecursionLimit=”x”,
scriptTimeLimit=”x”,
frameRate=”x”,
backgroundColor=”x”,
pageTitle=”x”)]

Example usage:

package  {
	import flash.display.Sprite;
	[SWF(backgroundColor="#FFFFFF", frameRate="30",
		width="550", height="400")]
	public class Main extends Sprite {

	}
}