examples
Two-way Bindings
Binding between two properties in Flex 4 is insanely easy now. Instead of just using “{}”, now you can add an @ to make it go both ways: “@{}”. In this example, you’ll see the @ in the text property of the second TextArea which will two-way bind with the text property of the first TextArea.
You can test this out by typing the the two TextAreas below:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 | <?xml version="1.0" encoding="utf-8"?> <s:Application xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:s="library://ns.adobe.com/flex/spark" xmlns:mx="library://ns.adobe.com/flex/halo" > <s:layout> <s:VerticalLayout/> </s:layout> <s:TextArea id="firstTextField" width="100%" height="50%" fontSize="20" /> <s:TextArea id="secondTextField" text="@{firstTextField.text}" width="100%" height="50%" /> </s:Application> |
Search
Recent Posts
Recent Comments
- chd on Flex 4 Layouts
- Djam on Flex 4 Layouts
- Brakxel on Flex 4 Layouts
- Flex 4 Resources – Samples and Links! « Devgirl’s Weblog on Flex 4 Layouts
- reledev on Flex 4 Layouts
