# Question about using removeChild

**URL:** <https://forum.kirupa.com/t/question-about-using-removechild/255000>\
**Category:** Uncategorized\
**Created:** [March 18, 2008, 3:57am UTC](https://forum.kirupa.com/t/question-about-using-removechild/255000 "2008-03-18T03:57:20Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![numbfinger](https://avatars.discourse-cdn.com/v4/letter/n/ea666f/32.png) [@numbfinger](https://forum.kirupa.com/u/numbfinger)\
**Post date:** [March 18, 2008, 3:57am UTC](https://forum.kirupa.com/t/question-about-using-removechild/255000/1 "2008-03-18T03:57:20Z")

</div>

I am new to Actionscript 3.0 and I’m currently trying to replicate the usage of attachMovie(), and removeMovieClip() from AS 2.0.

So far I have gotten things working using addChild() and removeChild(), but there is an error message that comes up in the output window that I have a question about.

Here is my code, it is in the main timeline.  
bullets is the array that holds all of the bullets created, and BulletClass is the name of the bullet movieclip’s class in linkage.

```auto
var bullets:Array = new Array();
function shootWeapon():void{
     var newbullet:BulletClass = new BulletClass();
     addChild(newbullet);
     bullets.push(newbullet);
     newbullet.x = 0;
     newbullet.y = 300;
}
addEventListener(Event.ENTER_FRAME,OEF);
function OEF(Event){
     for(var i:uint = 0;i<bullets.length;i++){
          bullets*.x += 10;
          if(bullets*._x >= 500){
               removeChild(bullets*);
               bullets.splice(i,1);
          }
     }
}
shootWeapon();

```

This works the way I want it to, creating bullets with shootWeapon(), moving them to the right, and removing them from the array and the screen when they get past 500 x.

But, I get this error in the output window when one of the bullets gets removed.

```auto
TypeError: Error #1010: A term is undefined and has no properties.

```

This error doesn’t prevent me from compiling, and only shows up in the output window. But I would like to know: What does this error mean, is it important, how do I get rid of it, and is there a better way of removing these bullets from both the array and the screen? Help would be appriciated. 🙂
