Skip to content


Setting minHeight/minWidth on Adobe Air app forces ViewStack creationPolicy to ALL : or at least I think so.

I guess it’s been a real busy couple of months for me as I haven’t managed to post anything since December. Here is a little gotcha that I ran across while converting a Flex App to an Adobe Air app.

In my application and the main WindowedApplication contains a ViewStack and a ViewController. Inside the ViewStack are the various MXML views which make up the application. When my application was just a Flex app I sized the application to 100% width/height in the html-template file. However for my Air application it is necessary to set a minimum width/height on launch and let the user decide if they want to maximize the window or set a custom size.

The gotcha came when I set minWidth and minHeight on the new WindowedApplication. This apparently sets the creationPolicy to ‘ ALL ‘ on the parent and thus is inherited by the ViewStack.

If no creationPolicy is specified for a container, that container inherits its parent’s creationPolicy. If no creationPolicy is specified for the Application, it defaults to ContainerCreationPolicy.AUTO.

So the moral of this story is. If you set minHeight/minWidth on a WindowedApplication consider the desired creationPolicy for children. If you don’t want all children to be automatically created when the application is launched then you’ll need to adjust the creationPolicy for child containers manually to ‘ auto ‘ or ‘ none ‘.

Posted in Actionscript, Code.

Tagged with , , .


0 Responses

Stay in touch with the conversation, subscribe to the RSS feed for comments on this post.



Some HTML is OK

or, reply to this post via trackback.



close