# Need to delete MCs dynamically created with addChild()

**URL:** <https://forum.kirupa.com/t/need-to-delete-mcs-dynamically-created-with-addchild/267140>\
**Category:** Uncategorized\
**Created:** [July 29, 2008, 12:33am UTC](https://forum.kirupa.com/t/need-to-delete-mcs-dynamically-created-with-addchild/267140 "2008-07-29T00:33:43Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![qhrome27](https://avatars.discourse-cdn.com/v4/letter/q/f04885/32.png) [@qhrome27](https://forum.kirupa.com/u/qhrome27)\
**Post date:** [July 29, 2008, 12:33am UTC](https://forum.kirupa.com/t/need-to-delete-mcs-dynamically-created-with-addchild/267140/1 "2008-07-29T00:33:43Z")

</div>

Hello,

I have a script that creates hundreds of MCs within another one, and I need to know how to get rid of those MCs completely.

I initialize an array to save the references to the classes.

var arrWavePixel:Array = new Array();

Then I have a loop that creates movie clips and pushes them to the array

var wavePixel0:wavePixel= new wavePixel();  
this.addChild(wavePixel0);  
arrWavePixel.push(wavePixel0);

wavePixel0.name = “wavePixel”+increment;

I am able to change the properties of the new movie clip, such as height, by  
saying  
arrWavePixel[increment].height = x;

How can I go through all these added Children with a loop and delete them entirely from memory and display?
