Event Flex


    xmlns:mx="http://www.adobe.com/2006/mxml" 
    xmlns:s="library://ns.adobe.com/flex/spark">
    
    
        
            import spark.components.Button;
            import spark.events.ElementExistenceEvent;
            private function handleElementAdd( evt:ElementExistenceEvent ):void
            {
                trace( (evt.element as Button).label + " has been added." ); 
            }