# Destroying instances

**URL:** https://forum.kirupa.com/t/destroying-instances/248174
**Category:** flash
**Created:** [January 4, 2008, 4:30pm UTC](https://forum.kirupa.com/t/destroying-instances/248174 "2008-01-04T16:30:44Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![Miguelele](https://avatars.discourse-cdn.com/v4/letter/m/6a8cbe/32.png) [@Miguelele](https://forum.kirupa.com/u/Miguelele)
#### Post date: [January 4, 2008, 4:30pm UTC](https://forum.kirupa.com/t/destroying-instances/248174/1 "2008-01-04T16:30:44Z")

</div>

I have a class that displays a picture in a popup style.

```auto
var popPicture:PopPicture = new PopPicture

```

To remove it I use

```auto
removeChild

```

and to remove completely the instance I pass

```auto
popPicture=null

```

But doing debugging I have discovered that I can trace the name of the instance using

```auto
popPicture.name

```

and every time I create a new instance of the popup, the name is increased instance25, instance27, instance28.

I am not sure if it is just an internal counter that do no reuse numbers o if the instances are not really deleted. Can someone tell me if this is the ritght way to delete instances?

Thanks
