Archive by Author

Logging Flash, Flex and AIR outside the IDE

Posted on June 18th, 2008 by Riccardo, under AIR, Actionscript, Flash, Flex.

I’ve discovered myself that logging can save a lot of time in developing an application. I’ve used initially the well known trace action, that permits to send messages to the Output Panel of the Flash (or FlashDevelop) or Flex Builder IDE.
Then I’ve used some class like Out from BigSpaceShip Labs. I’ve added a call to the debug method of the Out class in all the methods of my classes, using it like this:

?View Code ACTIONSCRIPT
1
2
3
4
private function constructUI():void {
     Out.info(this, "constructUI");
     /*...*/
}

and having an output like this:

INFO: com.unicoshop.UnicoShop: setConnection
INFO: com.unicoshop.UnicoShop: initApplication
INFO: com.unicoshop.views.TabView: setApplicationGlobally
INFO: com.unicoshop.views.stats.StatisticheVenditeTempoReale: setConnection
INFO: com.unicoshop.views.manager.VenditaArticoli: setConnection
INFO: com.unicoshop.views.manager.ArticoliResiFornitore: setConnection
INFO: com.unicoshop.views.manager.ArticoliVenduti: setConnection

Out is powerful than the trace command, but like it doesn’t work outside of the IDE.

So I googled and I found this two great logging tools, both works in Flash and Flex projects, works under Windows, Macintosh and Linux, and both permits to log the output of Flash and Flex in a custom AIR Application (using LocalConnection to connect to the source swf or reading the flashlog.txt outputted by the debug version of the Flash Player):

  • Arthropod
    (from Lee Brimelow’s blog)
    The application is named Arthropod allows you to color-code your log messages for easy viewing. All you need to do is add their debug class to your project and use the log method instead of the usual trace command. This will be particularly useful for AIR projects created in the Flash CS3 as the trace command doesn’t work unless in debug mode.

    Usage example:

    ?View Code ACTIONSCRIPT
    1
    2
    3
    4
    5
    
    import com.carlcalderon.arthropod.Debug;
     
    Debug.log("My log message");
    Debug.warning("My warning message");
    Debug.error("My error message");

    If you are using Arthropod to log an AIR application make sure you have checked the “insecure” option.
    This is a screenshot of my system running a Flex based AIR application, logged with Anthropod:

  • Thunderbolt
    (from the website)
    ThunderBolt is a logger extension for Flash ActionScript 2 and 3 as well as Flex 2 and 3 applications based on the Firebug add-on for Firefox.For logging without Firebug, especially for AIR applications, check out the new ThunderBolt AS3 Console. Unfortunately the Thunderbolt AS3 Console AIR application doesn’t work on Windows, due to a “limitation” of the win version of the AIR Runtime.
    Update: the problem is fixed installing the updated AIR 1.1, I’ve just tested it!

    Usage example:

    ?View Code ACTIONSCRIPT
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    
    import org.osflash.thunderbolt.Logger;
     
    Logger.includeTime = true;
     
    Logger.memorySnapshot();
     
    var myNumber:int = 5;
    var myString:String = "Lorem ipsum";
     
    Logger.debug("My debug message", myNumber, myString);
    Logger.error("My error message", myNumber, myString);
    Logger.info("My info message", myNumber, myString);
    Logger.warn("My warning message", myNumber, myString);

    This is a screenshot of my system running a Flex based AIR application, logged with anthropod:

No Comments

AIR 1.1 released

Posted on June 17th, 2008 by Riccardo, under AIR, Flash, Flex.

Today Adobe released AIR 1.1, that includes the following new capabilities:

  • Installation and other runtime dialog boxes have been translated into:
    • Brazilian Portuguese
    • Chinese (Traditional and Simplified)
    • French
    • German
    • Italian
    • Japanese
    • Korean
    • Russian
    • Spanish
  • Support for building internationalized applications, including keyboard input for double-byte language
    • Support for localizing the name and description attributes in the application descriptor file
    • Support for localizing error messages, such as SQLError.detailID and SQLError.detailArguments, in the SQLite database
    • Addition of Capabilities.languages property to obtain an array of preferred UI languages as set by the operating system
    • HTML button labels and default menus, such as context menus and the Mac menu bar, have been localized to all supported languages
  • Support for certificate migration from a self-signed application to one that chains to a certificate of authority (CA)
  • Support for Microsoft Windows XP Tablet PC Edition and support for 64-bit editions of Windows Vista® Home Premium, Business, Ultimate, or Enterprise.
  • Addition of File.spaceAvailable : API to obtain the amount of disk space available on a disk
  • Addition of NativeWindow.supportsTransparency property to determine whether a window can be drawn as transparent by the current operating system
  • Bug fixes and memory improvements

For more information, please see the Adobe AIR 1.1 Release Notes (.pdf).

Here the links:

No Comments

on AIR Tour: Milan

Posted on June 14th, 2008 by Riccardo, under AIR.

Inspired from the sessions at on AIR Tour in Milan I decided to fire up a blog and start blogging to share my ideas and solutions with the Flash and Flex communities. I’ve decided to write it in english because all the blogs I read everyday are in english too, so it’s our standard language (after Actionscript I hope).

Yesterday in Milan was a beautiful day, perfectly organized in a fantastic location. I want to thanks Adobe and all the onAIRTour Team for all the ten sessions, for the good lunch and for all the fantastic prizes gived away during the day. I’m the lucky winner of a copy of Adobe Flex Builder 3 Professional. Thanks Adobe!

I enjoyed a lot Serge Jespers’s session about “Deploying and Updating AIR Applications” and Andrew Shorten’s one about “Data Intensive Enterprise AIR Applications”, but my preferred was “AIR Conditioning” , presented by Lee Brimelow, with a lot of demos (NativeWindower, AIRTube, SpitEmOut, etc.) and a lot of fun.

No Comments