About the External API

The ExternalInterface class is also called the External API, which is a new subsystem that lets you easily communicate from ActionScript and the Flash Player container to an HTML page with JavaScript or to a desktop application that embeds Flash Player.

NOTE

 

This functionality replaces the older fscommand() function for interoperating with a HTML page or a container application. The External API offers more robust functionality than fscommand() in this situation. For more information, see About the External API.

The ExternalInterface class is available only under the following circumstances:

In all other situations, the ExternalInterface.available property returns false.

From ActionScript, you can call a JavaScript function on the HTML page. The External API offers the following improved functionality compared with fscommand():

You can call an ActionScript function from JavaScript on an HTML page. For more information, see ExternalInterface (flash.external.ExternalInterface). For more information on local file security, see About local file security and Flash Player.

The following sections contain examples that use the External API:


Flash CS3