User Guide
502 Using the External API
About the External API
The External API is the portion of ActionScript that provides a mechanism for
communication between ActionScript and code running in an “external application” that is
acting as a container for Flash Player (commonly a web browser or stand-alone projector
application). In ActionScript 3.0, the functionality of the External API is provided by the
ExternalInterface class. In Flash Player versions prior to Flash Player 8, the
fscommand()
action was used to carry out communication with the container application. The
ExternalInterface class is a replacement for
fscommand(), and its use is recommended for all
communication between JavaScript and ActionScript.
The ExternalInterface class is a subsystem that lets you easily communicate from ActionScript
and Flash Player to JavaScript in an HTML page, or to any desktop application that embeds
Flash Player.
The ExternalInterface class is available only under the following conditions:
■ In all supported versions of Internet Explorer for Windows (5.0 and later).
■ In an embedded custom ActiveX container, such as a desktop application embedding the
Flash Player ActiveX control.
■ In any browser that supports the NPRuntime interface, which currently includes the
following browsers:
■ Firefox 1.0 and later
■ Mozilla 1.7.5 and later
■ Netscape 8.0 and later
■ Safari 1.3 and later
In all other situations (such as running in a stand-alone player), the
ExternalInterface.available property returns false.
NOTE
If you need to use the old fscommand() function—for example, to maintain compatibility
with older applications or to interact with a third-party SWF container application or the
stand-alone Flash Player—it is still available as a package-level function in the
flash.system package.