Event Flex


    initialize="createListener(event)">
    
        import mx.controls.Alert;
        private function createListener(e:Event):void {
            b1.addEventListener(MouseEvent.CLICK, myClickHandler);
        }
        private function myClickHandler(e:Event):void {
            Alert.show("Triggered by the " + e.type + " event");
        }
      

            mouseOver="b1.dispatchEvent(new MouseEvent(MouseEvent.CLICK, true, false))" />