Skip to content

Instantly share code, notes, and snippets.

@kylehill
Created September 20, 2012 17:32
Show Gist options
  • Select an option

  • Save kylehill/3757235 to your computer and use it in GitHub Desktop.

Select an option

Save kylehill/3757235 to your computer and use it in GitHub Desktop.
Mass-quantity safe debugger for AS3
public function emitter(... args):void {
var output:Array = [];
for (var param:Number = 0; param < args.length; param++) {
try {
if (getQualifiedClassName(args[param]) === "Array") {
var obj = args[param][0];
if (obj == "splice") {
obj = args[param][1]
for (var level:Number = 2; level < args[param].length; level++) {
obj = obj[level];
}
}
output.push(obj);
}
else {
output.push(args[param])
}
}
catch (e:Error) {
output.push("ERROR");
}
}
ExternalInterface.call("console.log", "Console Emitter: ", output);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment