PDA

View Full Version : passing variables from a listbox


hamsterboy
07-09-2004, 09:52 AM
I want to set a listbox up and populate it dynamically from an array taken from an external text file. When an item is selected, it will load an image and some text into an empty movie clip.

My problems are.............

How do i dynamically populate a listbox, assuming that the array the data is taken from varies in length, and................

how do I pass variables from a list box.

tg
07-09-2004, 03:09 PM
myListBox.setDataProvider(myArray);

tg
07-09-2004, 03:10 PM
or
for(var i=0;i<myArray.length;i++){
myListBox.addItem(myArray[i],null);
}

tg
07-09-2004, 03:12 PM
to get info from a list box use
myListbox.getSelectedItem().label,
or
myListBox.getSelectedItem().data.

depends on how you loaded the items, and where or not you specified a data item.

open up the reference panel in flash and look up FListBoxSymbol