Use mx.utils.ObjectUtil.toString() to print all dynamically added properties of an object : ObjectUtil « Development « Flex






Use mx.utils.ObjectUtil.toString() to print all dynamically added properties of an object

Use mx.utils.ObjectUtil.toString() to print all dynamically added properties of an object
        

<?xml version="1.0"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
    creationComplete="initApp()">
    <mx:Script>
    import mx.utils.ObjectUtil;
    private var obj:Object = new Object();
    private function initApp():void {
        obj.a = "A";
        obj.b = "B";
        obj.c = "C";
    }
    public function dumpObj():void {
        ta1.text = ObjectUtil.toString(obj);
    }
  </mx:Script>
    <mx:TextArea id="ta1" width="400" height="500" />
    <mx:Button label="Dump Object" click="dumpObj()" />
</mx:Application>

   
    
    
    
    
    
    
    
  








Related examples in the same category

1.Use getClassInfo() and toString() methods to show the properties of the Button controlUse getClassInfo() and toString() methods to show the properties of the Button control
2.Using ObjectUtil to dump an object's properties
3.ObjectUtil.getClassInfo() returns an Object with the name and properties of the target objectObjectUtil.getClassInfo() returns an Object with the name and properties of the target object
4.use mx.utils.ObjectUtil.toString()use mx.utils.ObjectUtil.toString()