
TUTORIALS POINT
Simply Easy Learning Page 43
Flex – Data Binding
This chapter describes the Data Binding concepts.
What is Data Binding?
D
ata Binding is a process in which data of one object is tied to another object. Data binding requires a
source property, a destination property and a triggering event which indicates when to copy the data from source to
destination.
Flex provides three ways to do Data Binding
Curly brace syntax in MXML Script ({})
<fx:binding> tag in MXML
BindingUtils in ActionScript
Data Binding - Using Curly Braces in MXML
Following example demonstrates using curly braces to specify data binding of a source to destination.
<s:TextInput id="txtInput1"/>
<s:TextInput id="txtInput2" text = "{txtInput1.text}"/>
Data Binding - Using <fx:Binding> tag in MXML
Following example demonstrates using <fx:Binding> tag to specify data binding of a source to destination.
<fx:Binding source="txtInput1.text" destination="txtInput2.text" />
<s:TextInput id="txtInput1"/>
<s:TextInput id="txtInput2"/>
Data Binding - Using BindingUtils in ActionScript
Following example demonstrates using BindingUtils to specify data binding of a source to destination.
Commenti su questo manuale