Data binding with data model:-
In this example we have used data model for binding data for objects.
Example:-
|
<?xml version="1.0"?> <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"> <mx:Model id="datamodel"><data> <firstname>{firstname.text}</firstname> <lastname>{lastname.text}</lastname> </data> </mx:Model> <mx:TextInput id="firstname" width="200"/> <mx:TextInput id="lastname" width="200"/> <mx:Label text="{datamodel.firstname}"/> <mx:Label text="{datamodel.lastname}"/></mx:Application> |
output:-

Running Example:
If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.
Ask your questions, our development team will try to give answers to your questions.