Bind control's data to Model and use model data in another control
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="vertical">
<mx:Model id="myFormData">
<signin>
<user>{userTxt.text}</user>
<pass>{passTxt.text}</pass>
</signin>
</mx:Model>
<mx:Panel title="title">
<mx:Form>
<mx:FormHeading label="Sign In" />
<mx:FormItem label="User ID">
<mx:TextInput id="userTxt" />
</mx:FormItem>
<mx:FormItem label="Password">
<mx:TextInput displayAsPassword="true" id="passTxt" />
</mx:FormItem>
<mx:Button label="Send data" />
</mx:Form>
<mx:Label text="UserID: {myFormData.user}, Password :{myFormData.pass}" />
</mx:Panel>
</mx:Application>
Related examples in the same category