Amcom Home Page

 Flex 3 to Flex 4 migration tidbit: Enhanced Constraints

Flex 4 of course introduces the new line of Spark components that replace the Flex 3 based Halo ones - although you can use Halo and Spark containers/components together.

One interesting tidbit is that both Halo and Spark support the notion of constraints, which is an option you can use for visual layout, by being able to anchor visual components from the edges or center of containers. E.g.

<s:Button label="Hello!" bottom="5" right="5"/>

That above example would anchor the button to the bottom right, regardless if the user resizes the browser.

However, as far as I know there's no Spark container that supports enhanced constraints. You would still use the mx:Canvas Halo container. E.g.:

<mx:Canvas width="100%" height="100%">
<mx:ConstraintColumn id="col1" width="200"/>
<mx:ConstraintColumn id="col2" width="50" />
<s:Button label="Button 1" left="col1:0"/>
<s:Button label="Button 2" left="col2:0"/>

Comments (Comment Moderation is enabled. Your comment will not appear until approved.)

BlogCFC was created by Raymond Camden. This blog is running version 5.9.002. Contact Blog Owner