BindingUtils.bindSetter用法

以往我们在做组件数据绑定的时候通常是用一对花括号{},来绑定某些属性,很是方便。有时候我想通过改变组件的状态,去影响AS代码里变量的值,就可以用BindingUtils.bindSetter
import mx.binding.utils.BindingUtils;
import mx.binding.utils.ChangeWatcher;

private var _select:Boolean;
private var watcher:ChangeWatcher;

private function init():void{
watcher = BindingUtils.bindSetter( onChange ,checkBox, "selected");
}

private function onChange(b:Boolean):void{
_select = b;
}

对BindingUtils的介绍还有
http://blog.csdn.net/czx33859066/archive/2009/02/02/3857711.aspx
http://blog.csdn.net/czx33859066/archive/2009/02/03/3857719.aspx
http://blog.csdn.net/dante_k7/archive/2009/06/10/4257306.aspx

你可能感兴趣的:(.net,Blog)