# Finding Num of Children

**URL:** <https://forum.kirupa.com/t/finding-num-of-children/324864>\
**Category:** flash\
**Created:** [September 12, 2011, 5:36pm UTC](https://forum.kirupa.com/t/finding-num-of-children/324864 "2011-09-12T17:36:58Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Raabi](https://avatars.discourse-cdn.com/v4/letter/r/41988e/32.png) [@Raabi](https://forum.kirupa.com/u/Raabi)\
**Post date:** [September 12, 2011, 5:36pm UTC](https://forum.kirupa.com/t/finding-num-of-children/324864/1 "2011-09-12T17:36:58Z")

</div>

Hello!

I am always confused how to find the Num of Children in a particular case, as below.  
I am trying to figure out how many birds are there at a particular time, so that I may control their growth.

```auto

var timer: Timer = new Timer(500, 45);
timer.addEventListener(TimerEvent.TIMER, timerFunc);
timer.start();

function timerFunc(event: TimerEvent): void
{
 var mcBird: myBird = new myBird();
 var yVal: Number = (Math.ceil(Math.random()*100));
 mcBird.x = 750;
 mcBird.y = yVal;
 addChild(mcBird);

 trace("Num of Birds = " + mcBird.Parent.numChildren); // [COLOR=#a52a2a]*This is the point of my problem*[/COLOR]
}

```

If a geek explains me where to use “parent”, “this”, and “root” etc. it can help me for the future as well.

Thanks in anticipation.

Raabi
