Accessibility
Jeong-Heon Kim

Jeong-Heon Kim

Adobe

Table of Contents

Created:
12 June 2006
User Level:
Intermediate
Products:
Flash

Using the External API for Flash–JavaScript Communication

Getting the functionality you want out of your Flash application often requires communicating with code outside of Flash Player, such as JavaScript in an HTML page. In cases like this, you need to get ActionScript to invoke JavaScript, or vice versa, in order to enable communication.

In Flash Player 7 and earlier, ActionScript-to-JavaScript communication relied on getURL() or fscommand(), while JavaScript was able to communicate with ActionScript by using SetVariable(), callFrame(), and callLabel().

The ExternalInterface class introduced in Flash Player 8—more generally known as the External API (application programming interface)—enables straightforward communication between Flash and external programs. This article explains the ExternalInterface class in detail.

Requirements

To complete this tutorial you will need to install the following software and files:

Flash Professional 8

Sample files:

Prerequisite Knowledge

Familiarity with JavaScript and the Document Object Model (DOM).

About the author

Jeong-Heon Kim is a user interface architect with Adobe Consulting in Korea. He develops Flash and Flash Lite content and has real-world, hands-on teaching experience. You can find him in a variety of online Flash communities using the nickname "bohe."