Search Flex Components Free

Custom Search

December 25, 2007

Flex Constraint-Based Layout Source Code

Flex Constraint-Based Layout Sample Source Code: /span>

Create a file:

<?xml version="1.0" encoding="utf-8"?>

<mx:Application xmlns:mx="" backgroundAlpha="0">

<mx:Canvas width="100%" height="100%" >

<mx:Text width="100%" height="100%" fontSize="14" left="12" top="12">

A layout constraint is applied to this text to always position it in the upper left corner of the Canvas with a top and a left margin of 12 pixels.
Another layout constraint is applied to the HBox containing the OK and Cancel buttons to always position them in the bottom right corner of the Canvas.
You can resize the browser window to experiment with the behavior of this layout.


<mx:HBox right="12" bottom="12" >

<mx:Button label="OK"/>
<mx:Button label="Cancel"/>




Related Flex Tutorials