title: How to add a list of images with Sprite. as3
body: <p>I am trying, adding it to an arrangement, but only the last image added appears to me, the goal is to have several images on screen at the same time.</p>
  
  <p>So far this is my Code</p>
  
  <pre><code>import flash.display.Sprite;
  
  var sprites:Array = [];
  var lista_paises_imagenes:Array = new Array("ar.png","br.png","ch.png","co.png");
  for(var i = 0;i &lt; lista_paises_imagenes.length;i++){
      var direcimg:URLRequest = new URLRequest("Palabras/Paises/"+lista_paises_imagenes[i]);
      var objload:Loader = new Loader();
      sprites.push(new Sprite());
      objload.load(direcimg);
      objload.contentLoaderInfo.addEventListener(Event.COMPLETE,CargaImg);
  }
  
  var xx:Number = 0;
  var xy:Number = 0;
  function CargaImg(eve:Event):void{
      sprites[xx].addChild(objload.content);
      sprites[xx].x = xy;
      sprites[xx].y = 255;
      //sprites[xx].height = 90;
      //sprites[xx].width = 90;
      addChild(sprites[xx]);
  }
  trace(stage.numChildren)
  trace(sprites.length);
  </code></pre>
  
  <p><strong>As a result of numChildren on finishing only 1 object on the stage</strong>
  <a href="https://i.stack.imgur.com/4OYg9.png" rel="nofollow noreferrer">Imgae</a></p>