Tuesday, September 1, 2009

Adobe ActionScript 3.0 * Controlling outbound URL access

Adobe ActionScript 3.0 * Controlling outbound URL access

Outbound scripting and URL access (through the use of HTTP URLs, mailto: and so on) are achieved through use of the following ActionScript 3.0 APIs:

*

The flash.system.fscommand() function
*

The ExternalInterface.call() method
*

The flash.net.navigateToURL() function

For SWF files running locally, calls to these methods are successful only if the SWF file and the containing web page (if there is one) are in the local-trusted security sandbox. Calls to these methods fail if the content is in the local-with-networking or local-with-filesystem sandbox.

For SWF files that are not running locally, all of these APIs can communicate with the web page in which they are embedded, depending on the value of the AllowScriptAccess parameter described below. The flash.net.navigateToURL() function has the additional ability to communicate with any open browser window or frame, not just the page in which the SWF file is embedded. For more information on this functionality, see Using the navigateToURL() function.