P988
Binding data with the <mx:Binding> tag
該章節和Binding data with curly braces基本一樣,講了如下幾個方面的內容:
1、Using ActionScript expressions in Binding tags
??????在BindingTags中使用ActionScript表達式
2、Binding more than one source property to a destination property
??????將多個源屬性綁定到一個目的屬性上
3、Binding a source property to more than one destination property
??????將一個源屬性綁定到多個目的屬性上
4、Using an E4X expression in an <mx:Binding> tag
??????在<mx:Binding>標簽中使用E4X表達式
上述四種情況在文中都有例子,仔細看一下,理解起來應該沒有問題。
第三種情況中的例子應該修改為如下,才可以正確運行,在文中的例子中沒有<mx:Binding>的相關配置。
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="
?<mx:TextInput id="input1" text="Hello" />
?<mx:Model id="mod1">
??<part>{input1.text}</part>
?</mx:Model>
?<mx:Model id="mod2">
??<part>{input1.text}</part>
?</mx:Model>
?<mx:Label id="label1" x="10" y="30" text="{mod1.part}"/>
?<mx:Label id="label2" x="10" y="60" text="{mod2.part}"/>
?
?
<mx:Binding source="input1.text" destination="mod1.part"/>
?<mx:Binding source="input1.text" destination="mod2.part"/>
?<mx:Binding source="mod1.part" destination="label1.text"/>
?<mx:Binding source="mod2.part" destination="label2.text"/>
</mx:Application>
posted on 2006-11-05 23:14
The Matrix 閱讀(393)
評論(0) 編輯 收藏 所屬分類:
Flex2