Code help please!

I am loading an array from a text file to create a set of thumbnail images a la scotty’s excellent post on the topic, using this code:

function select(q) {
thumb_array = new Array();
loadArray = new LoadVars();
loadArray.load(“array.txt”);
loadArray.onLoad = function(success) {
if (success) {
ab = this[“array_”+q];
thumb_array = ab.split(",");
_root.image_array = thumb_array;
posthumbs();
}
};
}

with the following in the .txt file

array_1=001,002,003,005&array_2=004,005,091,092,093,094,095,096,

As far as I understand the top function makes array_1 and array_2 selectable, and they are then referenced by this button action

contents.onRelease = function() {
_root.dragwindow.scrll.select(1);
};

What I need help with is trying to have the same functionality but using XML, I understand how to load arrays from an xml file, but can’t get it to tie in with everything else even after many long attempts.

I also don’t understand what is going on later in the code with ab, can anyone explain it?

COMPLETE CODE FOLLOWS:

(attached as zipped text file - post.zip)

any help or explanations truly appreciated.

SH

one step forward…two steps back

a little further in my understanding (I think) here is the commented code (as I understand it):

function select(q) {

//create array
thumb_array = new Array();

//load array from text file
loadArray = new LoadVars();
loadArray.load(“array.txt”);

//evaluate if text file has loaded
loadArray.onLoad = function(success) {

if (success) {
//make it possible to get array through select e.g select(1) = array_1
//and assign that array as the value of ab
ab = this[“array_”+q];

//create the thumb array by breaking apart array_1 to become
//001.jpg,002.jpg etc.
thumb_array = ab.split(",");
//trace(ab);

//set the image_array at root to equal thumb_array (001.jpg,002.jpg etc.)
_root.image_array = thumb_array;

//initiate the function to make thumbnail buttons
posthumbs();
}
};
}

so now I believe that I need nested arrays in XML to produce the same effect, but don’t understand how to make these so they are selectable through the function select(). Pretty sure it has something with nodes but it is still beyond my understanding.

Any help going?