List Box

Trying to find out how to get the data from a getSelectedItems pull. All I get is an [object Object],[object Object] array. I get it to select all the items in the list view using an array, but I can not seem to show the data that has been in it. Please advise

Thanks:-\

Wait a bit, I’ve got a tutorial on the way. If you can’t, what’s your code so far ?

pom :asian:

Thxz ilyaslamasse
Here is the code:

on (release) {
var items = _root.data_window.secreq.peopAdded.getLength();
var myArray = new Array(0,1,2,3,4,5,6,7,8,9,10,11);

for(i = 0; i < items; i++){
     peopAdded.setSelectedIndices(myArray)

var myObjArray=_root.data_window.secreq.peopAdded.getSelectedItems()
}

trace(myObjArray)
gotoAndPlay(“send_this”)
}

Got it! Indeed myObjArray contains objects: the label and the data of the selected objects. So if you want to trace the selected objects, you’ll have to

for(i = 0; i < myObjArray.length; i++){
        trace(myObjArray[ i].label);
}

Cheers.

pom :asian:

I went to lunch, and you beat me to the answer! heheheh

I just love this stuff!

Sweeeeeeeeeet
Thank you very much ilyaslamasse, worked like a charm:) :slight_smile:

Cool. You wanna know my secret, Inigo? I never eat. =)

pom :toothin:

Is there a way to build an array not knowing how many entries you are going to have: I am filling the list view with items and then selecting them. I want the users to be able to enter in as many as they want. Any suggestions