Is possible to remove an event listener in actionscript 3 (flash) ??
- by DomingoSL
In the frame 1 of my movie, part of my code is:
stage.addEventListener(Event.RESIZE, resizeHandler);
It works all fine, but when i go to the frame 2 the listener is still there but the function resizeHandler is not anymore (and i dont want it). So the console output this:
TypeError: Error #1009: Cannot access
a property or method of a null object
reference. at
index_fla::MainTimeline/resizeHandler()
at
flash.events::EventDispatcher/dispatchEventFunction()
at
flash.events::EventDispatcher/dispatchEvent()
at
flash.display::Stage/dispatchEvent()
at index_fla::MainTimeline/frame2()
Is possible to remove the event listener on the frame 2? Thanks!!!