title: AS3 - How to get function to run after currentFrame updates?
body: <p>I have 2 copies of a MovieClip (mcA) on my main timeline. Within mcA, I have 5 more MovieClips (mcB) and this code:</p>
  
  <pre><code>addEventListener(MouseEvent.CLICK, clickedPoint);
  
  function clickedPoint(e:MouseEvent) {
      e.target.play();
      setStat(e.target.parent);
  }
  </code></pre>
  
  <p>So I toggle the frame of the mcB that was clicked, and I run a function that references the corresponding mcA on the main timeline.</p>
  
  <p>In setStat, I call another function that checks the currentFrame of all the mcBs in the mcA.</p>
  
  <pre><code>getPoints(stat) {
      var points = 0;
  
      for(var i = 1; i &lt;= 5; i++)
      {
          if(stat["pnt"+i].currentFrame == 2) points++;
      }
      trace(points);
  
      return points;
  }
  </code></pre>
  
  <p>My problem is that the setStat function seems to run before the currentFrame of the mcB that has been clicked on updates.</p>
  
  <p>How should I change my code so that the mcB that is clicked on registers as having changed its currentFrame when I call setStat?</p>