mikemo » Setting the width and height of a pure-ActionScript application

Super dad movies Add comments

Setting the width and height of a pure-ActionScript application

Posted June 27, 2006

For a Flex project with MXML files, it is obvious how to set the width and height of the project:

<mx:Application width=“300″ height=“200″>

But for pure-ActionScript projects, it isn’t so obvious. The way to do it is to use the SWF metadata attribute above the declaration of the class:

package  {  [SWF(width="300", height="200")]  public class MyApp extends Sprite  {}  }

The values specified there are pixel sizes; in this context, you are not allowed to use percentage values such as 100%.

And you can also set the framerate and color like this;
[SWF(width="300", height="200", frameRate="18", backgroundColor="#FFFFFF")]

Posted via web from wiibart’s posterous



Leave a Reply

WP Theme & Icons by N.Design Studio
Entries RSS Comments RSS Log in