1 Reply Latest reply on Mar 17, 2009 2:54 PM by -Hob

    Get parent container size in renderer?


      I'm trying to add a variable number of same-sized Canvas squares to the HorizontalList below:

      <mx:HBox width="100%" height="50%" >
      <mx:HorizontalList height="100%" width="60%" dataProvider="{myData}"
      itemRenderer="renderers.Topic" >
      <mx:Canvas height="100%" width="40%" >

      I want the squares to be proportional such that as the app is resized, the squares also grow or shrink in size. My item renderer gets the size of the parent HorizontalList (via BaseListData.owner.width) in order to calculate the dimensions of each canvas square; as the app is resized, the size of the parent changes and my square's dimensions are recalculated. However, it seems that the size of the parent container isn't know until I render some content but I can't render content until I know the amount of real estate available in the parent. I missing something basic here, right?

      Thanks, Garry