title: Issues spawning new levels for 2D platformer in AS3
body: <p>I'm making a 2D platformer in Flash for a project, and everything's going swimmingly! It's been easy sailing up until I realize the assignment says to use 2 levels, and the only way I have done levels is via adding them as classes, while this project is using arrays.</p>
  
  <p>I started using URLLoader to plop the levels in .txt files, but even then the example code I've been following only shows how to do this for one level, not for 2+.</p>
  
  <p>Here's the code I'm using for the maps, I can supply more if this isn't sufficient:</p>
  
  <pre><code>    public function init()
      {
          trace("init");
  
          map = [[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
                  [0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0],
                  [0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0],
                  [0, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 0, 0, 2, 2, 2, 0, 0, 0, 0],
                  [0, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 0, 0, 2, 2, 2, 0, 0, 0, 0],
                  [0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0],
                  [0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0],
                  [0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0],
                  [0, 1, 1, 1, 0, 2, 2, 0, 1, 1, 1, 1, 0, 2, 2, 0, 1, 1, 1, 0],
                  [0, 1, 1, 1, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 1, 1, 1, 0],
                  [0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0],
                  [0, 0, 0, 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 0, 0, 0]]
  
                  container = new Sprite();
                  addChild(container);
                  tileArray = [Tile0, Tile1, Tile2];
                  buildMap();
                  createPlayer();
                  createWinSpace();
                  ArrowKeyInput.init(stage);
                  addEventListener(Event.ENTER_FRAME, update);
      }
      private function buildMap():void
      {
          trace("BUILD");
          tileMap = [];
          for (var i:int = 0; i &lt; map.length; i++) 
          {
              var row:Array = map[i];
              var tileRow:Array = [];
              tileMap.push(tileRow);
              for (var j:int = 0; j &lt; row.length; j++) 
              {
                  var tileNum:int = row[j];
                  var className:Class = tileArray[tileNum];
                  var tile:MovieClip = new className();
                  tile.width = tile.height = TILE_SIZE;
                  tile.x = TILE_SIZE * j;
                  tile.y = TILE_SIZE * i;
                  container.addChild(tile);
                  tileRow.push(tile);
              }
          }
      }
  </code></pre>
  
  <p>I appreciate any sort of feedback I can get on this.</p>