title: stage Event.ENTER_FRAME vs. CREATION_COMPLETE
body: <p>I've got an AS3 project that I'm building in FlexBuilder.</p>
  
  <p>In my main class's constructor, I've got this:</p>
  
  <pre><code>    stage.addEventListener(Event.ENTER_FRAME, stage_enterFrameHandler);
  </code></pre>
  
  <p>And then the event handler function:</p>
  
  <pre><code>    private var tempCounter:uint = 0;
  
      private function stage_enterFrameHandler(event:Event):void
      {
          stage.removeEventListener(Event.ENTER_FRAME, stage_enterFrameHandler);
          tempCounter += 1;
          trace(tempCounter);
      }
  </code></pre>
  
  <p>When I run in debug mode, tempCounter writes out once, as 1.  Why is this? I though the whole point of Event.ENTER_FRAME is that it keeps firing.</p>
  
  <p>The <a href="http://livedocs.adobe.com/flash/9.0/ActionScriptLangRefV3/flash/display/DisplayObject.html#event:enterFrame" rel="nofollow noreferrer">documentation</a> says:</p>
  
  <blockquote>
    <p>If the playhead is not moving, or if there is only one frame, this event is dispatched continuously in conjunction with the frame rate. This event is dispatched simultaneously to all display objects listening for this event.</p>
  </blockquote>
  
  <p>So why would I not see that counter incrementing about 30x a second (which is what I have the frame rate set to)?</p>
  
  <p>EDIT NOTE:</p>
  
  <p>OK, well, doh, I've figured it out. It's because I immediately remove the eventlistener. The ENTER_FRAME event does keep firing... The only reason the code is done this way (code I inherited) is, I suppose, that CREATION_COMPLETE isn't available if you aren't using the flex framework.</p>