PDA

View Full Version : JS Alert exceeds script execution limits


eyal_c
01-05-2009, 06:04 PM
Hi,

I have a Flex Application which calls a simple JS alert, if the popup is not closed within the max limit (60 seconds) i am getting the famous:

Error #1502: A script has executed for longer than the default timeout
period of 15 seconds.

Notice that the error message says 15 seconds but actually the timeout is 60 seconds.

Is there any known solution to this issue? I can't enforce my users to click the button within a 60-sec time limit...

Thanks

ljuwaidah
01-05-2009, 06:55 PM
mind posting the code?

eyal_c
01-05-2009, 07:37 PM
For example (AS code):

ExternalInterface.call("alert","Hellow World !!!");

Run the application, wait 61 seconds and then press the "Ok" button - you will get the flash error:

Error #1502: A script has executed for longer than the default timeout
period of 15 seconds.

drkstr
01-05-2009, 07:55 PM
Yeah, unfortunately javascript stops execution during an alert. You can use try and catch to suppress the error if you like.

try
{
ExternalInterface.call("alert","Hellow World !!!");;
}
catch(error:Error)
{
if(error.errorID != 1502) {
throw(error);
}
}


Best Regards,
~Aaron

eyal_c
01-11-2009, 04:25 PM
Thanks !!

wvxvw
01-11-2009, 05:39 PM
http://www.actionscript.org/forums/showthread.php3?t=187934&highlight=alert
another way to do it.
BTW, you don't need parentheses around error, it's just throw error;