# Cant find the Child

**URL:** <https://forum.kirupa.com/t/cant-find-the-child/314838>\
**Category:** flash\
**Created:** [October 10, 2010, 7:19am UTC](https://forum.kirupa.com/t/cant-find-the-child/314838 "2010-10-10T07:19:44Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![rimacy](https://avatars.discourse-cdn.com/v4/letter/r/839c29/32.png) [@rimacy](https://forum.kirupa.com/u/rimacy)\
**Post date:** [October 10, 2010, 7:19am UTC](https://forum.kirupa.com/t/cant-find-the-child/314838/1 "2010-10-10T07:19:44Z")

</div>

```auto
public function playGame2():void
        {
            screens1.switchTo("introScreen");
            addChild(screens1);
            trace(screens1.numChildren);
        }

```

if the above is my code i get 1

```auto
public function playGame2():void
        {
            screens1.switchTo("introScreen");
            addChild(screens1);
            trace(screens1.screenlayer.numChildren);
        }

```

if the above is my code i get 1

```auto
public function playGame2():void
         {
             screens1.switchTo("introScreen");
             addChild(screens1);
             trace(screens1.screenlayer.introScreen.numChildren);
         }

```

if the above is my code i get :

TypeError: Error #1010: A term is undefined and has no properties.  
at Document/playGame2()  
at Document/playGame()  
at Document/onCompletelyDownloaded()

and introScreen has a button which can be pressed and tries even to dispatch an event though noone can hear it?

What am I missing?
