ActionScript에서 MXML-esque "바인딩 문자열"을 지정할 수 있습니까?플렉스 : 액션 스크립트에서 MXML-esque "바인딩 문자열"에 바인딩 하시겠습니까?
MXMLBinding(this, "first_item",
this, "{myArrayCollection.getItemAt(0)");
MXMLBinding(this, ["nameLbl", "text"],
this, "Name: {somePerson.first} {somePerson.last}");
편집 :
예를 들어, 내가 좋아하는 뭔가를 할 수 있도록하려면이 작업을 수행 할 수없는 것처럼 응답과 제안 ... 감사는 기본적으로 보인다. 나는 주변을 파고 왜 그랬는지 알아 냈다. ,
…
BindingUtils.bindSetter(updateName, this, ["somePerson", "first"]);
BindingUtils.bindSetter(updateName, this, ["somePerson", "last"]);
…
protected function updateName(...ignored):void {
this.nameLbl.text = "Name: " + somePerson.first + " " + somePerson.last;
}
arrayCollection.getItemAt(0)
에 바인딩, 조금 못생긴 ... 그리고 최초의 예는 다음과 같습니다
중괄호 {} 바인딩은 MXML에만 적용되며 순수 AS3에서는 사용할 수 없습니다. BindingUtils는 갈 길입니다. – joshtynjala