# Range Exception handling

**URL:** <https://forum.kirupa.com/t/range-exception-handling/324693>\
**Category:** flash\
**Created:** [September 3, 2011, 6:16pm UTC](https://forum.kirupa.com/t/range-exception-handling/324693 "2011-09-03T18:16:04Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![sogj](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/sogj/32/3189_2.png) [@sogj](https://forum.kirupa.com/u/sogj)\
**Post date:** [September 3, 2011, 6:16pm UTC](https://forum.kirupa.com/t/range-exception-handling/324693/1 "2011-09-03T18:16:04Z")

</div>

```auto
for (i=1; i<9; i++) {
        if (this["blank"+i].getChildAt(0) is Letters) {
            word += this["blank"+i].getChildAt(0).letter;
        }
    }

```

This code throws a range exception if, for instance, “blank2” doesn’t contain any children.

I just need to be able to basically say, “if this blank doesn’t have any children, just skip this code.”  
Normally I would do something along the lines of an if=null statement, but this won’t work here because

```auto
if (this["blank"+i.getChildAt(0) != null)

```

obviously throws the same range exception.

How do you deal with this? I can’t find anything along the lines of a “does blank1 contain any children” sort of method.R
