This content has been marked as final. Show 3 replies
Anyone ? Please.
How to place a dynamic button into a dynamic panel with specific x and y coordinates?
You can't set dimensions, or x,y using setStyle, since they are properties.
To explicitly place a component, you need a container that has absolute positioning. This can be a canvas, or a Panel with layout="absolute"
If you need both, wrap the vertical layout component in an absolute one.
Also look into contraint-based layout, if you haven't yet. using that you can specify, for instance, botton="5"
I do think this is a functionality that would be useful: Being able to position components, including z-order and visibility in style.
You can accomplish similar stuff using the live compiler and config files, but from a 'pawn that off on the CSS design guy' mentality it would be nice.
As far as your dynamic panel, you can use something like FlowBox or Flowsomething in the Flexlib on google to have things auto position, and then use setChildIndex to move them around and watch them reflow.
But in general, you will use Canvas for absolute positioning, and simply put one of those into your Panel (or panel) and set the x and y of your new component in AS.
So for instance in the above, you would simply do:
g.x = 10;
g.y = -5;