28.04.2016 Views

Adobe AIR Building Apps

Adobe AIR Building Apps AS3 Actionscript

Adobe AIR Building Apps AS3 Actionscript

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

BUILDING ADOBE <strong>AIR</strong> APPLICATIONS<br />

Debugging with the <strong>AIR</strong> HTML Introspector<br />

273<br />

var testObject = new Object();<br />

testObject.foo = "foo";<br />

testObject.bar = 234;<br />

air.Introspector.Console.dump(testObject);<br />

When you execute this code, the Console displays the testObject object and its properties, but you cannot edit the<br />

property values in the Console.<br />

Configuring the <strong>AIR</strong> Introspector<br />

You can configure the console by setting properties of the global <strong>AIR</strong>IntrospectorConfig variable. For example, the<br />

following JavaScript code configures the <strong>AIR</strong> Introspector to wrap columns at 100 characters:<br />

var <strong>AIR</strong>IntrospectorConfig = new Object();<br />

<strong>AIR</strong>IntrospectorConfig.wrapColumns = 100;<br />

Be sure to set the properties of the <strong>AIR</strong>IntrospectorConfig variable before loading the <strong>AIR</strong>Introspector.js file (via a<br />

script tag).<br />

There are eight properties of the <strong>AIR</strong>IntrospectorConfig variable:<br />

Property Default value Description<br />

closeIntrospectorOnExit true Sets the Inspector window to close when all other windows of the<br />

application are closed.<br />

debuggerKey 123 (the F12 key) The key code for the keyboard shortcut to show and hide the <strong>AIR</strong><br />

Introspector window.<br />

debugRuntimeObjects true Sets the Introspector to expand runtime objects in addition to objects<br />

defined in JavaScript.<br />

flashTabLabels true Sets the Console and XMLHttpRequest tabs to flash, indicating when a<br />

change occurs in them (for example, when text is logged in these tabs).<br />

introspectorKey 122 (the F11 key) The key code for the keyboard shortcut to open the Inspect panel.<br />

showTimestamp true Sets the Console tab to display timestamps at the beginning of each line.<br />

showSender true Sets the Console tab to display information on the object sending the<br />

message at the beginning of each line.<br />

wrapColumns 2000 The number of columns at which source files are wrapped.<br />

<strong>AIR</strong> Introspector interface<br />

To open the <strong>AIR</strong> introspector window when debugging the application, press the F12 key or call one of the methods<br />

of the Console class (see “Inspecting an object in the Console tab” on page 271). You can configure the hot key to be a<br />

key other than the F12 key; see “Configuring the <strong>AIR</strong> Introspector” on page 273.<br />

Last updated 2/22/2016

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!