Abort an event and start another event

83 Views Asked by At

in flex application i have a button and two functions in action script... wat i wan is when i click the button it has to call a function and Abort and call another function simultaneously....I hope You guys caught wat i wanna convey...thanxx:-)

1

There are 1 best solutions below

0
On

Please see Sample

<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute"
    creationComplete="{appCreationComplete()}"
    >
    <mx:Script>
        <![CDATA[
            import mx.controls.Alert;

            private function appCreationComplete():void
            {
                btn.addEventListener(MouseEvent.CLICK,clickHandlerA);
                btn.addEventListener(MouseEvent.CLICK,clickHandlerB);

            }

            private function clickHandlerA(event:MouseEvent):void
            {
                Alert.show("clickHandlerA");
            }

            private function clickHandlerB(event:MouseEvent):void
            {
                Alert.show("clickHandlerB");
            }

        ]]>
    </mx:Script>
    <mx:Button id="btn" label="Click me"/>
</mx:Application>

In this sample On Applocation CreationComplete we are binding two event handler to button

Hopes that helps