Created
May 5, 2013 02:23
-
-
Save IQAndreas/5519431 to your computer and use it in GitHub Desktop.
Log flash data both to `trace` and the JavaScript console.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package | |
{ | |
import flash.external.ExternalInterface; | |
/** Will send the text to trace and JavaScript console (if available) | |
* Only to be used for debugging. Not to be used for final release! */ | |
public function log(...args:*) : void | |
{ | |
//Nothing to log | |
if (args.length <= 0) { return; } | |
for (var i:uint = 0; i < args.length; i++) | |
{ | |
if (ExternalInterface.available) | |
{ ExternalInterface.call("console.log", args[i]); } | |
} | |
//Join strings instead? | |
trace(args.join(" ")); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment