Event Flex



    
    
        
        import flash.events.MouseEvent;
               
        private function init(e:Event):void 
        {
            myButton.addEventListener(MouseEvent.CLICK,clickBtn_1);          
            myPanel.addEventListener(MouseEvent.CLICK,clickPanel);
           
        }
        
        private function clickBtn_1(evt:MouseEvent):void
        {
            myText.text += "Button 1 clicked !";   
            
            evt.stopImmediatePropagation();         
        }
        
        private function clickPanel(evt:MouseEvent):void
        {
             myText.text += "Panel clicked";
        }