The simplest logging application (AIR) for Flash, Flex, and AIR development inspecting into a deeply nested object such as Array, ArrayCollection1, Object, and XML. You can easily look inside these objects on the console.
Figure 1. SimpleLogger schematic.
The same kind of software is out there. The differences between SimpleLogger and these following are:
Object, Array, ArrayCollection1, XML, TextField, String, and so on.
You need the following two: AIR application (Console) and ActionScript library (Client).
AIR application (Console)
Install automatically from the button below. If you could not install it automatically, try manual install from here (you may probably need to install Adobe AIR Runtime).
ActionScript library (Client) that inclues:
import com.borealkiss.SimpleLogger; var ary:Array = ["This","is","a","nested","array", {platform:"Flex", flash_player:"9"}, ["This","is","a",{R:"Rich",I:"Internet",A:"Application"}]]; SimpleLogger.trace(ary);Then SimpleLogger console will show the result like this:
[0] => "This" [1] => "is" [2] => "a" [3] => "nested" [4] => "array" [5] => [flash_player] => "9" [5] => [platform] => "Flex" [6] => [0] => "This" [6] => [1] => "is" [6] => [2] => "a" [6] => [3] => [A] => "Application" [6] => [3] => [I] => "Internet" [6] => [3] => [R] => "Rich"Note that SimpleLogger.trace() method is static so that you don't need instantiate it by new. Next consider the following case with Object;
import com.borealkiss.SimpleLogger; var obj:Object = { first:"This", second:"is", third:{one:"a",two:"nested",three:"Object"}}; SimpleLogger.trace(obj);When you run the preceding code in your swf file, the SimpleLogger console will get the following result:
[third] => [two] => "nested" [third] => [three] => "Object" [third] => [one] => "a" [second] => "is" [first] => "This"It is possible to examine an XML object. The SimpleLogger console shows each node name in a tree-like style (see the top image). Note that attributes of an XML object are not analyzed for the moment;
import com.borealkiss.SimpleLogger; //Example of XML object var xml:XML = <users>...</users>; SimpleLogger.trace(xml);ArrayCollection class object is defined in Flex's mx package, so use SimpleLoggerMx.trace(). The standard SimmpleLogger.trace() will NOT work in this case;
import com.borealkiss.SimpleLoggerMx; var ac:ArrayCollection = new ArrayCollection([ {name:"Martin Foo",age:25}, {name:"Joe Bar",age:15}, {name:"John Baz",age:23}]); SimpleLoggerMx.trace(ac);The result will be shown up in the SimpleLogger console:
[0] => [age] => "25" [0] => [name] => "Martin Foo" [1] => [age] => "15" [1] => [name] => "Joe Bar" [2] => [age] => "23" [2] => [name] => "John Baz"
1 ArrayCollection must be analyzed by SimpleLoggerMx class that suits a project including Flex's mx-package. For more detail, see the example above.