Create an Object, adds properties, and inspect its properties : Object « Development « Flex






Create an Object, adds properties, and inspect its properties

Create an Object, adds properties, and inspect its properties
           
<?xml version="1.0"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
    creationComplete="initApp()">
    <mx:Script>
        private var obj:Object = new Object();
        private function initApp():void {
            obj.a = "A";
            obj.b = "B";
            obj.c = "C";
        }
        public function dumpObj():void {
            for (var p:String in obj) {
                ta1.text += p + ":" + obj[p] + "\n";
            }
        }
  </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.Create a generic Object, adds properties to that objectCreate a generic Object, adds properties to that object
2.Define objects using properties directly in the Object tagsDefine objects using properties directly in the Object tags
3.Bind to a Generic ObjectBind to a Generic Object
4.Using source and property properties to specify an objectUsing source and property properties to specify an object