Undocumented Flash Player 7 Features: Recursion limit and script timeout

I couldnÂ’t sleep for some reason Sunday night so I decided to look through the File Format Specifications that Macromedia published recently. To my surprise there are a few things in there that I found interesting.

The cool chapter to check out is the “What’s New in Macromedia Flash (SWF) File Format 7”. In this chapter, there is mention of “ScriptLimits” which is a tag that sets the Maximum recursion depth and the script timeout seconds of a swf. Usually the MaxRecursionDepth is set to 256 as anyone who’s had the player loop a few too many times, and the ScriptTimeoutSeconds is responsible for that dialogue that pops up after 15 seconds.

It turns out that in the new player you have the ability to control those settings, wherein before you had to always make sure your movie behaved within those restrictions. I donÂ’t recommend people modify these settings, but if it is ever needed itÂ’s good to know it is there. Also there is mention of the default value of ScriptTimeoutSettings which apparently varies by platform (between 15 to 20 seconds). IÂ’m not sure if this is for Mac/Windows or actually for low-performance devices like pdaÂ’s but I didnÂ’t know about this variation before.

There are some other interesting things in there. If you have never looked at the file format specs, I definitely recommend it if you canÂ’t sleep and feel like getting deep into the byte code of your precious swfÂ’s.

9 thoughts on “Undocumented Flash Player 7 Features: Recursion limit and script timeout

  1. With ASV 4.02 you can easily add a ScriptLimits tag to any SWF. The tag is ignored by Player version 6 (and below), does not do any harm, and it takes only a few bytes.

  2. The ScriptTimeoutSettings might’ve been implemented partly due to the release of the Flash Player 6 on PocketPC, since that’s has a different script timeout setting due to the slow speed of the CPUs on that platform. That was around 6r79.

    - Ian

  3. Thanks for the info! I should have known about that feature in ASV. You always seem to be 2 steps ahead of the game Burak!

    Ian, do you know if there is a difference between Win/Mac, or only with the PocketPC?

  4. I think it was first implemented on the PocketPC (partly because we kicked up such a fuss about it), and probably used on various other device players now. I haven’t heard about different script timeouts between Mac and Win, and with the optimizations in the Player 7 for Mac, it’s probably not as big a deal as it was for v6.

  5. I built applications that run on 99% of the machines out there but there are still clients with P2 processors out there and they get timeout messages often enough. Could you give me an example of how to increase the Timeout in a flash movie?

  6. Burak mentioned that ASV will allow you to adjust this setting. You might want to look into that option or look into tracking down the code causing the issue and optimizing it or having it execute over several frames.

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>