Published in: ActionScript 3
URL: http://portfolio.artillery.ch/downloads/var_dump-for-as3
Update: the typeof() function returns 'object' for an array. so there's no need to specifically include it in the switch-case query.
Expand |
Embed | Plain Text
public function analyze(_obj):void { var item:Object; switch (typeof(_obj)){ case "object": write("<object>"); write(_obj.toString()); for each (item in _obj){ analyze(item); }; write("</object>"); break; case "xml": write("<xml>"); write(_obj); write("</xml>"); break; default: write(_obj + " (" + typeof(_obj) + ")"); break; }; } // analyze() public function write(_obj):void{ trace(_obj); } // END write()
Comments
Subscribe to comments
You need to login to post a comment.
If you want to test the function you can use the following code: var boolean:Boolean = false; var string:String = "Lorem"; var number:Number = 23; var array:Array = new Array(1,2,"3"); var object:Object = new Object(); object.string = string; object.number = number; object.array = array;
thanks for this bit of code
MBT Shoes for Masai Barefoot Technology.The MBT company that makes these shoes is Swiss Masai.The uniquely-designed,multi-layered,cured sole is designed to simulate walking in sand,such as mbt baridi,mbt kimondo,mbt sapatu and so on.mbt unono creates a natural,uneven walking surface and forces the body to use all the major and stabilsing muscle groups,thus training the whole body to move correctly.In this special summer,our online stroe hot in MBT Shoes clearance,you will choose such mbt salama or mbt kisumu.