2012-09-17 3 views
1

부울을 조건으로 묶고 싶습니다. 이것은 mxml에서 가능하지만 어떻게 이것을 ActionScript에서 할 수 있습니까?플렉스 3 부울을 조건과 부울을 .as

예 :

.mxml 바인딩 : 바인딩

enabled={(A_changed || B_changed || C_changed || D_changed) && rs.selectedIndex !=-1}/> 

이 .as :

BindingUtils.bindProperty(this.myBtn,'enabled',????); 

감사합니다, 데이브

답변

0

문제에 더 게으른 해결책은 없다 - Flex 컴파일러는 MXML 바인딩에서 많은 변형을 수행합니다. 바닐라 AS3에서는 사용할 수 없습니다. 모든 속성에 BindingUtils.bindSetter을 첨부해야합니다. 다음과 같음 :

var closure:Function = function(...triggers):void { 
    enabled = (A_changed || B_changed || C_changed || D_changed) && rs.selectedIndex !=-1; 
} 
BindingUtils.bindSetter(closure, this, "A_changed"); 
BindingUtils.bindSetter(closure, this, "B_changed"); 
BindingUtils.bindSetter(closure, this, "C_changed"); 
BindingUtils.bindSetter(closure, this, "D_changed"); 
BindingUtils.bindSetter(closure, rs, "selectedIndex"); 
+0

_thanks that it._ – Dave

관련 문제