随笔-75  评论-193  文章-5  trackbacks-0
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="http://www.adobe.com/2006/mxml" layout="absolute">
 <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 阅读(368) 评论(0)  编辑  收藏 所属分类: Flex2

只有注册用户登录后才能发表评论。


网站导航: