About the External API
667
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.
The ExternalInterface class is available only under the following circumstances:
■
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, 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 use any JavaScript function, not only the functions that you can use with
fscommand function
.
■
You can pass any number of arguments, with any names; you aren’t limited to passing a
command and arguments.
■
You can pass various data types (such as Boolean, Number, and String); you are no longer
limited to String parameters.
■
You can now receive the value of a call, and that value returns immediately to ActionScript
(as the return value of the call you make).
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”
on page 679
.
NO
TE
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”
on page 667
.
Summary of Contents for FLASH 8-LEARNING ACTIONSCRIPT 2.0 IN FLASH
Page 1: ...Learning ActionScript 2 0 in Flash...
Page 8: ...8 Contents...
Page 18: ...18 Introduction...
Page 30: ...30 What s New in Flash 8 ActionScript...
Page 66: ...66 Writing and Editing ActionScript 2 0...
Page 328: ...328 Interfaces...
Page 350: ...350 Handling Events...
Page 590: ...590 Creating Interaction with ActionScript...
Page 710: ...710 Understanding Security...
Page 730: ...730 Debugging Applications...
Page 780: ...780 Deprecated Flash 4 operators...
Page 830: ...830 Index...