Skip to content

Instantly share code, notes, and snippets.

@greypants
Created May 24, 2012 20:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save greypants/2784189 to your computer and use it in GitHub Desktop.
Save greypants/2784189 to your computer and use it in GitHub Desktop.
AS3: External Interface Example
import flash.external.ExternalInterface;
// Calling a JavaScript function from AS3 (with optional parameters)
if (ExternalInterface.available) ExternalInterface.call("javascriptFunction", param1, param2);
// Implementing a JavaScript callback in AS3 (flashFunction is called when JavaScript calls javascriptFunction)
if (ExternalInterface.available) ExternalInterface.addCallback("javascriptFunction", flashFunction);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment