ThunderBolt AS3 ist ein Logging Tool, das im Zusammenspiel mit der Firefox-Erweiterung Firebug das Ausgeben von Informationen im Browser ermöglicht. So können z.B. Variablenwerte, Fehler oder Warnungen in Firefox angezeigt werden (analog zum Ausgabefenster in der Flash IDE) .
ThunderBolt ersetzt quasi den trace()-Befehl und zeigt die Informationen über die Firebug-Erweiterung an. Wer Firebug installiert hat, kann das folgende Beispiel ausprobieren: Einfach Firebug starten, etwas in das Textfeld schreiben, dann auf den Button klicken.
[kml_flashembed movie=“/wp-content/uploads/2008/01/thunderbolt.swf“ height=“200″ width=“400″ /]
ThunderBolt AS3 basiert auf ActionScript 3, weshalb es mit Flash CS3 oder Flex 2 genutzt werden kann. Es ist Open Source.
Die Features der Version 1.0 sind:
- Log levels: INFO, WARN, ERROR, DEBUG (FATAL, ALL)
- Tree view for complex object structures such as class identifier and its properties
- Custom LogTarget based on Flex Logging API including filters
- Memory snapshot
- SWC components for logging using Flex 2 or Flash CS3. Only 4kB for the Flash based SWC and 24kB for Flex one using the Flex 2 Logging Framework.
Link: ThunderBolt AS3 (Google Code)
Link: Firebug
[ad]
Vielen Dank für die coolen Tipps. Sowas habe ich schon lange gesucht.
Hier noch der Quellcode für das ThunderBolt-Beispiel:
import org.osflash.thunderbolt.Logger;
myButton.addEventListener(MouseEvent.MOUSE_UP, sendMessage);
function sendMessage(e:Event) {
Logger.info ("Das Textfeld lautet:", myTxtInput.text);
}
Hier ein weiteres Log-Tool mit dem Namen LogBook. Es scheint allerdings nur mit Flex, nicht mit Flash zu funktionieren.
Die Log-Informationen werden in einer Adobe-Air-Anwendung ausgeben.
„The LogBook application listens on a LocalConnection to messages sent from any application. When you launch LogBook, it will prompt you to enter the name of the connection you want to listen to. On the other end, in your Flex application, you must use the LocalConnectionTarget object in the cim.fx.logging.targets package as a logging target.“
Logbook
Hier gibt es „10 tips and tricks using ThunderBolt AS3“
– Using different log levels
– Logging one or more objects at once
– Using the Flex Logging API
– Stop and hide logging
– Show a memory snapshot
– Show or hide a time stamp
– Using the new ThunderBolt AS3 (v.2) and its Console
– Using the ThunderBolt AS3 Console for logging ActionScript 1 or 2 projects
– Any issues with the Flash Player security sandbox using Firebug?
– Issues using ThunderBolt AS3 Console on Windows?
http://www.websector.de/blog/2008/06/15/10-tips-and-tricks-using-thunderbolt-as3/
ThunderBolt AS3 gibt es jetzt in Version 2, die auch Flex 4 (Gumbo) unterstützt.
http://www.websector.de/blog/2008/08/03/thunderbolt-as3-supports-flex-4-gumbo/