Mega Code Archive

 
Categories / Flex / Data Model
 

Set style value with Array in MXML and apply those values inline

<?xml version="1.0"?> <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml">     <mx:Array id="myDepthColors">         <mx:Object>0xFFCC33</mx:Object>         <mx:Object>0xFFCC99</mx:Object>         <mx:Object>0xCC9900</mx:Object>     </mx:Array>     <mx:Array id="myAlternatingRowColors">         <mx:Object>red</mx:Object>         <mx:Object>green</mx:Object>     </mx:Array>     <mx:XMLList id="treeData">         <node label="File">             <node label="Save">                 <node label="Doc" />                 <node label="Pdf" />                 <node label="Rdf" />             </node>             <node label="Edit">                 <node label="Cut" />                 <node label="Copy" />                 <node label="Paste" />                             </node>             <node label="Window" />             <node label="Help" />         </node>     </mx:XMLList>     <mx:Panel title="Tree Control Example" width="100%">         <mx:Tree id="myTree"                   width="100%"                   labelField="@label"                  dataProvider="{treeData}"                   depthColors="{myDepthColors}"                  alternatingItemColors="{myAlternatingRowColors}" />     </mx:Panel> </mx:Application>