关于Flex的Binding

关于Flex的Binding
1.第一种情况的代码

 
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="vertical">
    <mx:TextInput id="sourceUser" />
    <mx:Label id="targetUser1" text="1"/>
    <mx:Label id="targetUser2" text="2"/>
    <mx:Binding source="sourceUser.text" destination="targetUser1.text,targetUser2.text"/>
</mx:Application>
 

效果:
 只更新了后一个Label
2.第二种情况的代码

<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"  layout="vertical">
     <mx:TextInput id="sourceUser" />
    <mx:Label id="targetUser1" text="1"/>
    <mx:Label id="targetUser2" text="2"/>
    <mx:Binding source="sourceUser.text" destination="targetUser2.text,targetUser1.text"/>
</mx:Application>
 


效果:
初始化的时候1消失了

不解~~

你可能感兴趣的:(xml,Flex,Adobe)