1 Reply Latest reply on Oct 12, 2007 4:37 PM by Bearclaw

    Children of custom UIComponent don't display

    Bearclaw
      I'm creating a custom component using Actionscript that extends UIComponent and draws a circle with a label. Problem is circel draws just fine, but no label appears and no errors are generated.

      So to troubleshoot, I tried the same code only extending Canvas rather than UIComponent and everything worked exactly as expected. However, I'm going to have allot of instances of the component and need to avoid the overhead of a bunch of Canvas objects.

      Any thoughts? Thanks.
        • 1. Re: Children of custom UIComponent don't display
          Bearclaw Level 1
          Well, I think I found the answer to my own question. I'm posting it since I've seen a similar question from a number of people in this and other forums that got no replies. I know what I'm doing now works, but invite any disagreement that it's not the right way to display children within a custom component.

          Turns out that even though UIComponent can contain children, it only displays them if they are subclasses of DisplayObject - things like shape, sprite or in my case, TextField. Trying to use Label or anything from mx.* can be added as a child, but doesn't display or generate any errors.