# Delete a level in memory

**URL:** https://forum.kirupa.com/t/delete-a-level-in-memory/250851
**Category:** programming
**Created:** [February 2, 2008, 4:16am UTC](https://forum.kirupa.com/t/delete-a-level-in-memory/250851 "2008-02-02T04:16:46Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![chaudan](https://avatars.discourse-cdn.com/v4/letter/c/9f8e36/32.png) [@chaudan](https://forum.kirupa.com/u/chaudan)
#### Post date: [February 2, 2008, 4:16am UTC](https://forum.kirupa.com/t/delete-a-level-in-memory/250851/1 "2008-02-02T04:16:46Z")

</div>

Hi all, i’m developing a game where a level is created on a certain frame on the timeline. The level is described in an external .as file. So lets say at frame 5, i just did a

var level = new level();

At the end of the level, in the level code itself, I make the timeline jump to a to lets say frame 10, signifying the end of the level. The problem is, the eventlisteners and whatnot that I created in the level seem to be still existing. On frame 10, i set the level variable to null, but i can still hear the sounds triggered by my event listeners in the level class.

How do I completely remove the level from memory?

Thanks!
