This content has been marked as final. Show 5 replies
add the 'change' event listener and when the listener function fires you'll check the selected index of the combo box to change the state:
the code below may no compile:
case 0: this.currentState = ''; break;
case 1: this.currentState = 'state1'; break;
I'm not sure what that means. It can't be that different from a LinkButton?
Assign a listener for the ComboBox "change" event.
In the change listener, simply use the ComboBox "selectedIndex" value to determine the state you switch to. You don't have to use selectedIndex. You could use the ComboBox selectedLabel or the data value as well.
I added this script to the app:
var currentstate:Object = new Object();
Then this for the combobox:
<mx:ComboBox x="10" y="55" id="combobox1">
<mx:Object label="Choose" data="0"/>
<mx:Object selectedIndex="currentstate='I'" label="I" data="1"/>
<mx:Object label="II" data="2"/>
<mx:Object label="III" data="3"/>
Does it not work because the combobox id isn't being called?
You need to search FB help for how to add event listeners in MXML, in this case for the ComboBox change handler.