# Delete class definition from loaded swf

**URL:** <https://forum.kirupa.com/t/delete-class-definition-from-loaded-swf/303591>\
**Category:** flash\
**Created:** [January 22, 2010, 8:05pm UTC](https://forum.kirupa.com/t/delete-class-definition-from-loaded-swf/303591 "2010-01-22T20:05:06Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![RubenFlash](https://avatars.discourse-cdn.com/v4/letter/r/839c29/32.png) [@RubenFlash](https://forum.kirupa.com/u/RubenFlash)\
**Post date:** [January 22, 2010, 8:05pm UTC](https://forum.kirupa.com/t/delete-class-definition-from-loaded-swf/303591/1 "2010-01-22T20:05:06Z")

</div>

Hi!

Something that’s been bugging me is the fact that I can’t seem to remove exported library symbols from memory, if those symbols are from a loaded swf. For example:

```auto

//load an swf using Loader
swfLoader.load("mySwf.swf");

//after loaded use library symbol from said swf
var loadedSwfClass:Class = getDefinitionByName('IndentifierName') as Class;
var tempFieldContainer:Class = new loadedSwfClass();
tempFieldContainer.name = 'something';
stage.addChild(tempFieldContainer);

//remove references and unload swf
stage.removeChild(stage.getChildByName('something'));
tempFieldContainer = null;
loadedSwfClass = null;
swfLoader.unloadAndStop(true);

//it's still there!
var loadedSwfClass:Class = getDefinitionByName('IndentifierName') as Class;
var tempFieldContainer:Class = new loadedSwfClass();
stage.addChild(tempFieldContainer);

```

Everything is removed but the class definition still remains! Ideas?
