title: Why does my EVENT.ACTIVE trigger twice?
body: <p>When I add an <code>EVENT.ACTIVATE</code> listener to my project, and then alt-tab away and back to my project it triggers twice.</p>
  
  <p><strong>edit: shaunhusain and I seem to have found the cause of the problem, although without a solution. When running the standalone player version 11+ the event triggers 2x. When running standalone player version &lt;11 or any version in the browser it triggers 1x. So it appears there may be a bug in recent versions of the flash player projector. I'm going to nail down the exact versions and report it to adobe and see what happens. Thanks to anyone who read this and tried to help!!</strong></p>
  
  <p>I want it to fire every time I change focus, I just don't want it to fire <em>twice</em> every time I change focus.</p>
  
  <p>Why is this? Am I doing something wrong? What's the best way to prevent this behavior?</p>
  
  <p>It seems like it would be a common question, but Google turned up nothing.</p>
  
  <p>Code:</p>
  
  <pre><code>package 
  {
      import flash.display.Sprite;
      import flash.events.Event;
  
      public class Main extends Sprite 
      {
  
          public function Main():void 
          {
              if (stage) init();
              else addEventListener(Event.ADDED_TO_STAGE, init);
          }
  
          private function init(e:Event = null):void 
          {
              removeEventListener(Event.ADDED_TO_STAGE, init);
              // entry point
              stage.addEventListener(Event.ACTIVATE, test);
          }
  
          private function test(e:Event):void
          {
              trace(e.target);
          }
  
      }
  
  }
  </code></pre>
  
  <p>Actual result:</p>
  
  <pre><code>[object Stage]
  [object Stage]
  </code></pre>
  
  <p>Desired result:</p>
  
  <pre><code>[object Stage]
  </code></pre>
  
  <p>It doesn't seem to make a difference whether I add the listener to the stage or anything else, the behavior is the same.</p>
  
  <p>The same thing also happens with EVENT.DEACTIVATE. Others such as mouse up work fine.</p>
  
  <p>My goal is to pause a game on <code>EVENT.DEACTIVATE</code> and unpause it on <code>EVENT.ACTIVATE</code>. The problem is that when the event fires twice, it calls the unpause function twice which has unwanted consequences.</p>