mx.binding.utils.BindingUtils

From: http://www.cetec77.com/kannan/BindUnbind.mxml
<?xml version="1.0" ?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml">
<mx:Script>
<![CDATA[
     import mx.binding.utils.ChangeWatcher;
     import mx.binding.utils.BindingUtils;
      
       private var watcher:ChangeWatcher;
      
       private function bindMe():void{
         watcher = BindingUtils.bindProperty(txt,"text", txtInp,"text");
       }
      
       private function unbindMe():void{
               watcher.unwatch();           
       }
  

 ]]>
 </mx:Script>
 <mx:TextInput id="txtInp" width="200" />
 <mx:Text id="txt" width="200" />
 <mx:Button label="Bind TextInput to Text" click="bindMe()" />
 <mx:Button label="Unbind TextInput to Text" click="unbindMe()" />
 </mx:Application>

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