Although normal children of a Container must be a IUIComponent, you can add a 
plain Sprite as a "raw child" of a Container:

var s:Sprite = new Sprite();
// draw into s.graphics
// set s.x, s.y, s.width, and s.height
myContainer.rawChildren.addChild(s);

A raw child doesn't get managed by the LayoutManager, so you must position and 
size it yourself.

Gordon Smith
Adobe Flex SDK Team

From: [email protected] [mailto:[EMAIL PROTECTED] On Behalf Of Tracy 
Spratt
Sent: Thursday, October 16, 2008 11:07 AM
To: [email protected]
Subject: RE: [flexcoders] Re: Efficiency and objects in the display list

I think that is correct.  Quoting Alex, "Navigator children must be Containers, 
Container children must be IUIComponents, and UIComponent children can be 
anything."
Tracy

________________________________
From: [email protected] [mailto:[EMAIL PROTECTED] On Behalf Of Amy
Sent: Wednesday, October 15, 2008 11:36 PM
To: [email protected]
Subject: [flexcoders] Re: Efficiency and objects in the display list


--- In [email protected]<mailto:flexcoders%40yahoogroups.com>, "Tracy 
Spratt" <[EMAIL PROTECTED]> wrote:
>
> Container children must be UIComponents. You will need to add the
> sprites to a UIComponent first.

I think technically there's just an interface that has to be
implemented on whatever you add (IFlexDisplayObject? IUIComponent?).
If you extend Sprite or whatever and implement whichever one is needed,
you could add it to a container.

-Amy

Reply via email to