States are still available in the MX way.  You can also hide and show instead 
of add and remove.

Known children should be created in createChildren or in states.  But 
otherwise, you have to create them when you know you need them.  The List 
components create them in updateDisplayList since that’s when they finally know 
how many to create.

On 9/6/11 10:48 AM, "Nick Middleweek" <> wrote:

Thanks for this... So I'm extending UIComponent, does this mean I'm doing it 
the MX way?


On 6 September 2011 14:38, Haykel BEN JEMIA <> wrote:

Hi Nick,

if you use Spark components and the child components you want to add are fixed 
and known, e.g. a 'close' button that should be visible on mouse-over, then I 
would use skin states and manage visibility of the components in the skin.

Haykel Ben Jemia

Web & RIA Development

On Tue, Sep 6, 2011 at 10:28 AM, Nick Middleweek <> wrote:


I've been trying to find the correct 'place' to create new components after the 
parent component is UPDATE_COMPLETE.

During initialisation, we create child components in createChildren() but 
where/ when should we create them for e.g. in response to a mouseOver or a 
mouseClick event?

Is it simply 'ok' to this.addChild( myNewButton ) in a MOUSE_EVENT function 
handler or should I be setting some dirty flag to trigger off an invalidation 
and then add the button in a lifecycle override function?


Alex Harui
Flex SDK Team
Adobe System, Inc.

Reply via email to