tags:

views:

39

answers:

2

hi,

I've some components with dynamic heights. They have to be aligned with respect to the bottom of my canvas container, so I cannot set the same y for all components.

I could compute their heights and successively set the y but I was wondering if there was an easier way to do it.

thanks

A: 

depending on what the component is you may be able to set the rotationY to 180, which would flip it up. So as long as it would look okay upside down this might work.

invertedSpear
no I cannot rotate it :) I guess the only solution is to compute the height of the component and add it to the y value.
Patrick
+2  A: 

You can use the bottom style of the component, but if they are stacked you'll still have to compute heights. This is something you get for free if you put your stack of components into a VBox (or Box with direction=vertical). You can position the VBox wherever you want it on the canvas and set the bottom style of that to be whatever height you want from the bottom. Don't set a height on the VBox and it will just grow as big as it needs to be from the bottom.

Robusto
mhm for some reason I cannot set the bottom component from actionscript VBox(newUser).bottom = 20; I also tried to cast my component (a VBox) but the bottom property is not found. What's wrong ?
Patrick
oh ok, I solved by adding bottom="20" directly into MXML. Thanks! But why it didn't work in actionscript ?
Patrick
Because "bottom" is a style, not a property. You should use `myComponent.setStyle("bottom","20")` or put the rule into CSS. My fault for calling it a property. (D'oh!) I'll edit to change that.
Robusto