Apr
2008
MXML is XML (Duh?)
Posted in Flex, Flex for CF'ers
Just a quickie today, something that I came across while playing around with Flex. It could very well be a "duh, Charlie" observation, but i think it bears mentioning.
Flex makes it very easy to bind elements to other elements or objects. What this means is that a DataGrid, for example, can be populated by the contents of an ArrayCollection (for CF'ers, think of an ArrayCollection as an array of structures). The first step is to declare the variable as bindable in your <mx:Script> block:
[Bindable] private var myArray:ArrayCollection;
Your DataGrid would then be declared as follows:
<mx:DataGrid dataProvider="{myArray}" id="myDataGrid">
The curly braces around the value of the dataProvider attribute indicates that it's a bindable variable. All pretty straightforward. But there are other ways to use bind variables to influence the behavior of an element.
Read More...
