/ Published in: ActionScript

Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
print_r = function(theObj,indent){ var output=String(theObj)+"\n"; if (indent == undefined) { indent = " "; } else { indent += " "; } if(theObj.constructor == Array || theObj.constructor == Object) { for(var p in theObj){ if(theObj[p].constructor == Array|| theObj[p].constructor == Object){ var type = (theObj[p].constructor == Array) ? "Array" : "Object"; output += indent+"["+p+"]("+type+")=>\n"; output += print_r(theObj[p],indent); } else { output += indent+"["+p+"]:"+theObj[p]+"\n"; } } } trace(output); }
Comments
