Ask a Question related to Macromedia Flash Actionscript, Design and Development.
-
quadrant6 webforumsuser@macromedia.com #1
Item label displays as "," when moving from listbox to listbox
I have 2 listboxes: "lb_unselected" and "lb_selected". The first thing in the actions is loop through an array populating these two listboxes.
There is also an "add" button which, when clicked moves the currently selected item from the "lb_unselected" listbox to the "lb_selected" listbox.
The problem is that, although the item is moved to the "lb_selected" listbox, it displays as "," - the label changes to this when it's moved?
I am sure this is something to do with the array index? but cannot figure out what exactly.
Any insights would be appreciated.
// Code that populates both listboxes:
for(n=0; n<allItems.length; n++) {
is_selected = false;
for(i=0; i< allItems[n]['topics'].length; i++) {
if(allItems[n]['topics'][i] == topic) {
lb_selected.addItem(allItems[n].item_name, allItems[n].item_id);
is_selected = true;
break;
}
}
// fill Unselected items listbox
if(!is_selected){
lb_unselected.addItem(allItems[n].item_name, allItems[n].item_id);
}
}
//Code that the add button activates:
// add item
function addSubcat(listIndex) {
// add item to Selected list box
lb_selected.addItem(lb_unselected.getItemAt(listIn dex).label, lb_unselected.getItemAt(listIndex).data)
// select and sort new item in Selected list box
lb_selected.setSelectedIndex(lb_selected.getLength () - 1);
lb_selected.sortItemsBy("label", "ASC");
// remove good practice from Unselected listbox
lb_unselected.removeItemAt(listIndex);
}
quadrant6 webforumsuser@macromedia.com Guest
-
Composite dropdownlist control that also displays a listbox????
This is driving me crazy, I am trying to build a custom dropdownlist that when rendered also displays a listbox next to it. I am going to use the... -
Return Listbox label instead of Value
Hi there. I want to return the value of a list box's label rather than it's value, can this be done and if so how - the list box has static... -
CFINPUT type="radio" w/ "value" requires "label"
On a Flash form, when you specify type='radio' and value='whatever', the value of the 'value' attribute will be displayed as a label if no 'label'... -
zeroing in on a listbox item
I am wondering if it is possible to narrow in on an item within a listbox of states. For example, right now if I type "W", I will immediately drop... -
Property that displays a listbox
Hi. I wrote a property for a custom control I wrote that accepts one of five different values. I'm wondering if it is possible to display a... -
quadrant6 webforumsuser@macromedia.com #2
Re:Item label displays as "," when moving from listbox to listbox
Answer: incorrect function names.
quadrant6 webforumsuser@macromedia.com Guest



Reply With Quote

