-
How can I remove eventlistener from the stage?
Hi,
I have a main swf file which loads another swf file.
From the loaded swf file I add a keyboard event listener to the stage.
When I remove the loaded SWF from the main file the keyboard event listener is still active on the stage.
How can I remove the event listener from the stage within the main swf file?
Thank you.
-
I think this is probably the only way.
Remove all listeners and timers when the swf file is removed from the stage.
addEventListener(Event.REMOVED_FROM_STAGE, onRemove);
function onRemove(e:Event):void
{
stage.removeEventListener(KeyboardEvent.KEY_DOWN, keyDownHandler);
stage.removeEventListener(KeyboardEvent.KEY_UP, keyUpHandler);
clearInterval(nInterval);
}
so clean your own mess
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|