title: Having variable issue
body: <p>I'm having trouble with a variable being update. Below, my Main document function has my level equaling 1 and generating multiple tiles. It does equal 1, but I have the if statement saying to go up a level if a var equals true.</p>
  
  <pre><code>    public var enemiesDefeated:Boolean = false;        
      addChild(level);
      //START THE GAME AT LEVEL 1//
      level.levelNumber = 1;
      if (enemiesDefeated == true){
          level.levelNumber += 1;
      }
      var tileh:int = 60;
  
      for (var Y:int=0; Y&lt;floor.length; Y++)
      {
          for (var X:int=0; X&lt;floor[Y].length; X++)
          {
                  var cell:MovieClip = new Tile(X,Y);
              cell.gotoAndStop(floor[Y][X]);
              cell.x = ((X-Y)*tileh)+365;
              cell.y = ((X+Y)*tileh/2)+70;
              addChild(cell);
  
              cell.addEventListener(MouseEvent.CLICK, mouseclick);
              cell.addEventListener(Event.ENTER_FRAME, onGame);
              cell.addEventListener(Event.ADDED_TO_STAGE, addEnemy);
          }
      }
  </code></pre>
  
  <p>The variable enemiesDefeated is turned to true in my onGame function if I destroy all the enemies, however, the level is staying at level 1 after enemiesDefeated equals true. </p>
  
  <pre><code>function onGame(event:Event){
  
      ...
  
      if (enemy.enemyHP &lt;= 0) 
          {
               removeChild(enemy);
               enemy.enemyDead = true;
               enemiesDefeated = true;
               trace("Dead", enemy.enemyDead);
          }
  }
  </code></pre>
  
  <p>Is there a way to fix this?</p>