Follow Flex After Dark on Twitter

External Interface

ExternalInterface is a class in the flash.external package that enables communication between ActionScript and the Flash Player container (e.g. an HTML page with JavaScript).

ExternalInterface is especially useful for two-way Flex application and browser JavaScript integration. In fact, Adobe recommends using ExternalInterface for all ActionScript-JavaScript communication.

ExternalInterface exposes two key pieces of functionality:

  • calling a container function (calling JavaScript from ActionScript)
  • exposing a Flex function to be callable by the container (calling ActionScript from JavaScript)

ExternalInterface defines two especially important static functions:

  • call( functionName:String, ... arguments ) - call a container function
  • addCallback( functionName:String, closure:Function ) - expose a Flex function to the container

ActionScript and JavaScript Communication

Learn more about communication between ActionScript and JavaScript...

Related Links:

Related Docs
Recent Docs
Random Docs