title: as3 starling tile array
body: <p>Im trying to make a tile array system using flashDevelop and starling.
  I think i complete that but i dont understand how i make bounds,intersects between the tile array and my hero.
  Note that i make it using tutorials around the internet and not along.</p>
  
  <p>Here are the 2 classes</p>
  
  <pre><code>public class level1 extends Sprite 
  {
      public var map:Array = [
                              [1, 1, 1, 1, 1, 1],
                              [1, 0, 0, 0, 0],
                              [1, 0, 0, 0, 1],
                              [1, 0, 0, 0, 1],
                              [1, 0, 0, 0, 1],
                              [1, 0, 0, 0, 1],
                              [1, 0, 0, 0, 1],
                              [1, 0, 0, 0, 1],
                              [1, 1, 1, 1, 1],
                              ];
      //public var object:Image;
      //public var data:int;
  
  
      public function level1() 
      {
          super();
          this.addEventListener(starling.events.Event.ADDED_TO_STAGE, onAdd);
      }
  
      private function onAdd(event:Event):void
      {
          drawScreen(map, 90);
      }
  
      public function drawScreen(map:Array, cellSize:int = 90):void
      {
          for(var row:int = 0; row &lt; map.length; row++)
          {
              for(var column:int = 0; column &lt; map[row].length; column++)
              {
                  var data:int = map[row][column];
                  // Empty tile, move onto the next item.
                  if(data == 0) continue;
                  var object:Image;
                  if (data == 1) object = new Image(Assets.getTexture("ESAYBTN"));
                  if (data == 2) object = new Image(Assets.getTexture("TITLE"));
                  if(object != null)
                  {
                      object.x = column * 94;
                      object.y = row * 29;
                      stage.addChild(object);
                  }
              }
          }
      }
  }
  
  
  public class inGame extends Sprite 
  {
      public var Hero:heroClass;
      private var enem2:enemy2Class;
      private var enemiesArray:Vector.&lt;enemy2Class&gt;;
      private var posX:int;
      private var posY:int;
      private var hitpoints:int;
      private var _level1:level1;
  
      public function inGame() 
      {
          super();
          this.addEventListener(starling.events.Event.ADDED_TO_STAGE, onAdd);
      }
  
      private function onAdd(event:Event):void
      {
          this.removeEventListener(Event.ADDED_TO_STAGE, onAdd);
          enemiesArray = new Vector.&lt;enemy2Class&gt;();
  
          drawScreen();
      }
  
      private function drawScreen():void
      {
  
  
          Hero = new heroClass(50, 50, 1);
          this.addChild(hero);
  
          _level1 = new level1();
          this.addChild(_level1);
  
          createenemies(450, 50, 6);
          createenemies(400, 50, 5);
          createenemies(350, 50, 4);
          createenemies(300, 50, 3);
          createenemies(250,50, 2);
      }
  
      public function createenemies(posX:int, posY:int, hitpoints:int):void
      {
          var enemies:enemy2Class = new enemy2Class(posX,posY,hitpoints);
          this.addChild(enemies);
          enemiesArray.push(enemies);
      }
  
      public function hideInGame():void
      {
          this.visible = false;
      }
  
      public function showInGame():void
      {
          this.visible = true;
  
          this.addEventListener(Event.ENTER_FRAME, gameLoop);
      }
  
      private function gameLoop(Event):void
      {
          var enemiestoloop:enemy2Class;
          for (var i:uint = 0; i &lt; enemiesArray.length; i++)
          {
              enemiestoloop = enemiesArray[i];
              //enemiestoloop.x-=2;
              if (enemiestoloop.bounds.intersects(enem.bounds))
              {
                  enemiestoloop.x = 400;
                  enemiestoloop._hitpoints--;
              }
  
              if (enemiestoloop._hitpoints &lt;= 0)
              {
                  enemiesArray.splice(i, 1);
                  this.removeChild(enemiestoloop);
              }
          }
          hero.y++;
          if(hero.bounds.intersects("here goes the map???"))
            {
               hero.y--;
             }
  
      }
  
  }
  </code></pre>
  
  <p>So how i write if the hero hit the map array object 1?</p>