[Q] AddChild/Loader aren't working inside a LOOP?

Dear all,

I am trying to create 10 Balls (MovieClip), and each ball will load/insert an IMAGE (JPG)
However, the result is …

  • only ball (b9) works(that can load the image in it.)
  • ball (b0 - b8) not working (all are empty -NO IMAGE in it)

Could any body help me please ???
What’s going on with me script ???
Thanks

main.fla

 
var loader:Loader = new Loader();
var vPic:URLRequest = new URLRequest("http://www.abc.com/image1.jpg");
loader.contentLoaderInfo.addEventListener(Event.COMPLETE, onCompleteHandler);
loader.load(vPic);
for (var i=0; i<10; i++) {
 var b:Ball = new Ball();
 b.name = "b"+i;
 b.setHolder(picLoader);
 addChild(b);
}

Ball.as

 
package {
 import flash.display.MovieClip;
 import flash.events.MouseEvent;
 import flash.display.Loader;
 public class Ball extends MovieClip {
  private var ox:Number, oy:Number;
  private var holder:MovieClip = new MovieClip();   // create a MovieClip to place the IMAGE
 
  public function Ball() {
   this.buttonMode = true;
   this.ox = this.x = 200;
   this.oy = this.y = 200;
   this.addChild(holder);   // create a MovieClip to place the IMAGE
   this.addEventListener(MouseEvent.MOUSE_DOWN, onDragHandler);
   this.addEventListener(MouseEvent.MOUSE_UP, onDropHandler);
  }
  function onDragHandler(e:MouseEvent):void {
   this.startDrag();
  }
  function onDropHandler(e:MouseEvent):void {
   this.stopDrag();
  }
  public function setHolder(obj:Loader):void {
   this.holder.addChild(obj);  // add IMAGE to the MoiceClip
  }
 }
}