2 Replies Latest reply on Apr 22, 2010 10:16 AM by Flex harUI

    Event handler for an HBox

    SiHoop Level 1

      I'm trying to calculate the width of an HBox after a component has been loaded into it. What event handler will tell me that an object has been added to an HBox?


      <?xml version="1.0" encoding="utf-8"?>
      <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute"   applicationComplete="init()">
      public function init():void{
          for(var i:int=0; i<5;i++){
              var panel1:MainPanel=new MainPanel;
              hbox.addEventListener(XXXXXXXXXXXXXXXXX, handlePanel1Load)

      public function handlePanel1Load(e:Event):void{
            <mx:Canvas id="hbox"  borderColor="0xffff00"  backgroundColor="0xdddddd" horizontalCenter="0" verticalCenter="0"  borderStyle="solid"/>