Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
是否可以将类属性绑定到 mxml 组件?例如:我有一个A.as带有String属性的类nameValue。我想要实现的是始终mx:Text在nameValue.
A.as
String
nameValue
mx:Text
谢谢。
当然,只需这样做(假设您使用 mx 命名空间中的 Flex 3):
<MyComponent ns="whateverNSyourclassisin"> <ns:A id="myInstanceOfA" /> <mx:Text id="myTextField" text="foo" /> <mx:Binding source="myTextField.text" destination="myInstanceOfA.nameValue" /> </MyComponent>