Setting Selection of a Combobox?

Is it possible to use AS2 to dynamically set the current state of a ComboBox?

I’m loading variables from an external file, and I need the ComboBoxes to reflect the selection that comes in.

Try this…


// Add items to the list.
test_cb.addItem({label:"Item 01"});
test_cb.addItem({label:"Item 02"});
test_cb.addItem({label:"Item 03"});
test_cb.addItem({label:"Item 04"});
test_cb.addItem({label:"Item 05"});

// Selects the second item in the combo box.
test_cb**.selectedIndex** = 1;

Thank you, Michael, that’ll work brilliantly.

Little more on that:


my_cb.addItem({data:1, label:"first value"}); // Data is what is actually being send
my_cb.addItem({data:2, label:"second value"});
my_cb.addItem({data:3, label:"third value"});