# Problem in loaders in loop

**URL:** <https://forum.kirupa.com/t/problem-in-loaders-in-loop/320055>\
**Category:** flash\
**Created:** [March 12, 2011, 8:17pm UTC](https://forum.kirupa.com/t/problem-in-loaders-in-loop/320055 "2011-03-12T20:17:53Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![nikhil104iic](https://avatars.discourse-cdn.com/v4/letter/n/ed8c4c/32.png) [@nikhil104iic](https://forum.kirupa.com/u/nikhil104iic)\
**Post date:** [March 12, 2011, 8:17pm UTC](https://forum.kirupa.com/t/problem-in-loaders-in-loop/320055/1 "2011-03-12T20:17:53Z")

</div>

Hello…

I am badly stuck in this problem. I have three movieclips on a stage ( thumb1, thumb2, thumb3). I made a function of loading 3 images i.e.

private function putThumbImages() {  
for (var k=0; k\<3; k++) {  
var thumbLoader:Loader = new Loader();  
thumbLoader.load(new URLRequest(thumbFileNameArray[k]));  
(“thumb”+(k+1)).addChild(thumbLoader);  
}  
}

where, thumbFileNameArray = { img1, img2, img3 } .

But that function is not working. the last line throwing an error. I just want to put the three images from thumbFileNameArray to the 3 movieclips ( thumb1, thumb2, thumb3 )

Any help would be greatly appreciated.

Nikhil…
