Event Flex


 

    xmlns:mx="library://ns.adobe.com/flex/mx"
    xmlns:s="library://ns.adobe.com/flex/spark">
    
         
        import spark.components.Button; 
        public function addButton():void { 
            var myButton:Button = new Button(); 
            myButton.label = "New Button"; 
            myGroup.addElement(myButton); 
        }