Reputation: 35276
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
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/
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
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