title: as3 - How to access child's child?
body: <p>I dispatched an event for a bullet to spawn on the page. However the bullet should be located in the area where the page's child child should be. There is a Page One <code>MovieClip</code>, which has a child named <strong>player</strong> and the player's child is <strong>gun</strong>. So I'm trying to keep the location and rotation of the bullet the same as the player's gun. So I need to access Page One's child's child. The player and the turret are using instance names and not variables.</p>
  
  <p>I tried this code, but the bullet spawns in the page but will not spawn itself on the turret's location. This event is located in the PageOne class.</p>
  
  <pre><code>function fire(e:Event)
  {
      var b:Bullet = new Bullet();
      b.rotation = player.turret.rotation;
      b.x = player.turret.x + player.turret.width * Math.cos(player.turret.rotation / 180 * Math.PI);
      b.y = player.turret.y + player.turret.width * Math.sin(player.turret.rotation / 180 * Math.PI);
      addChild(b);
  }
  </code></pre>