Bind TextInput to ArrayCollection with BindingUtils
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml">
<mx:Script>
import mx.binding.utils.BindingUtils;
public function doBinding():void
{
BindingUtils.bindProperty(myTextInput, "text", myAC.getItemAt(0), "author");
}
</mx:Script>
<mx:Binding source="myAC.getItemAt(0).urlData" destination="myLabelDest.text"/>
<mx:ArrayCollection id="myAC">
<mx:source>
<mx:Object urlData="http://a.com" author="a"/>
<mx:Object urlData="http://b.com" author="b"/>
<mx:Object urlData="http://c.com" author="c"/>
</mx:source>
</mx:ArrayCollection>
<mx:Label id="myLabelDest" text="prova" />
<mx:TextInput id="myTextInput" text=""/>
<mx:Button label="BindingUtils" click="doBinding()" />
</mx:Application>
Related examples in the same category