tags:

views:

133

answers:

2

As the title suggests, is there any way to bottom-left align components?

An <HBox .../> nested in a <Canvas .../> doesn't work because the elements in the HBox are top-aligned instead of bottom aligned.

For example, I'd like my components to be aligned like this:

+-------------+ <-- container
| components  |
|  |    V     |
|  V  +--+    |
| +-+ |  |    |
| +-+ +--+    |
+-------------+
A: 

Extend the HBox and/or Box to change the positioning. I suspect you'll probably have to override the updateDisplayList method to change the way components are positioned. Probably instead of setting the y value as "0" you'll want to set it to unscaledHeight-component.width.

www.Flextras.com
This seems like overkill.
quoo
If the veritalAlign style works w/ HBoxes, you're right; this is serious overkill.
www.Flextras.com
+2  A: 

You just need to set the verticalAlign and horizontalAlign styles on the hbox ie:

<mx:Canvas>
<mx:HBox verticalAlign="bottom" horizontalAlign="left" left="0" bottom="0"> </mx:HBox>
</mx:Canvas>
quoo
Ah, perfect. I wish I knew why I missed the "verticalAlign" property.
David Wolever