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 />

About the HTML <strong>en</strong>vironm<strong>en</strong>t<br />

Window.htmlLoader property The htmlLoader property provides a refer<strong>en</strong>ce to the AIR HTMLLoader object that<br />

contains the HTML cont<strong>en</strong>t. With this property, you can script the appearance and behavior of the HTML<br />

<strong>en</strong>vironm<strong>en</strong>t. For example, you can use the htmlLoader.paintsDefaultBackground property to determine whether<br />

the control paints a default, white background:<br />

window.htmlLoader.paintsDefaultBackground = false;<br />

Note: The HTMLLoader object itself has a window property, which refer<strong>en</strong>ces the JavaScript Window object of the HTML<br />

cont<strong>en</strong>t it contains. You can use this property to access the JavaScript <strong>en</strong>vironm<strong>en</strong>t through a refer<strong>en</strong>ce to the containing<br />

HTMLLoader.<br />

The window.htmlLoader property is only defined for cont<strong>en</strong>t within the application sandbox and only for the par<strong>en</strong>t<br />

docum<strong>en</strong>t of a page with frames or iframes.<br />

Window.par<strong>en</strong>tSandboxBridge and Window.childSandboxBridge properties The par<strong>en</strong>tSandboxBridge and<br />

childSandboxBridge properties allow you to define an interface betwe<strong>en</strong> a par<strong>en</strong>t and a child frame. For more<br />

information, see “Cross-scripting cont<strong>en</strong>t in differ<strong>en</strong>t security sandboxes” on page 996.<br />

Window.setTimeout() and Window.setInterval() functions AIR places security restrictions on use of the<br />

setTimeout() and setInterval() functions within the application sandbox. You cannot define the code to be<br />

executed as a string wh<strong>en</strong> calling setTimeout() or setInterval(). You must use a function refer<strong>en</strong>ce. For more<br />

information, see “setTimeout() and setInterval()” on page 982.<br />

Window.op<strong>en</strong>() function Wh<strong>en</strong> called by code running in a non-application sandbox, the op<strong>en</strong>() method only op<strong>en</strong>s<br />

a window wh<strong>en</strong> called as a result of user interaction (such as a mouse click or keypress). In addition, the window title<br />

is prefixed with the application title (to prev<strong>en</strong>t windows op<strong>en</strong>ed by remote cont<strong>en</strong>t from impersonating windows<br />

op<strong>en</strong>ed by the application). For more information, see the “Restrictions on calling the JavaScript window.op<strong>en</strong>()<br />

method” on page 1074.<br />

air.NativeApplication object<br />

Adobe AIR 1.0 and later<br />

The NativeApplication object provides information about the application state, dispatches several important<br />

application-level ev<strong>en</strong>ts, and provides useful functions for controlling application behavior. A single instance of the<br />

NativeApplication object is created automatically and can be accessed through the class-defined<br />

NativeApplication.nativeApplication property.<br />

To access the object from JavaScript code you could use:<br />

var app = window.runtime.flash.desktop.NativeApplication.nativeApplication;<br />

Or, if the AIRAliases.js script has be<strong>en</strong> imported, you could use the shorter form:<br />

var app = air.NativeApplication.nativeApplication;<br />

The NativeApplication object can only be accessed from within the application sandbox. For more information about<br />

the NativeApplication object, see “Working with AIR runtime and operating system information” on page 886.<br />

The JavaScript URL scheme<br />

Adobe AIR 1.0 and later<br />

Execution of code defined in a JavaScript URL scheme (as in href="javascript:alert('Test')") is blocked within<br />

the application sandbox. No error is thrown.<br />

Last updated 6/6/2012<br />

969

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

Saved successfully!

Ooh no, something went wrong!