tags:

views:

170

answers:

2

hi,

I have a canvas with a mxml component and I'm dynamically adding components to the canvas.

These components are overlying the mxml component. How can I keep the mxml component on top ?

thanks

A: 

Lay down a container component (VBox/HBox or similar), then your component. Then add the new items to the container that lies under the MXML component, as follows:

Canvas
|
----------------VBox
|               |
|               |
----MXMLComp    ----Dynamic added component
                |
                |
                ----Dynamic added component
spender
I've a canvas and I added my component to it (in MXML). Then I dynamically add LinkButtons to the canvas (on which my component lies). So, I guess, I'm doing what you suggest.
Patrick
No, you're not. You're adding all items to a single container. I'll update my answer.
spender
A: 

I've solved with

canvas.setChildIndex(dragPanel,canvas.getChildren().length-1);
Patrick