# removeChild when Child is type Class

**URL:** https://forum.kirupa.com/t/removechild-when-child-is-type-class/293119
**Category:** flash
**Created:** [July 23, 2009, 11:46am UTC](https://forum.kirupa.com/t/removechild-when-child-is-type-class/293119 "2009-07-23T11:46:42Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![screeg](https://avatars.discourse-cdn.com/v4/letter/s/ccd318/32.png) [@screeg](https://forum.kirupa.com/u/screeg)
#### Post date: [July 23, 2009, 11:46am UTC](https://forum.kirupa.com/t/removechild-when-child-is-type-class/293119/1 "2009-07-23T11:46:42Z")

</div>

I’m working on a game where I’m adding a symbol (an enemy unit) from the Library via addChild() to an instance on the Stage. The symbol has Linkage/Class enabled so I can stick stat variables directly on it for easy access.

The problem is that I want to use the same name for enemies (like en0, en1) in different areas, but if I try to removeChild(), I get Error 1067: Implicit coercion of type Class to type DisplayObject.

Ideas, workarounds?
