|
The problem is this : … correctButton.addEventListener("onRelease",
Delegate.create(controller, controller.correctButton_OnRelease)); solutionButton.addEventListener("onRelease",
Delegate.create(controller, controller.solutionButton_OnRelease)); nextButton.addEventListener("onRelease",
Delegate.create(controller, controller.nextButton_OnRelease)); … later on, I need to remove the listeners and for that
it seems I need an instance of each Delegate I created. correctButton.removeEventListener(“onRelease”,
controller) won’t work. I’ve been trying to change the
EventDispatcher class and add a function removeAllEventListeners, but I can’t
seem to make it work. What I would want is to say : correctButton.removeAllListeners à removes all listeners from
correctButton for all events ArpForm : class org.osflash.arp.ArpForm extends MovieClip { // // Properties // private static var eventDispatcherInitialized =
EventDispatcher.initialize(ArpForm.prototype); //////////////////////////////////////////////////////////////////////////// // Constructor //////////////////////////////////////////////////////////////////////////// public function ArpForm() { } … function addEventListener() { //
Used by EventDispather mixin } function removeEventListener() { //
Used by EventDispather mixin } function dispatchEvent() { //
Used by EventDispather mixin } function dispatchQueue() { //
Used by EventDispather mixin } function removeAllListeners() { } EventDispatcher : … static function initialize(object:Object):Void { if
(_fEventDispatcher == undefined) { _fEventDispatcher
= new EventDispatcher(); } object.addEventListener
= _fEventDispatcher.addEventListener; object.removeEventListener
= _fEventDispatcher.removeEventListener; object.dispatchEvent
= _fEventDispatcher.dispatchEvent; object.dispatchQueue
= _fEventDispatcher.dispatchQueue; object.removeAllListeners
= _fEventDispatcher.removeAllListeners; } … function removeAllListeners():Void{ for(var
i in this){ trace("i
: " + i); this[i]
= new Array(); } } Met vriendelijke groeten, // communicatie bij voorkeur op [EMAIL PROTECTED] |
_______________________________________________ osflash mailing list [email protected] http://osflash.org/mailman/listinfo/osflash_osflash.org
