Using the external API

The ActionScript 3.0 external API enables straightforward communication between ActionScript and the container application within which Adobe Flash Player 9 is running. There are several situations in which you may want to use the external API--for example, when you create interaction between a SWF document and JavaScript in an HTML page, or when you build a desktop application that uses Flash Player to display a SWF file.

This chapter describes how to use the external API to interact with a container application, how to pass data between ActionScript and JavaScript in an HTML page, and how to establish communication and exchange data between ActionScript and a desktop application.

NOTE

 

This chapter only covers communication between ActionScript in a SWF and the container application that includes a reference to the Flash Player instance in which the SWF is loaded. Any other use of Flash Player within an application is outside the scope of this documentation. Flash Player is designed to be used as a browser plug-in or as a projector (standalone application). Other usage scenarios may have limited support.

Contents

Basics of using the external API
External API requirements and advantages
Using the ExternalInterface class
Example: Using the external API with a web page container
Example: Using the external API with an ActiveX container

Flash CS3