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

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

Important: Only pages installed as part of an application have the htmlLoader, nativeWindow, or runtime properties<br />

and only wh<strong>en</strong> loaded as the top-level docum<strong>en</strong>t. These properties are not added wh<strong>en</strong> a docum<strong>en</strong>t is loaded into a frame<br />

or iframe. (A child docum<strong>en</strong>t can access these properties on the par<strong>en</strong>t docum<strong>en</strong>t as long as it is in the same security<br />

sandbox. For example, a docum<strong>en</strong>t loaded in a frame could access the runtime property of its par<strong>en</strong>t with<br />

par<strong>en</strong>t.runtime.)<br />

About security<br />

Adobe AIR 1.0 and later<br />

AIR executes all code within a security sandbox based on the domain of origin. Application cont<strong>en</strong>t, which is limited<br />

to cont<strong>en</strong>t loaded from the application installation directory, is placed into the application sandbox. Access to the runtime<br />

<strong>en</strong>vironm<strong>en</strong>t and the AIR APIs are only available to HTML and JavaScript running within this sandbox. At the<br />

same time, most dynamic evaluation and execution of JavaScript is blocked in the application sandbox after all<br />

handlers for the page load ev<strong>en</strong>t have returned.<br />

You can map an application page into a non-application sandbox by loading the page into a frame or iframe and setting<br />

the AIR-specific sandboxRoot and docum<strong>en</strong>tRoot attributes of the frame. By setting the sandboxRoot value to an<br />

actual remote domain, you can <strong>en</strong>able the sandboxed cont<strong>en</strong>t to cross-script cont<strong>en</strong>t in that domain. Mapping pages<br />

in this way can be useful wh<strong>en</strong> loading and scripting remote cont<strong>en</strong>t, such as in a mash-up application.<br />

Another way to allow application and non-application cont<strong>en</strong>t to cross-script each other, and the only way to give nonapplication<br />

cont<strong>en</strong>t access to AIR APIs, is to create a sandbox bridge. A par<strong>en</strong>t-to-child bridge allows cont<strong>en</strong>t in a child<br />

frame, iframe, or window to access designated methods and properties defined in the application sandbox. Conversely,<br />

a child-to-par<strong>en</strong>t bridge allows application cont<strong>en</strong>t to access designated methods and properties defined in the sandbox<br />

of the child. Sandbox bridges are established by setting the par<strong>en</strong>tSandboxBridge and childSandboxBridge<br />

properties of the window object. For more information, see “HTML security in Adobe AIR” on page 1069 and “HTML<br />

frame and iframe elem<strong>en</strong>ts” on page 970.<br />

About plug-ins and embedded objects<br />

Adobe AIR 1.0 and later<br />

AIR supports the Adobe® Acrobat® plug-in. Users must have Acrobat or Adobe® Reader® 8.1 (or better) to display PDF<br />

cont<strong>en</strong>t. The HTMLLoader object provides a property for checking whether a user’s system can display PDF. SWF file<br />

cont<strong>en</strong>t can also be displayed within the HTML <strong>en</strong>vironm<strong>en</strong>t, but this capability is built in to AIR and does not use an<br />

external plug-in.<br />

No other WebKit plug-ins are supported in AIR.<br />

More Help topics<br />

“HTML security in Adobe AIR” on page 1069<br />

“HTML Sandboxes” on page 963<br />

“HTML frame and iframe elem<strong>en</strong>ts” on page 970<br />

“JavaScript Window object” on page 968<br />

“The XMLHttpRequest object” on page 964<br />

“Adding PDF cont<strong>en</strong>t in AIR” on page 550<br />

Last updated 6/6/2012<br />

962

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

Saved successfully!

Ooh no, something went wrong!