I am looking for a way to programmatically dissassoicate the click handler function from a button on my mxml component through actionscript code.
Something like what older actionscript let you do,
mybutton.click = null;
Thanks in advance
If you have the function that was registered as the listener:
mybutton.removeEventListener( 'click', theFunction );
If you don't... well, consider reorganizing the code? You might also be able to add another handler something like this:
mybutton.addEventListener( 'click', function( e:Event ):void {
e.stopImmediatePropagation();
return false;
}, false, 1 );
Which might prevent further handlers from running (the 1 at the end is the priority)... Hard to say sometimes with flex.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With