开发者

Flex bind class property to mxml component

Is is possible to bind class properties to 开发者_运维知识库mxml components ? E.g.: I have a class A.as with a String property nameValue. What I want to achieve is always having the latest value of a mx:Text component in nameValue.

Thanks.


Sure, just do this (assuming Flex 3 from your use of the mx namespace):

<MyComponent ns="whateverNSyourclassisin">
    <ns:A id="myInstanceOfA" />        
    <mx:Text id="myTextField" text="foo" />
    <mx:Binding source="myTextField.text" destination="myInstanceOfA.nameValue" />
</MyComponent>
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜