views:

28

answers:

1

Hi, I need help to add childs to canvas. I want to add childs to canvas in top-down direction and left-right direction? I'm using the addChild function but I don't want to calculate the X and the Y for each Item. is there a way to do that?

A: 

You can add a mx:HBox or a mx:VBox to your canvas.

These components lay their children out like you require:

<mx:Canvas width="100%" height="100%">
    <mx:VBox id="verticalLayout" width="100%" height="100%" />
</mx:Canvas>

Calling "addChild" on the "verticalLayout" component will add each child under the previous.

Richie_W
Using Tile would be a better option since the OP mentioned top-down and left-right direction.
kubarium