Use Flex Builder 3 to create a JavaScript AIR application - debugging.

In the first part of this article I wrote about how Flex Builder 3 can be used to create a JavaScript AIR application and how to set up the environment.

Going forward, one big part of developing an application is debugging it. The instrospector tool I am talking about does not help to debug an application in the same way the JDT debugger helps debug Java applications. Actually it works more like Firebug.

First you need to copy one file into the source folder of your project:

“c:\Program Files\Adobe\Flex Builder 3\sdks\3.0.0\frameworks\libs\air\AIRIntrospector.js”

copy AIRIntrospector.js into your project

The second step is to include it into your application:

import AIRIntrospector into your project

If you run the application right now, nothing will happen. The introspector is not started unless it is used. So let’s use it to see how it works. For that I will add the following piece of code just above the <body> tag.

<script>
air.Introspector.Console.log(window);
</script>

I made it a little bit interesting by logging the window object to see the power of this introspector.

Adobe AIR Introspector

You are now able to explore the entire structure of the window object to see exactly the value for each member. This console is a very powerful tool. As you can see there are more features there and we will explore those later. More about Adobe AIR Introspector can be found on the Adobe help resource center here.

Leave a comment

Please be polite and on topic. Your e-mail will never be published.