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
  • Flex Modules Flex Modules are compiled to dynamically-loadable SWF files that can be loaded and unloaded at run-time.
  • Flex Metadata Flex Metadata
  • MXML Language Overview of the MXML programming language used by Flex.
  • Flex HTTP Service Flex provides an HTTP Service in its RPC (Remoting) package for standard HTTP operations.
  • Flex Fonts Working with Fonts in Flex, including embedding and runtime loading.