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

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

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

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

Working with AIR native windows<br />

Package Classes<br />

flash.display NativeWindow<br />

Native window ev<strong>en</strong>t flow<br />

Adobe AIR 1.0 and later<br />

NativeWindowInitOptions<br />

NativeWindowDisplayState<br />

NativeWindowResize<br />

NativeWindowSystemChrome<br />

NativeWindowType<br />

flash.ev<strong>en</strong>ts NativeWindowBoundsEv<strong>en</strong>t<br />

NativeWindowDisplayStateEv<strong>en</strong>t<br />

Native windows dispatch ev<strong>en</strong>ts to notify interested compon<strong>en</strong>ts that an important change is about to occur or has<br />

already occurred. Many window-related ev<strong>en</strong>ts are dispatched in pairs. The first ev<strong>en</strong>t warns that a change is about to<br />

happ<strong>en</strong>. The second ev<strong>en</strong>t announces that the change has be<strong>en</strong> made. You can cancel a warning ev<strong>en</strong>t, but not a<br />

notification ev<strong>en</strong>t. The following sequ<strong>en</strong>ce illustrates the flow of ev<strong>en</strong>ts that occurs wh<strong>en</strong> a user clicks the maximize<br />

button of a window:<br />

1 The NativeWindow object dispatches a displayStateChanging ev<strong>en</strong>t.<br />

2 If no registered list<strong>en</strong>ers cancel the ev<strong>en</strong>t, the window maximizes.<br />

3 The NativeWindow object dispatches a displayStateChange ev<strong>en</strong>t.<br />

In addition, the NativeWindow object also dispatches ev<strong>en</strong>ts for related changes to the window size and position.<br />

The window does not dispatch warning ev<strong>en</strong>ts for these related changes. The related ev<strong>en</strong>ts are:<br />

a A move ev<strong>en</strong>t is dispatched if the top, left corner of the window moved because of the maximize operation.<br />

b A resize ev<strong>en</strong>t is dispatched if the window size changed because of the maximize operation.<br />

A NativeWindow object dispatches a similar sequ<strong>en</strong>ce of ev<strong>en</strong>ts wh<strong>en</strong> minimizing, restoring, closing, moving, and<br />

resizing a window.<br />

The warning ev<strong>en</strong>ts are only dispatched wh<strong>en</strong> a change is initiated through window chrome or other operatingsystem<br />

controlled mechanism. Wh<strong>en</strong> you call a window method to change the window size, position, or display<br />

state, the window only dispatches an ev<strong>en</strong>t to announce the change. You can dispatch a warning ev<strong>en</strong>t, if desired,<br />

using the window dispatchEv<strong>en</strong>t() method, th<strong>en</strong> check to see if your warning ev<strong>en</strong>t has be<strong>en</strong> canceled before<br />

proceeding with the change.<br />

For detailed information about the window API classes, methods, properties, and ev<strong>en</strong>ts, see the ActionScript 3.0<br />

Refer<strong>en</strong>ce for the Adobe Flash Platform.<br />

Last updated 6/6/2012<br />

891

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

Saved successfully!

Ooh no, something went wrong!