import mx.events.PropertyChangeEvent;
import mx.binding.utils.ChangeWatcher;
import mx.binding.utils.BindingUtils;
import mx.controls.Alert;
private var namewatcher:ChangeWatcher;
private function init():void
{
namewatcher = BindingUtils.bindProperty(textArea,"text",person,"text");
ChangeWatcher.watch(textArea,"text",nameSetter);
// textArea.addEventListener(Event.CHANGE,change);
//namewatcher.unwatch();
}
private function bindMe():void{
namewatcher = BindingUtils.bindProperty(txt,"text", txtInp,"text");//前面属性跟着后面属性变化
}
private function unbindMe():void{
namewatcher.unwatch();
}
private function nameSetter(event:Event):void
{
Alert.show(event.toString());
}
private function change(event:Event):void
{
// Alert.show("changed");
}
]]>