views:

327

answers:

1

I have created a graph component in AS3 which extends UIComponent. I created an mxml component which is just a Label. The idea is to use the label component to show the values on the graph when you hover over points.

I have tried two approaches.

  1. Create the Label component using ClassFactory inside the graph so it gets created in the graph component and addChild is called there. The problem is it is always 0 in size.

  2. Create in main mxml file and pass in to graph using a setter, the sizing is perfect but the x an y dont relate to my graph :(

I suppose its similar to flex and itemrenderers, but in my case i have a graph and another component which can be changed, at the moment it is just a Label.

Thanks

Neil

A: 

The problem was, because I was extending UIComponent, I was responsible for both sizing and layout of the children. So I written the required code to size the label based on the text that was inside it.

Neil