View Full Version : Can you populate multiple selections from one listbox to another
dansmad
02-08-2005, 08:57 AM
I am trying to build a group selection for my t-shirt site and I can't find out how parse multiple colour selections from one listbox to another?
My Actionscript and Component knowledge is limited so someone please HELP! :eek:
Curly Brace
02-08-2005, 09:09 AM
Please, describe your problem in more details. What exactly do you mean by "parse multiple colour selections from one listbox to another"?
dansmad
02-08-2005, 09:23 AM
Basically I have a listbox with 10 shirt colours red, blue, yellow etc
I am trying to allow people to select multiple shirt colours press a submit button and show there colour selections in another listbox. then allow the to remove and modify there choices.
Curly Brace
02-08-2005, 09:55 AM
Ok. Let's say you'xe got two list boxes called "list1" and "list2" and a button component called "button". This will transfer selected items of list1 to list2:
list1.multipleSelection = true;
list1.dataProvider = ["red", "green", "blue", "white", "black"];
function click(evt){
var index_array = list1.selectedIndices;
for(i in index_array){
list2.addItem(list1.dataProvider[index_array[i]]);
}
}
button.addEventListener("click", this);
dansmad
02-08-2005, 10:23 AM
Thanks for the reply Curly
I tried your script in both MX and MX 2004 and it doesn't seem to work?
List1. populates with the data but on click the info doesn't transfer to list2.
Do you have an .FLA
Thanks again
Dan
Curly Brace
02-08-2005, 10:43 AM
Here it goes: http://leftshift.ru/flash/forums_list_transfer.zip
dansmad
02-08-2005, 10:50 AM
There is nothig there i am getting an download error ???? :confused:
Curly Brace
02-08-2005, 10:54 AM
:) my fault. Here it really goes http://leftshift.ru/flash/forum_list_transfer.zip
dansmad
02-08-2005, 11:29 AM
I am working flash MX sorry forgot to say?
vBulletin® v3.7.1, Copyright ©2000-2009, Jelsoft Enterprises Ltd.