-
Book Overview & Buying
-
Table Of Contents
Flex 3 with Java
By :
Data binding is the process of tying the data of one object to another object. This is a very convenient way to tie data sources with the Flex component without worrying about how to update components if data source changes dynamically. When you use data binding, the destination object gets updated automatically if the source object changes. It may sound very confusing at this point, but let me give you a simple example.
In the following example, I will use the TextInput and Label controls, and bind the TextInput control's text property with the Label control's text property. So whenever you change text in the TextInput control, it will automatically reflect in the Label control's text property.
Example of data binding:
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml">
<mx:TextInput id="myTextBox"/>
<mx:Label id="myLabel" text="{myTextBox.text}"/>
</mx:Application>
And that's it. You have successfully...
Change the font size
Change margin width
Change background colour