Variable trouble for autommated image gallery

I am having a really hard time trying to set the following variable.

i have a bunch of loaded variables via an ASP page. It outputs the filenames of the number of files kept in the ‘images’ folder at the time the page is loaded.
it outputs the filenames setting each variable with the names:

image1=xxx.jpg&image2=xyz.jpg&image3=jkl.jpg.

i have successfully created buttons corresponding to the number of images conatined in my folder. I now need to figure out how i can set

[size=5][size=4]photo = myData.image+i[/size] [/size](this is value of the filename of my image)
[size=5][/size]
[size=3]this is for use in the same loop which creates buttons automatically.[/size]
[size=3][/size]
[size=3]The idea is that if it loops through the values of image1 etc the value, which is the full name of the file will be addedaccordingly.[/size]
[size=3][/size]
[size=3]here is my code :[/size]
[size=3][/size]
[size=3][/size]
[size=3]myData = new LoadVars();[/size]
[size=3]
myData.onLoad = function() {
[/size]
[size=3][/size]
[size=3][/size]
[size=3][/size]
[size=3][/size]
[size=3]

image5.text= myData.image5;
filepath = “http://123.123.123/FLASHASP/images/”;
numButtons = myData.imagecount;
X = 10;
Y = 10;
for (i=1; i<=numButtons; ++i) {

_root.attachMovie(“button”, “button”+i, i);
buttons* = _root[“button”+i];
_root[“button”+i].index = i;
_root[“button”+i].num = i;
_root[“button”+i]._x = (i*X)4;
_root[“button”+i]._y = 20;
_root[“button”+i].onPress = function () {
_root.createEmptyMovieClip(“container”,300);
[size=3][color=red][size=4][color=red]mydatavalue = myData.image+
;[size=2][color=#000000] [/color][/size][/color][/size][/color][/size]
[size=3][color=red][size=4][color=red]container.loadMovie(filepath+mydatavalue, “container”);[/color][/size]
[/color][/size]container._x =200;
container._y = 50;
}
}
}

myData.load(“default.asp”);

[size=4][color=red]If Anyone can help out here, I will be very greatful and will definitely shar the fruits when i turn it into a component!!![/color][/size]
[/size]

This IS a truly automated ScripT!!

no need for image01 naming of files…

Perfect for enduser updates!!!

Thats the idea here.
I can do with image01.jpg, image02.jpg

I need to add that file naming convention, then remove it to load the jpg without telling my client to name all his images 01, 02 etc, and then having to keep a list of them aLL

is my idea just no good? , or is anyone else in the dark about this as well
PLease comment.

Thx