I am trying to call a method of a javascript from the actionscript using the ExternalInterface.
Here is the code in action script
private function onKickEvent(e:LogoutEvent):void{
ExternalInterface.call("LoginFound","message");
return;
}
And this is my javascript mwthod
function LoginFound(message){
alert(message);
anotherInstanceExists=true;
}
Everything is working fine, but the only thing is when act on the alert box which is shown in the javascript after some 20 secs, the exception is thrown from the flash player that a script has been running longer than expected time 15 sec.
How can i avoid this?
When you call
jsfunction from theactionscript, that function have to work and return value not longer than in15 sec.Javascriptworks in single thread,and when you callLoginFoundfunction,alertstops farther executions on the thread.However you can handle such situation (the execution,which is longer than 15 sec) in
Actionsriptby usingtry/catch: