13.08.2012 Views

ACTIONSCRIPT 3 Developer’s Guide en

ACTIONSCRIPT 3 Developer’s Guide en

ACTIONSCRIPT 3 Developer’s Guide en

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

<strong>ACTIONSCRIPT</strong> 3.0 DEVELOPER’S GUIDE<br />

Working with AIR native windows<br />

Wh<strong>en</strong> you initialize a window—including the initial application window—you should consider creating the window<br />

in the invisible state, loading cont<strong>en</strong>t or executing any graphical updates, and th<strong>en</strong> making the window visible. This<br />

sequ<strong>en</strong>ce prev<strong>en</strong>ts any jarring visual changes from being visible to your users. You can specify that the initial window<br />

of your application should be created in the invisible state by specifying the false tag in the<br />

application descriptor (or by leaving the tag out altogether since false is the default value). New NativeWindows are<br />

invisible by default. Wh<strong>en</strong> you create an HTML window with the HTMLLoader createRootWindow() method, you<br />

can set the visible argum<strong>en</strong>t to false. Call the NativeWindow activate() method or set the visible property to<br />

true to make a window visible.<br />

Specifying window initialization properties<br />

Adobe AIR 1.0 and later<br />

The initialization properties of a native window cannot be changed after the desktop window is created. These<br />

immutable properties and their default values include:<br />

Property Default value<br />

systemChrome standard<br />

type normal<br />

transpar<strong>en</strong>t false<br />

owner null<br />

maximizable true<br />

minimizable true<br />

resizable true<br />

Set the properties for the initial window created by AIR in the application descriptor file. The main window of an AIR<br />

application is always type, normal. (Additional window properties can be specified in the descriptor file, such as<br />

visible, width, and height, but these properties can be changed at any time.)<br />

Set the properties for other native and HTML windows created by your application using the<br />

NativeWindowInitOptions class. Wh<strong>en</strong> you create a window, you must pass a NativeWindowInitOptions object<br />

specifying the window properties to either the NativeWindow constructor function or the HTMLLoader<br />

createRootWindow() method.<br />

The following code creates a NativeWindowInitOptions object for a utility window:<br />

var options:NativeWindowInitOptions = new NativeWindowInitOptions();<br />

options.systemChrome = NativeWindowSystemChrome.STANDARD;<br />

options.type = NativeWindowType.UTILITY<br />

options.transpar<strong>en</strong>t = false;<br />

options.resizable = false;<br />

options.maximizable = false;<br />

Setting systemChrome to standard wh<strong>en</strong> transpar<strong>en</strong>t is true or type is lightweight is not supported.<br />

Note: You cannot set the initialization properties for a window created with the JavaScript window.op<strong>en</strong>() function.<br />

You can, however, override how these windows are created by implem<strong>en</strong>ting your own HTMLHost class. See “Handling<br />

JavaScript calls to window.op<strong>en</strong>()” on page 1013 for more information.<br />

Last updated 6/6/2012<br />

897

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

Saved successfully!

Ooh no, something went wrong!