I followed Kirupa’s form tutorial to a tee - or so I thought. Can anyone help me make something other than ‘undefined’ show up when I choose from my comboboxes?
stop();
cancel_btn.onRelease = function (){
gotoAndStop("Scene 1", 1);
};
myLabels = new Array ("today", "yesterday", "two days ago");
// Populate the listbox
for (i=0;i<myLabels.length;i++) {
date.addItem (myLabels*) ;
}
function comboDisplay (component) {
combodate = component.getSelectedItem().label ;
}
// assign the function to the combobox
date.setChangeHandler ("comboDisplay") ;
myLabels = new Array ("choose category", "food", "clothes", "entertainment", "self", "gift", "household");
// Populate the listbox
for (i=0;i<myLabels.length;i++) {
category.addItem (myLabels*) ;
}
function comboDisplay2 (component) {
combocat = component.getSelectedItem().label ;
}
// assign the function to the combobox
category.setChangeHandler ("comboDisplay2") ;
where.text = "";
amount.text = "";
onSubmit = function () {
loc = where.text;
amt = amount.text;
_root.gotoAndStop ("result");
}
Here’s what I have at ‘result’ - the two textboxes work, but not the two comboboxes:
stop();
result.text = loc+"
";
result.text+= combodate+"
";
result.text+= combocat+"
";
result.text+= amt;
Any idea what’s wrong with this picture?