ListBox Component

Just playing around with ListBox Component and exploring its methods.
here is some code i am trying:

//—– start code———//

add_btn.onRelease = function(){
people_lb.addItem( label_txt.text, {userid:userid_txt.text, userip:userip_txt.text, blocked:blocked_txt.text, isAdmin:isAdmin_txt.text, customData:gender_txt.text, properties:labelProp} );
}
//
function displayDetails(c){
//output_txt.text = c.getSelectedItem().label+” :”;
//var j = c.getSelectedItem().data;
data_txt.text = c.getItemAt(2).data.userid;
}
display_btn.onRelease = function(){
//displayDetails(people_lb);
for(var i = 0;i< people_lb.length; i++){
trace(people_lb.getItemAt(i).label);
trace(people_lb.getItemAt(i).data.userid);

}

}

//people_lb.setChangeHandler(”displayDetails”);

// ——— end code ———– //

add a few textfields to the stage and the button will add the items to the listbox.
the display button gets each item and puts a trace of userid and the label of each list item
i have to send the added items to a dataprovider.. to do..
what i need to do is get each item from a listbox, check if it has a certain property and then display using the data properties of that item elsewhere.

Leave a Reply

You must be logged in to post a comment.