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

Security<br />

<br />

<br />

<br />

<br />

<br />

<br />

An HTML page may also use a script to g<strong>en</strong>erate SWF-embedding tags. You need to alter the script so that it inserts<br />

the proper allowNetworking settings. HTML pages g<strong>en</strong>erated by Adobe Flash Professional and Adobe Flash Builder<br />

use the AC_FL_RunCont<strong>en</strong>t() function to embed refer<strong>en</strong>ces to SWF files. Add the allowNetworking parameter<br />

settings to the script, as in the following:<br />

AC_FL_RunCont<strong>en</strong>t( ... "allowNetworking", "none", ...)<br />

The following APIs are prev<strong>en</strong>ted wh<strong>en</strong> allowNetworking is set to "internal":<br />

navigateToURL(), fscommand(), ExternalInterface.call()<br />

In addition to the APIs on the previous list, the following APIs are also prev<strong>en</strong>ted wh<strong>en</strong> allowNetworking is set to<br />

"none":<br />

s<strong>en</strong>dToURL(), FileRefer<strong>en</strong>ce.download(), FileRefer<strong>en</strong>ce.upload(), Loader.load(),<br />

LocalConnection.connect(), LocalConnection.s<strong>en</strong>d(), NetConnection.connect(), NetStream.play(),<br />

Security.loadPolicyFile(), SharedObject.getLocal(), SharedObject.getRemote(), Socket.connect(),<br />

Sound.load(), URLLoader.load(), URLStream.load(), XMLSocket.connect()<br />

Ev<strong>en</strong> if the selected allowNetworking setting permits a SWF file to use a networking API, there may be other<br />

restrictions based on security sandbox limitations (see “Security sandboxes” on page 1033).<br />

Wh<strong>en</strong> allowNetworking is set to "none", you cannot refer<strong>en</strong>ce external media in an tag in the htmlText<br />

property of a TextField object (a SecurityError exception is thrown).<br />

Wh<strong>en</strong> allowNetworking is set to "none", a symbol from an imported shared library added in the Flash Professional<br />

(not ActionScript) is blocked at run time.<br />

Full-scre<strong>en</strong> mode security<br />

Flash Player 9 and later, Adobe AIR 1.0 and later<br />

Flash Player 9.0.27.0 and later support full-scre<strong>en</strong> mode, in which cont<strong>en</strong>t running in Flash Player can fill the <strong>en</strong>tire<br />

scre<strong>en</strong>. To <strong>en</strong>ter full-scre<strong>en</strong> mode, the displayState property of the Stage is set to the<br />

StageDisplayState.FULL_SCREEN constant. For more information, see “Working with full-scre<strong>en</strong> mode” on<br />

page 167.<br />

For SWF files running in a remote sandbox, there are some security considerations.<br />

Last updated 6/6/2012<br />

1046

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

Saved successfully!

Ooh no, something went wrong!