Hi,
I need to call javascript function from Flash 4 based web application. When I run it in Debug mode it runs perfectly but when I make release build or run same application on other machine it does not call JavaScript function.
For testing I am just calling sample Alert function of JavaScript. Can someone help me what I am missing ?
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
layout="vertical" initialize="application1_initializeHandler(event)"
verticalAlign="middle"
backgroundColor="white">
<mx:Script>
<![CDATA[
import mx.controls.Alert;
import mx.events.FlexEvent;
public function btnLogin_click():void
{
var s:String;
if (ExternalInterface.available)
{
ExternalInterface.call("alert", "Hello World!");
}
else
{
Alert.show("External interface not available");
}
trace(s);
}
protected function application1_initializeHandler(event:FlexEvent):void
{
flash.system.Security.allowDomain("always");
}
]]>
</mx:Script>
<mx:Form>
<mx:FormItem>
<mx:Button id="btnLogin" label="Login" click="btnLogin_click()" />
</mx:FormItem>
</mx:Form>
</mx:Application>