# Child access issue

**URL:** <https://forum.kirupa.com/t/child-access-issue/294177>\
**Category:** flash\
**Created:** [August 10, 2009, 2:37pm UTC](https://forum.kirupa.com/t/child-access-issue/294177 "2009-08-10T14:37:54Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Alpha\_Remex](https://avatars.discourse-cdn.com/v4/letter/a/779978/32.png) [@Alpha\_Remex](https://forum.kirupa.com/u/Alpha_Remex)\
**Post date:** [August 10, 2009, 2:37pm UTC](https://forum.kirupa.com/t/child-access-issue/294177/1 "2009-08-10T14:37:54Z")

</div>

Ok, so I have a form in my program where people can check off individual buttons using click event listeners. This works great.

Now I am trying to add a “Select All” button. This loops through all of the MovieClips in the main sprite container and accesses a mask to move it into place in order to un-hide the actual check mark.

Here’s my code:

```auto

        private function selectAll(e:MouseEvent):void {
            var newX:int;
            
            if(allSelected) {
                newX = -70;
                allSelected = false;
            } else {
                newX = -5;
                allSelected = true;
            }
            
            for each(var mc:MovieClip in configsContainer) {
                var cb:MovieClip = mc.getChildByName("checkbox");
                TweenMax.to(cb.checkMask,.2,{x:newX});
            }
        }

```

The error that I get refers to this line:

```auto

var cb:MovieClip = mc.getChildByName("checkbox");

```

Here is the error I get at compile time:

```auto

1118: Implicit coercion of a value with static type flash.display:DisplayObject to a possibly unrelated type flash.display:MovieClip.

```

Any ideas?
