Listbox load images and captions?

Ok basically i wana make a list box and when u click somethign in the list box it shows a thumbnailed image and a caption under it. i found this script which i think is the script im lookin for

var loadText = new LoadVars();
loadText.load(“infolist.txt”);
loadText.onLoad = function(success) {
if (success) {
var listArray = loadText.listdata.split(’,’), i; //split the content of txt file into an array
for (i=0; i<listArray.length; i++) {
list.addItem(listArray*); //pass the values stored in the array to the listbox
}
} else {
list.addItem(“Error loading contents!”);
}
};
list.setChangeHandler(“myHandler”);
function myHandler(component) {
var which = list.getSelectedItem().label;//set which item is selected
var subData = new LoadVars();
subData.load(“sublist.txt”);
subData.onLoad = function(success) {
if (success) {
contenttb.text = this[which];//search the txt file for the correspondent info
imgsp.loadScrollContent(which+".jpg");//load correspondent image
} else {
contenttb.text = “Error loading sub data!”;
}
};
}

but im not very good with action script and its liek jibberish to me lol. could someone explain to me what is what? like where do i put the list box items, where i put the image, where i put the caption and such. if someone could help me with this id b :bu:

bump

Have you downloaded the FLA i had posted for that script?

the link was dead

PM your email so i can send you the file.

how do i make it so it doesnt order it in alphebetical order? so like it shows it in the order that i write the things down in the txt?

Replace this line:

var listArray = loadText.listdata.split(',').sort(), i;

for

var listArray = loadText.listdata.split(','), i;

how do i put links using html in the description box? look at the attachment to see wut i mean

Use the html and htmlText properties.
Search the forums for moer info.

ok i thnik i found a code i need to put in my script but i dont konw where to put it. heres my code:

var loadText = new LoadVars();
loadText.load(“infolist.txt”);
loadText.onLoad = function(success) {
if (success) {
var listArray = loadText.listdata.split(’,’), i; //split the content of txt file into an array
for (i=0; i<listArray.length; i++) {
list.addItem(listArray*); //pass the values stored in the array to the listbox
}
} else {
list.addItem(“Error loading contents!”);
}
};
list.setChangeHandler(“myHandler”);
function myHandler(component) {
var which = list.getSelectedItem().label;//set which item is selected
var subData = new LoadVars();
subData.load(“sublist.txt”);
subData.onLoad = function(success) {
if (success) {
contenttb.text = this[which];//search the txt file for the correspondent info
imgsp.loadScrollContent(which+".jpg");//load correspondent image
} else {
contenttb.text = “Error loading sub data!”;
}
};
}

and it said i put this in:
textboxInstanceName.html = true;

//If you are using the loadText.onLoad = function(),
then replace the following line with the following:

textboxInstanceName.htmlText = this.textboxVariable;

but i dont konw where to put it. and on the last thing where it says “this.textboxVariable” do ireplace that with the name of my text box?

Please use AS tags.
This should work.

var loadText = new LoadVars();
loadText.load("infolist.txt");
loadText.onLoad = function(success) {
if (success) {
var listArray = loadText.listdata.split(','), i; //split the content of txt file into an array
for (i=0; i<listArray.length; i++) {
list.addItem(listArray*); //pass the values stored in the array to the listbox
}
} else {
list.addItem("Error loading contents!");
}
};
list.setChangeHandler("myHandler");
function myHandler(component) {
var which = list.getSelectedItem().label;//set which item is selected
var subData = new LoadVars();
subData.load("sublist.txt");
subData.onLoad = function(success) {
if (success) {
contenttb.html = true;
contenttb.htmlText = this[which];//search the txt file for the correspondent info
imgsp.loadScrollContent(which+".jpg");//load correspondent image
} else {
contenttb.text = "Error loading sub data!";
}
};
}