MovieClipLoader Class and Image Gallery

hi all,

well i am working on displaying images in scrollpane.i hv written a function which takes string as arguement and display images from that path.nw the problem comes is the image(or path) which is provided at last is displaying at first. it makes me cry. i cant find any workaround for this and wont why this is happening.here is the code.This code works perfectly and may be you wont find any bug. bt if you see the output you will see that order of images is from a3,a2,a1.ie instead of displaying images as a1,a2,a3 it displays it in reverse order.

var _arr:Array = [‘a1.jpg’, ‘a2.jpg’,‘a3.jpg’, ‘a1.jpg’,‘a2.jpg’, ‘a3.jpg’];//these are the images in the same folder where the file is saved\
var xpos:Number = 0;//for positioning of x position of clips\
var yPos:Number = 0;//for positioning of y position of clips\
var refrenceClip:MovieClip = thumb_sp.content;
var depth:Number = 0;
var tiles:Number = 0;//this is used for tiling images in scrollpane.the scrollpane will display total six images with 2 rows and three coloms\
for (var k = 0; k<_arr.length; k++)
{
thumbs(_arr[k]);
}
function thumbs(e:String)
{

refrenceClip.attachMovie('thumb', 'name'+'_'+depth, depth);//thumb is empty movie clip in the library and also the content of scrollpane\\
var clipLoader:MovieClipLoader = new MovieClipLoader();
var listener = {};    
listener.onLoadInit = function(target_mc:MovieClip)
{
    tiles++;
    trace("after initialising tiles="+tiles+"&lt;&gt;&lt;&gt;&lt;&gt;path="+e);
    target_mc._width = 76;
    target_mc._height = 76;
    target_mc._y = yPos;
    target_mc._x = xPos;        
    xPos = target_mc._x+target_mc._width+5;
    if (tiles%3 == 0)
    {
        yPos = target_mc._y+target_mc._height+5;
        xPos = 0;
    }                          
    thumb_sp.invalidate();
};
clipLoader.addListener(listener);
trace("before initializing tiles="+tiles+"&lt;&gt;&lt;&gt;&lt;&gt;path="+e);
clipLoader.loadClip(e, refrenceClip['name'+'_'+depth]);    
depth++;

}

Thanks for any help as i wont get any help from any existed actionscript forums.

with regards
sandeep:(