PDA

View Full Version : 3 Linked ComboBoxes Problem


astaire1
06-06-2005, 04:10 PM
I used comboBoxes to make a selection menu. The first box contains general items, the second contains sub-items that depend on which item was selected in the first, and the third depends on the items from the second.

The main is called main_cb, the second is sub_cb, and the third is subsub_cb. The data for the second box depends on an array. If cameras is selected, then cameraArray provides the data for the second comboBox.

I can get the second one to change depending on the selection from the first using this code:

function setSubCombo() {
sub_cb.removeAll();
var subArray = eval(main_cb.getSelectedItem().data);
for (var i = 0; i<subArray.length; i++) {
sub_cb.addItem(subArray[i]);
}
}

I am looking for suggestions on how to work the third box from the selected item in the second. (could the problem be that there are no labels in the second box?, just data?)

Also, I am wondering on how I could display a movie clip based on the selection from the third box...

Thanks in advance.

tg
06-06-2005, 06:36 PM
the combo box addItem() method takes 2 arguments.

myCombo.addItem(label,data);



could the problem be that there are no labels in the second box?, just data?

why would you have a combo box with no labels? how would a person know which item they were selecting?

astaire1
06-06-2005, 06:59 PM
Actually, the labels show up (in the second box) when I test the scene. I was only saying that since it gets the info from the array and puts it into the combobox using the .data parameter, maybe there was nothing to use under .label for linking it to the third.

Any ideas?:confused: How about getting a movie clip to become visible after selecting something in the third box?

Thanks again...