Hello,
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.
Hello,
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>