Screen cast
Check out the screen cast at video.google.com for version 0.0.9. The quality is bad but mb0 added subtitles. And the downloadable version is almost readable.
Creating your first log message
- If you havent already linked the ASDT logger classes to your project then go to Project→Properties→AS2 Classpath and click Link Logger Class
- Add a log message to your class. For example, based on the sample class you created here add this code to the main function:
The parameters are: the log message, followed by the log level. Code completion should give you access to the log levels available in the class.
trace("Hello logger", Log.INFO);
- If the build properties are set correctly, when you save the class the SWF should be recompiled.
- Open your built SWF in the Eclipse SWFViewer (based on the GuideNewProject Example it will be ‘Hello.swf’) and the logging console view should open automatically and display the message.
TIP: To keep the Console focused, use the ‘Pin Console’ button on the Console panel.
TIP: There are several Consoles: the trace message appears in ActionScript?! Console (also labeled ActionScript?! Logger). The other console is labeled ActionScript?! Compiler and displays compiler messages. Toggle between these using the terminal icon to the right of the console window.
TIP: It is important that the "loggers" directory is included in the classpath for the project. If it is not then you will see an error that the Log class cannot be found. To add the "loggers" directory to the class path do the following: right click on the ActionScript? project, select the "Properties" menu item, select "AS2 Classpath", click "Add project folder", and select the loggers folder from the root of the project directory.
Experimenting with Log levels
- To see output for different log levels, add the following code:
trace("Log.DEBUG", Log.DEBUG); trace("Log.INFO", Log.INFO); trace("Log.WARNING", Log.WARNING); trace("Log.ERROR", Log.ERROR);
Using ASDT Logging with the Flash IDE
If you want to compile an FLA that uses ASDT logging features, you will need to include the ASDT Log classes in the FLA classpath.
- In the Flash IDE choose File→Publish Settings. Select the Flash tab, then ‘Settings...’. Browse to the logging classes - the ActionScript classes are in your Eclipse installation folder in “plugins\org.asdt.logger_0.0.9\lib\flash_classes”.
- Initialize the logger calling ‘setLogger’ in the first frame of your FLA:
Log messages will now appear in the Flash Output panel.
Log.setLogger("TraceLogger");
- You can then add log messages:
Log.addMessage("Created A Log");
