Actionscript 3 equivalent of PHP's print_r
If you’re coming from PHP and miss having print_r for dumping objects and arrays while debugging, ActionScript 3 doesn’t have a built-in equivalent. The trace() function only gives you basic output.
A brilliant version of print_r for ActionScript was available here:
http://dev.base86.com/solo/47/actionscript_3_equivalent_of_phps_printr.html
The idea was to recursively walk through an object’s properties and output them in a readable, indented format — just like PHP’s print_r does. This was incredibly useful for debugging complex nested objects, especially when working with XML data or API responses in Flash.
For simple cases, you could also use JSON.stringify(obj, null, 2) in AS3 if you were targeting Flash Player 11+, which gave you a similar readable dump of any object.