Showcase and discover digital art at yex

Follow Design Stacks

Subscribe to our free newsletter to get all our latest tutorials and articles delivered directly to your inbox!

ExternalInterface class

ExternalInterface class

The ExternalInterface class introduced in Flash Player 8 enables straightforward communication between ActionScript and the Flash Player container—for example, an HTML page with JavaScript or even a desktop application with Flash Player embedded.

ExternalInterface is similar in functionality to the fscommand(), CallFrame(), and CallLabel() methods but is more flexible and more generally applicable. ExternalInterface is the preferred method for JavaScript–ActionScript communication in Flash Player 8 and later.

From ActionScript you can directly call any JavaScript function on the HTML page, passing any number of arguments of any data type, and receive a return value from the call. Similarly, from JavaScript on the HTML page you can call an ActionScript function in Flash Player and get a return value. Table 1 lists the browser and operating system combinations supported by ExternalInterface.

Table 1. Browsers and Operating Systems Supported by ExternalInterface

Browser

Operating Systems
Internet Explorer 5.0 and higher Windows  
Netscape 8.0 and higher Windows Mac OS
Mozilla 1.7.5 and higher Windows Mac OS
Firefox 1.0 and higher Windows Mac OS
Safari 1.3 and higher   Mac OS

Comments