Im testing a program in FlashDevelop, which uses Flash player 10. Need externalInterface to work, but on running this simple test program, it displays “ExternalInterface is not available”. What might be the problem here? How do I get ExternalInterface working?
<mx:Script>
<![CDATA[
import mx.controls.Alert;
private function init():void {
if (ExternalInterface.available) {
ExternalInterface.call("alert",
"ExternalInterface is available");
} else {
Alert.show("ExternalInterface is not available");
}
}
]]>
</mx:Script>
<mx:ApplicationControlBar dock="true">
<mx:Button id="button"
label="ExternalInterface.available"
click="init();" />
</mx:ApplicationControlBar>
P.s – By the way, this script shows “External Interface is available” when I run it in my browser. Its only when I run it in Flash Player 10, that it is not available.
ExternalInterface doesn’t exist in the Standalone player:
http://livedocs.adobe.com/flash/9.0/main/wwhelp/wwhimpl/common/html/wwhelp.htm?context=LiveDocs_Parts&file=00000339.html
It is for communicating with the thing which contains the flash player and when running in the standalone player there is nothing containing it so there is nothing to communicate with.