Item label displays as "," when moving from listbox to listbox

Ask a Question related to Macromedia Flash Actionscript, Design and Development.

  1. #1

    Default 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

  2. Similar Questions and Discussions

    1. 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...
    2. 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...
    3. 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'...
    4. 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...
    5. 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...
  3. #2

    Default Re:Item label displays as "," when moving from listbox to listbox


    Answer: incorrect function names.


    quadrant6 webforumsuser@macromedia.com Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139