Hi, The next As2Lib release (will be published at the end of this week) will provide DelegateManager class allowed to manage this issue. You can check it out from the CVS right now.
Regards, Igor -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of daniele | mentegrafica.it Sent: Thursday, February 23, 2006 3:00 PM To: [email protected] Subject: Re: [osflash] addEventListener --> removeAllListenersEventDispatcher class Hello, this is a sample class to illustrate you the way to manage EventListeners: ************* import mx.utils.Delegate ; import mx.controls.Button ; class myClass extends MovieClip { private var myListenerHandler:Function ; private var btn:Button ; function myClass() { myListenerHandler = Delegate.create(this,onBtnClick) } function onLoad() { super.onLoad() ; btn.addEventListener("click",myListenerHandler) ; } private function onBtnClick(p_evt:Object) { trace("IT WORKS ONLY ON FIRST CLICK") ; btn.removeEventListener("click",myListenerHandler) ; } } ************* Have a nice day, -- dott. daniele galiffa multimedia designer and developer Macromedia FlashMX Developer Certified [EMAIL PROTECTED] _______________________________________________ osflash mailing list [email protected] http://osflash.org/mailman/listinfo/osflash_osflash.org _______________________________________________ osflash mailing list [email protected] http://osflash.org/mailman/listinfo/osflash_osflash.org
