开发者

How do I use Flex's Binding in a Flash AS3 project

开发者 https://www.devze.com 2022-12-26 14:04 出处:网络
I have a flash app us开发者_运维问答ing the flex framework - I would like to bind a display object textField with data from my dataModel.

I have a flash app us开发者_运维问答ing the flex framework - I would like to bind a display object textField with data from my dataModel. How do I do this without the flex binding brackets "{ }"

Thanks in advance everyone.


The easiest way to do this is to use the BindingUtils class. For example, say you have an object foo with property bar that you want to bind to your text area's text property; all you need to do is the following in your ActionScript:

BindingUtils.bindProperty( myTextArea, "text", foo, "bar" );

This will tell Flex to watch foo for any changes to the property bar, and when changes occur, copy the value to myTextArea.text.

Full documentation can be found here.

0

精彩评论

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

关注公众号