I Need Drugs
New member
I am trying to create a ComboBox. I then want to have a button when pressed act on the selected option in the combobox.
The ComboBox is created with cmbo.addItem("Option1", "Option1"); and thats how all of the options are created. Then I created a button. The button needs to be able to read the selected CB option. But when I trace(); the selected option I get "object Object".... Why???
I am using this code on the button.
on (press) {
selected = _root.cmbo.getSelectedItem();
trace(_root.cmbo.getSelectedItem());
}
I even tried it without the _root. part but it still doesn't work...
Can someone please help me??? What am I doing wrong?
The ComboBox is created with cmbo.addItem("Option1", "Option1"); and thats how all of the options are created. Then I created a button. The button needs to be able to read the selected CB option. But when I trace(); the selected option I get "object Object".... Why???
I am using this code on the button.
on (press) {
selected = _root.cmbo.getSelectedItem();
trace(_root.cmbo.getSelectedItem());
}
I even tried it without the _root. part but it still doesn't work...
Can someone please help me??? What am I doing wrong?