flex4中新增了双向绑定功能,有三种方式可以来实现绑定:
1
<!-- Specify data binding for both controls. -->
<s:TextInput id="input1" text="{input2.text}"/>
<s:TextInput id="input2" text="{input1.text}"/>
2
<s:TextInput id="input1" text="<span style="color: #ff0000;">@</span>{input2.text}"/>
<s:TextInput id="input2"/>
3
<fx:Binding source="input1.text" destination="input2.text" <span style="color: #ff0000;">twoWay="true"</span> />