Use BindingUtils to bind property
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" initialize="initializeHandler(event)">
<mx:Script>
import mx.binding.utils.BindingUtils;
import mx.binding.utils.ChangeWatcher;
private var _changeWatcher:ChangeWatcher;
private function initializeHandler(event:Event):void {
_changeWatcher = BindingUtils.bindProperty(selectedLevel, "text",level, "value");
}
</mx:Script>
<mx:VBox>
<mx:ComboBox id="level">
<mx:Array>
<mx:Object label="A" data="1" />
<mx:Object label="B" data="2" />
<mx:Object label="C" data="3" />
<mx:Object label="D" data="4" />
</mx:Array>
</mx:ComboBox>
<mx:TextInput id="selectedLevel" />
</mx:VBox>
</mx:Application>
Related examples in the same category