# Listbox load images and captions?

**URL:** <https://forum.kirupa.com/t/listbox-load-images-and-captions/43110>\
**Category:** flash\
**Created:** [February 18, 2004, 10:29pm UTC](https://forum.kirupa.com/t/listbox-load-images-and-captions/43110 "2004-02-18T22:29:00Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Forlorn\_Hope](https://avatars.discourse-cdn.com/v4/letter/f/9d8465/32.png) [@Forlorn\_Hope](https://forum.kirupa.com/u/Forlorn_Hope)\
**Post date:** [February 18, 2004, 10:29pm UTC](https://forum.kirupa.com/t/listbox-load-images-and-captions/43110/1 "2004-02-18T22:29:00Z")

</div>

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:
