Flex 3:[Bindable] 变量上的 ChangeWatcher 不起作用
我有一个名为 isConflict 的 Number 变量,其值是从父级传入的。我想在该项目上放置一个 ChangeWatcher,以便每当值更改时都会运行名为changeBGColor 的函数。在 init 的creationComplete 函数中,我有以下内容:
var isConflictWatch:ChangeWatcher = BindingUtils.bindSetter(changeBGColor, this, "isConflictChain");
但是,当 isConflict 的值发生更改时,不会调用该函数。有人可以帮忙吗?
I have a Number variable, named isConflict, whose value is passed in from a parent. I would like to put a ChangeWatcher on this item so that a function named changeBGColor will run whenever the value is changed. Within my creationComplete function of init, i have the following:
var isConflictWatch:ChangeWatcher = BindingUtils.bindSetter(changeBGColor, this, "isConflictChain");
However, the function is not being called when the value of isConflict changes. Can anybody help?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
你应该直接使用 ChangeWatcher,因为你并没有真正绑定任何东西:
You should just use a straight ChangeWatcher since you're not really binding anything: