Skip to content

Setting a maximum width and height on a WindowedApplication container in Adobe AIR

by Peter deHaan on January 19th, 2009

The following example shows how you can set a maximum width and height on a Adobe AIR application by setting the maxWidth and maxHeight properties on the WindowedApplication tag.

Full code after the jump.

<?xml version="1.0" encoding="utf-8"?>
<!-- http://airexamples.com/2009/01/19/setting-a-maximum-width-and-height-on-a-windowedapplication-container-in-adobe-air/ -->
<mx:WindowedApplication name="WindowedApplication_maxWidth_test"
        xmlns:mx="http://www.adobe.com/2006/mxml"
        layout="vertical"
        verticalAlign="middle"
        backgroundColor="white"
        maxWidth="800"
        maxHeight="600"
        width="550"
        height="400">
 
    <mx:Form>
        <mx:FormItem label="width:">
            <mx:Label text="{this.width}" />
        </mx:FormItem>
        <mx:FormItem label="height:">
            <mx:Label text="{this.height}" />
        </mx:FormItem>
    </mx:Form>
 
</mx:WindowedApplication>
One Comment
  1. kiddo permalink

    Are you kidding me? A post for setting a maxwidth property on a tag? Shouldn’t you have a post about regular width, id, etc. I’m being ironic if you’re not getting it…
    Would like to see a little more advanced examples, I prefer code…

Leave a Reply

Note: XHTML is allowed. Your email address will never be published.

Subscribe to this comment feed via RSS