for(var i:int = 1;i<N;i++){ var mc:DisplayObject = this.getChildByName("pic"+i); mc.x=Math.random()*15; }