Created
May 24, 2012 20:54
-
-
Save greypants/2784189 to your computer and use it in GitHub Desktop.
AS3: External Interface Example
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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