|
|
ThunderBolt AS3
ThunderBolt AS3 is a lightweight logger extension for Flex 2/3 and Flash ActionScript 3 applications using Firebug within Firefox as simple as possible.
It’s open source and based on the Mozilla Public License 1.1.
Using Flex Builder
1) In Flex Builder add the ThunderBoltAS3_Flex.swc as your library file (Flex Builder -> Your Project -> Properties -> Flex Build Path -> Library Path -> Add SWC) or use the package located in org.osflash.thunderbolt
2a) Using ThunderBolt's Logger.as instance:
import org.osflash.thunderbolt.Logger;
var myNumber: int = 5;
var myString: String = "Lorem ipsum";
Logger.error ("Logging two objects: A number typed as int and a string", myNumber, myString);2b) Or using ThunderBoltTarget.as based on the Flex Logging Framework:
import mx.logging.Log;
import org.osflash.thunderbolt.ThunderBoltTarget;
// init ThunderBoltTarget
_target = new ThunderBoltTarget();
/*
You can disable the time, level or category as well
_target.includeTime = false;
_target.includeLevel = false;
_target.includeCategory = false;
*/
_target.filters = ["de.websector.playground.ThunderBoltTargetExample"];
Log.addTarget(_target);
// start logging
Log.getLogger("de.websector.playground.ThunderBoltTargetExample").info("Just an info message.");Using Flash CS3
1) Create a new folder called "ThunderBoltAS3" in the Flash CS3 components folder located here
OS X: Mac HD:Application:Adobe Flash CS3:Configuration:Components
WIN: C:\Program Files\Adobe\Adobe Flash CS3\{lang}\Configuration\Components
Copy ThunderBoltAS3_Flash.swc to it.
2) Open Flash IDE and select on the Component Panels (Windows -> Components) the Options menu to refresh its view ("Reload"). You'll see a folder named "ThunderBoltAS3" within the Component Panel. Open this folder and drag the component called "Logger" to the Stage. Remove it. Then you'll have a ThunderBoltAS3 component in your library.
3) Using ThunderBolt's Logger.as instance:
import org.osflash.thunderbolt.Logger;
var myNumber: int = 5;
var myString2: String = "Lorem ipsum";
Logger.error ("Logging two objects: A number typed as int and a string", myNumber, myString);Additional features
1) Get the info about the memory in use by Flash Player:
Logger.info(Logger.memorySnapshot());
2) Stop logging - which hides all outputs to Firebug:
// stop logging Logger.hide = true; // resume logging Logger.hide = false;
3) Info about the version you're using:
Logger.about();
Any issues with...
1) ...Flash Player security sandbox?
If you have any security issues with the Flash Player security sandbox set on your HTML page the value of the "allowScriptAccess" parameter to "always". For more information check Adobes Flex 2 Developer's Guide: " About ExternalInterface API security in Flex"
2) ...receiving empty messages in Firebugs console?
Please reload your site and try it again. It could be an issue connecting Firebug using ExternalInterface.
3) ...any else?
Feel free to post your issues on ThunderBolts Issue page or describe it on Google Thunderbolt Group
Tutorials / Tips 'n' Tricks
You'll find tutorials, tips and tricks for using ThunderBolt AS3 on WS-Blog.
Live examples
Download source
Grab here the latest ThunderBolt AS3 package.
Author
Jens Krause (aka sectore)
Sign in to add a comment

Great !!! 10x so much people !
well that's just freakin' rad.
installed in 2 minutes.
yum!
sorry, I just have to gush some more...
this is seriously a quantum leap in my runtime .swf debugging experience...much appreciated!