How can i build an app with Flash Builder that auto adjust the size of each item

53 Views Asked by At

In Flash Builder does there exist some property that works similar to WRAP_CONTENT, FILL_PARENT and MATCH_PARENT of Android?

1

There are 1 best solutions below

1
Gurtej Singh On

Flash builder does not have such properties as such, and Flex containers typically achieve this by using percentages for the width and height attributes. For example:

<s:Group width="100%" height="100%">
    <s:Rect width="50%" height="100%">
        <s:fill>
            <s:SolidColor color="0xff6600"/>
        </s:fill>
    </s:Rect>
</s:Group>

will create a container of width 100% (respective to it's parent) and height 100%, and the orange rectangle within this container will be 50% of it's parent's width, and height 100%.

So, if the container is 500px, the orange rectangle will be 250px (50%) of its width.

Hope this helps. Thanks.