# Loop a loader

**URL:** <https://forum.kirupa.com/t/loop-a-loader/248433>\
**Category:** Uncategorized\
**Created:** [January 8, 2008, 6:28am UTC](https://forum.kirupa.com/t/loop-a-loader/248433 "2008-01-08T06:28:30Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![bmilesp](https://avatars.discourse-cdn.com/v4/letter/b/3d9bf3/32.png) [@bmilesp](https://forum.kirupa.com/u/bmilesp)\
**Post date:** [January 8, 2008, 6:28am UTC](https://forum.kirupa.com/t/loop-a-loader/248433/1 "2008-01-08T06:28:30Z")

</div>

there are 10 images, and for some strange reason this function will only load one image into the first polaroid.img\_container, and will not load the rest in the for loop. I believe it has something to do with the URLRequest, but searching has become inconclusive. Any help would be appreciated!

function Test() {  
var count=0;  
for( var i:int = 0; i\<totalRows; i++){  
for( var j:int=0; j\<totalColumns; j++){  
obj[count] = new polaroid();  
this.addChild(obj[count]);  
obj[count].x=j_130;  
obj[count].y=i_130;  
ldr[count] = new Loader();  
ldr[count].mask = obj[count].img\_container;  
var url:String = “[http://192.168.15.100/patriciaferia.com/images/thumb-"+(count+1)+".jpg](http://192.168.15.100/patriciaferia.com/images/thumb-%22+(count+1)+%22.jpg)”;  
var urlReq = new URLRequest(url);  
ldr[count].load(urlReq);  
addChild(ldr[count]);  
obj[count].addEventListener(MouseEvent.CLICK, dropAndSplash);  
count++;  
}  
}  
}
