# Need help removing children from a container in a MovieClip

**URL:** <https://forum.kirupa.com/t/need-help-removing-children-from-a-container-in-a-movieclip/284824>\
**Category:** Uncategorized\
**Created:** [March 24, 2009, 6:00am UTC](https://forum.kirupa.com/t/need-help-removing-children-from-a-container-in-a-movieclip/284824 "2009-03-24T06:00:23Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![marker76](https://avatars.discourse-cdn.com/v4/letter/m/898d66/32.png) [@marker76](https://forum.kirupa.com/u/marker76)\
**Post date:** [March 24, 2009, 6:00am UTC](https://forum.kirupa.com/t/need-help-removing-children-from-a-container-in-a-movieclip/284824/1 "2009-03-24T06:00:23Z")

</div>

i’m getting the #1010 error… code below:

```auto
 
var curProject:int = 0;
var curExample:int = 0;
var container:MovieClip = new MovieClip();
im.addChild(container);
 
function showExamples(e:Event):void {
 var exampleList:XMLList = xmlData.project[curProject].example;
 while(im.container.numChildren > 0){
    im.container.removeChildAt(0);
 }
 for(var i:int = 0; i < exampleList.length(); i++){
  var newExample:exampleIcon = new exampleIcon();
  newExample.x = 485;
  newExample.y = (i*25)+20;
  if(i == curExample){
   newExample.transform.colorTransform = c;
  }
  else{
   newExample.addEventListener(MouseEvent.CLICK, exampleClick);
   newExample.addEventListener(MouseEvent.MOUSE_OVER, exampleOver);
   newExample.addEventListener(MouseEvent.MOUSE_OUT, exampleOut);
   newExample.buttonMode = true;
  }
  newExample.alpha = (i == curExample) ? .6 : .3;
  newExample.name = String(i);
  newExample.mouseChildren = false;
  im.container.addChild(newExample);
 }
}

```

I appreciate any help.
