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

    Get parent container size in renderer?

    garry.b
      Hi,

      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:HorizontalList>
      <mx:Canvas height="100%" width="40%" >
      </mx:Canvas>
      </mx:HBox>

      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