Page 1 of 1

ExternalInterface + Timer Class Problem

Posted: Tue Oct 28, 2008 11:16 am
by devilmaycry
Hello everyone, am a new member here and i just discovered this amazing product you have, anyway i m playing arround with the functionalities and i discovered a bug that may interest you so heres the situation i have:

i used the Sample07_ExternalInterface and replaced the externalInterface.swf with the swf attached, my SWF have a timer that will occurs after 1 second and when the closure function is called i add a string to the Text field on the stage to make sure the call has been occured and also i call the ExternalInterface.call("alert","Called JS") in the closure function. so the result is alot of ALERTS... it seems like the DLL recieved alot of ExternalInterface Call, however i removed this ExternalInterface.call("alert","Called JS") line from the closure function and everything worked like expected i recieved the events every 3 seconds and the TextField has been updated.

Any Ideas why this is hapenning?

here's the code

var timer:Timer=new Timer(1000,2);
timer.addEventListener(TimerEvent.TIMER,callJS);

function callJS(e){

trace("calling");
text_txt.text+= "calling\n";
ExternalInterface.call("alert","JS Called");

}
timer.start();


also the source and the swf are can be found here

http://www.flashreply.com/temp/

thank you

best regards

DevilMayCry

PS: the FLA is a FCS3 document.

Posted: Tue Oct 28, 2008 3:04 pm
by Softanics
Thank you for your question.

If AfxMessageBox(); is commented, it works well...

Posted: Tue Oct 28, 2008 3:09 pm
by Softanics
It's not a problem of the f-in-box implemenation.

I've just created a simple dialog-based mfc application in VC++, added a flash activex, in the handler of FlashCall I've inserted the same AfxMessageBox();

As a result, the same effect.

If you don't create a window inside a handler of flash event, the application works well.

Thank you.

Posted: Wed Oct 29, 2008 12:07 pm
by devilmaycry
Thank you for your answer, yes it is like i mentionned in the post that without the alert (creation of other windows in handler as you said) it work!

ok so no alerts in handlers :)

thanks