# Removing an object

**URL:** <https://forum.kirupa.com/t/removing-an-object/238438>\
**Category:** Uncategorized\
**Created:** [September 11, 2007, 1:03pm UTC](https://forum.kirupa.com/t/removing-an-object/238438 "2007-09-11T13:03:04Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![hakukaji](https://avatars.discourse-cdn.com/v4/letter/h/43a26b/32.png) [@hakukaji](https://forum.kirupa.com/u/hakukaji)\
**Post date:** [September 11, 2007, 1:03pm UTC](https://forum.kirupa.com/t/removing-an-object/238438/1 "2007-09-11T13:03:04Z")

</div>

I have an array of objects that move across the stage and once they get to x=0 i want to remove them, how can i check to see if they have gotten to x=0.

```auto

private function moveToTheLeft(e:Event):void {
            if (x > 0) {
                x -= stepSize;    
            } else {
                removeChild(this);                
            }
        }

```

as you might have guess the removeChild(this) does not work, once the object reaches x\<0 flash freaks out.
