# Removing eventlistener from deleted instance

**URL:** <https://forum.kirupa.com/t/removing-eventlistener-from-deleted-instance/303304>\
**Category:** flash\
**Created:** [January 18, 2010, 2:40pm UTC](https://forum.kirupa.com/t/removing-eventlistener-from-deleted-instance/303304 "2010-01-18T14:40:29Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Maqrkk](https://avatars.discourse-cdn.com/v4/letter/m/35a633/32.png) [@Maqrkk](https://forum.kirupa.com/u/Maqrkk)\
**Post date:** [January 18, 2010, 2:40pm UTC](https://forum.kirupa.com/t/removing-eventlistener-from-deleted-instance/303304/1 "2010-01-18T14:40:29Z")

</div>

Hey all,

in my main I have a system that allowed certain classes to be loaded and unloaded. When I load Game.as, it contains a trace statement when you press the left arrow key. When I remove the game instance from the stage, and set it to null, I can still press left arrow key, and the trace will come up. If I then make a new instance of game, it traces twice with only 1 click. When I close/load another time it traces three times. How is this possible?

I very specifically set:

```auto
mainContent.removeChild(game);
game = null;

```

Even trace statements confirmed that the game was being nullified, and the trace still continued. Any idea what’s causing this, and how I can prevent it?
