2 Replies Latest reply on Jan 20, 2010 6:22 AM by harsh_hot

    how to position hbox

    harsh_hot

      Friends,

       

      My requirement is that inside a loop i am trying to create hbox and wants all the hboxes to be aligned from left to right on the panel i.e I want to position the hbox according to my wish. RIght now, all the hboxes are being created one below the other and i dont know how to control their positioning on the panel. Please  suggest how to position hboxes onto the panel in any way.

       

      Please also note that i am creating these hboxes through script.

        • 1. Re: how to position hbox
          archemedia Level 4

          The Panel component has a layout property which defines how its children will be positioned. The default value of this property is "vertical". If you change it to "absolute", you can put your VBoxes anywhere you want in the Panel.

           

          private function addBoxesToPanel():void

          {

                   var myBox:VBox = new VBox();

                    myBox.x = 245;

                    myBox.y = 87;

                    myPanel.addChild(myBox);

          }

           

          ...

           

           

          <mx:Panel id="myPanel" layout="absolute"/>

           

          Does this help you out?

           

          Dany

          • 2. Re: how to position hbox
            harsh_hot Level 1

            Thanks a ton Dany!!