quarks
quarks

Reputation: 35276

Logging with FireFox/FireBug

I have this code below, what do I need to be able to be able to log with FireFox/FireBug:

package {
  import flash.display.Sprite;
  import flash.external.ExternalInterface;

  public class FlashRecorder extends Sprite {
    public function FlashRecorder() {
      var logger:Logger;
      logger = new Logger();
      ExternalInterface.addCallback("debugLog", logger.debugLog);
      var recorder = new Recorder(logger);
      recorder.addExternalInterfaceCallbacks();
    }
  }
}

Such that, when I do:

logger.log('startPlaying');

It will be logged in Firefox/firebug

Upvotes: 0

Views: 467

Answers (2)

shaunhusain
shaunhusain

Reputation: 19748

So far as debugging is concerned you've got quite a few options out there here's some options.

AS3

http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/package.html#trace()

http://www.as3commons.org/as3-commons-logging/

http://nochump.com/blog/archives/24

http://code.google.com/p/flash-tracer/

http://demonsterdebugger.com/

    private function logToBrowserConsole(somethingToLog:String):void
    {
        ExternalInterface.call("console.log", somethingToLog);
    }

Flex 3+

http://livedocs.adobe.com/flex/3/html/help.html?content=logging_09.html

http://code.google.com/p/fxspy/

Upvotes: 1

hoang nguyen
hoang nguyen

Reputation: 2189

To log with FireBug, you just using: console.log, detail in http://michaelsync.net/2007/09/30/firebug-tutorial-script-tab-javascript-debugging

Upvotes: 1

Related Questions