Mega Code Archive

 
Categories / Flex / Data Model
 

For each variable from xml data

<?xml version="1.0"?> <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" creationComplete="getDetails()">     <mx:Script>         import flash.utils.*;         public function getDetails():void {             var classInfo:XML = describeType(button1);             ta2.text = classInfo.toString();             ta1.text = "Class " + classInfo.@name.toString() + "\n";                          for each (var v:XML in classInfo..variable) {                 ta1.text += "Variable " + v.@name + "=" + button1[v.@name] + " (" + v.@type + ")\n";             }              }       </mx:Script>     <mx:Button label="Submit" id="button1" />     <mx:TextArea id="ta1" width="400" height="200" />     <mx:TextArea id="ta2" width="400" height="200" /> </mx:Application>