How to extend default timeout period in flash application?
Asked Answered
I

5

8

I have an application written in flash (actually it is written in Haxe and run under SHWX but it doesn't matter here). I have a pretty complex task that consumes a lot of CPU power and sometimes executes for more that 15 seconds. If that happens, I've got an error saying 'A script has executed for longer than the default timeout period of 15 seconds.' and everything crashes.

I know I can use continuations to stop this from happening but is there a way to extend that 'default timeout period'? It's a developer tool, responsivnes doesn't really matter.

Impressionable answered 18/9, 2008 at 9:56 Comment(0)
J
2

Another way is to link a swfmill-based swf via -swf-lib switch and set this ScriptLimits tag there, haxe will re-use it then.

Judas answered 20/9, 2008 at 21:48 Comment(0)
D
1

in CS3+ you simply set the "Script time limit" property of the swf at publish time - it's in the flash tab of the publish settings

Diversify answered 22/9, 2009 at 18:49 Comment(0)
G
1

When you test your application, be aware of the scriptTimeLimit property. If an application takes too long to initialize, Flash Player warns users that a script is causing Flash Player to run slowly and prompts the user to abort the application. If this is the situation, you can set the scriptTimeLimit property of the tag to a longer time so that the Flex application has enough time to initialize.

However, the default value of the scriptTimeLimit property is 60 seconds, which is also the maximum, so you can only increase the value if you have previously set it to a lower value. You rarely need to change this value.

Source: http://livedocs.adobe.com/flex/3/html/help.html?content=performance_05.html

Gustation answered 8/8, 2011 at 13:7 Comment(0)
T
0

I'm not sure if there is something more native to get this done, but there seems to be a command that hacks the SWF to add a ScriptLimits tag to extend the timeout period.

Triplex answered 18/9, 2008 at 12:7 Comment(0)
M
-2

I suggest breaking your function into smaller chunks and spreading them over multiple frames. This way you can display an progress animation and the Flash application won't become unresponsive. So for example if you have to loop over 1000 items, you do 100 in one frame, then another hundred in the next frame, etc, until you have processed them all. I wouldn't recommend hacking your swf.

Moulden answered 18/9, 2008 at 13:10 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.