我可以将Flex组件属性绑定到函数吗?

我想根据具有一个或多个参数的函数的返回值在按钮上设置enabled属性.我怎样才能做到这一点?
private function isUserAllowed (userName:Boolean):Boolean {
   if (userName == 'Tom')
      return true;
   if (userName == 'Bill')
      return false;
}

<mx:Button label="Create PO" id="createPOButton"
enabled="<I want to call isUserAllowed ('Bill') or isUserAllowed ('Tom') here>"
click="createPOButton_Click()" />

解决方法

<mx:Button
enabled = "{this.myFunction(this.myVariable)}"
>

或内联:

<mx:Button
enabled = "{(function(arg:Object):Boolean{ ... })(this.myVariable)}"
>

相关文章

一:display:flex布局display:flex是一种布局方式。它即可以...
1. flex设置元素垂直居中对齐在之前的一篇文章中记载过如何...
移动端开发知识点pc端软件和移动端apppc端软件是什么,有哪些...
最近挺忙的,准备考试,还有其他的事,没时间研究东西,快周...
display:flex;把容器设置为弹性盒模型(设置为弹性盒模型之后...
我在网页上运行了一个Flex应用程序,我想使用Command←组合键...