AS3 console.log();

tracing to the browser console via as3 just got a whole lot easier

?View Code ACTIONSCRIPT
import net.peteshand.asWindow.utils.console;
console.log("trace to browser console");

Get Adobe Flash player

Download via Github

2 Comments

  1. I think its more easier.
    like this
    package
    {
    import flash.external.ExternalInterface;
    /**
    * …
    * @author Nidin Vinayakan
    */
    public final class Console
    {

    static public function log(…value):void {
    if (ExternalInterface.available) {
    ExternalInterface.call(“console.log”, value);
    }else {
    trace(value);
    }
    }
    static public function alert(…value):void {
    if (ExternalInterface.available) {
    ExternalInterface.call(“alert”, value);
    }else {
    trace(value);
    }
    }

    }

    }

    Github project : https://github.com/nidin/JSAS

  2. Hi Nidin

    I’d agree with you to some extent, my classes were designed to do a lot more than just Console.log and Alert so they’re not quite as simplistic as yours (I mean that in a good way). I like that fact that you can pass in arrays and other objects with your functions, nice work… I might steal that 😛

Submit a Comment

Your email address will not be published. Required fields are marked *