Random images from XML

Hi there…this is my first post on the forum - only from searching around the forums (and failing) and trying my best to find an answer have i resorted to asking for help.

Below is the AS for an infinite slide menu which calls images from a location into a sequence (the original FLA is from these very forums). What i’ve been trying to do is randomly load the images referenced from the XML into the newThumb container but still keep the functionality of the infinite menu. Could anyone take a look and possibly enlighten me on how i can come about this?

The code:

stop();

//////////XML
descriptions = true;
alert._visible = true;
var ease = 5;
thumbs = new XML();
thumbs.ignoreWhite = true;
thumbs.load(“thumbs.xml”);
thumbs.onLoad = function() {
root = this.firstChild;
total = root.childNodes.length;
displayNum = Number(root.childNodes[0].attributes.displayNum);
separation = Number(root.childNodes[0].attributes.separation);

//////////settings
w = Number(root.childNodes[0].attributes.w);
h = Number(root.childNodes[0].attributes.h);
mask._width = (w+separation)*displayNum;
mask._height = h;
mask._y = 20;

thumbnailer._y = 20;

cont._x = w/2;
cont._y = h/2;

//////////button positions
forward._y = 90.5;
forward._x = mask._width;
back._y = 90.5;
back._x = (mask._width-mask._width)+16;

mcs = [];
for (i=0; i<total; i++) {
    mcs.push(i);
    newThumb = thumbnailer.container.duplicateMovieClip("container"+i, i);
    with (newThumb) {
        _x = (w+separation)*i;
        preloader._x = w/2;
        preloader._y = h/2;
        block._width = w;
        block._height = h;
    }
    var image = root.childNodes*.childNodes[0].firstChild.nodeValue;
    newThumb.desc = root.childNodes*.childNodes[1].firstChild.nodeValue;
    newThumb.link = root.childNodes*.childNodes[2].firstChild.nodeValue;
    newThumb.cont.loadMovie(image);
    newThumb.onRelease = function() {
        getURL(this.link);
    };
    if (descriptions) {
        newThumb.onRollOver = function() {
            alert.desc = this.desc;
            alert._visible = true;
        };
        newThumb.onRollOut = function() {
            alert._visible = false;
        };
    }
}
//
var offset = total-1;
var dest = 0;
var increment = w+separation;
var ending = (total-displayNum)*(w+separation);
var lastmc = total-1;
var firstmc = 0;



back.onRelease = function() {
    if (dest<0) {
        dest += increment;
    } else {
        first = mcs[0];
        for (k=0; k<total; k++) {
            mcs[k] = mcs[k+1];
        }
        mcs[total-1] = first;
        thumbnailer["container"+lastmc]._x = -(w+separation);
        firstmc = lastmc;
        //check whos new lastmc
        for (k=0; k<total; k++) {
            if (mcs[k] == (total-1)) {
                lastmc = k;
        
            }
        }
    }
}

forward.onRelease = function() {
    if (dest>-ending) {
        dest -= increment;
    } else {
        last = mcs[total-1];
        for (k=1; k<total; k++) {
            mcs[total-k] = mcs[total-k-1];
        }
        mcs[0] = last;
        thumbnailer["container"+firstmc]._x = (displayNum)*(w+separation);
        lastmc = firstmc;
        //check whos new firstmc
        for (k=0; k<total; k++) {
            if (mcs[k] == 0) {
                firstmc = k;
            }
        }
    }
}
//movement
onEnterFrame = function () {
    for (j=0; j<total; j++) {
        thumbnailer["container"+j]._x += (dest+(mcs[j])*(w+separation)-thumbnailer["container"+j]._x)/ease;
    }
    alert._x = _xmouse;
    alert._y = _ymouse;
};

};

Many thanks!!!