# Remove nonexistent children?

**URL:** <https://forum.kirupa.com/t/remove-nonexistent-children/316690>\
**Category:** flash\
**Created:** [November 30, 2010, 2:44am UTC](https://forum.kirupa.com/t/remove-nonexistent-children/316690 "2010-11-30T02:44:19Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![queenoid](https://avatars.discourse-cdn.com/v4/letter/q/6bbea6/32.png) [@queenoid](https://forum.kirupa.com/u/queenoid)\
**Post date:** [November 30, 2010, 2:44am UTC](https://forum.kirupa.com/t/remove-nonexistent-children/316690/1 "2010-11-30T02:44:19Z")

</div>

Hello, you wonderful AS3 gurus. You have already been so helpful that I am back.  
I am building a dice game. I need to clear the stage between rolls of the dice. I can tell Actionscript to remove children as the first step in a new roll. My question is - how do I make it ignore this command if it is, in fact, the first roll and so there are no children on the stage?

Right now, I begin my code with

```auto
function rollDice(MouseEvent):void {
    
    if (open_screen.contains(Die)) {
        removeChild(Die);
    }
    

```

but I get the message “TypeError: Error #2007: Parameter child must be non-null.”

Do you have any suggestions?
