Need help with changing text with combobox state change
Posted
by Mirage
on Stack Overflow
See other posts from Stack Overflow
or by Mirage
Published on 2010-06-01T02:59:33Z
Indexed on
2010/06/01
3:13 UTC
Read the original article
Hit count: 220
actionscript-3
|combobox
I have one text box and one combobox.
I want it such that when someone changes the combobox value, the text should change in the text field.
priceText
is the name of text box
My code is below; it's not working:
var comboFar:ComboBox = new ComboBox();
addChild(comboFar);
var items2:Array = [
{label:"Arizona", data:"87.97"},
{label:"Colorado", data:"91.97"},
];
comboFar.dataProvider = new DataProvider(items2);
comboFar.addEventListener("change",testFar());
function testFar(event):void {
priceText.text =event_obj.target.selectedItem.data;
}
© Stack Overflow or respective owner