Antun’s Blog

Notes on OpenLaszlo, LZX and Rich Internet Application Development

Antun’s Blog header image 2

Tell Those Pesky Script-Running-Slowly Errors Where to Go

November 8th, 2007 · No Comments

Anyone who has done any OpenLaszlo (or Flash-related) development has inevitably come across those dreaded Script-Running-Slowly errors. They’re caused by the application taking too long to process a piece of script. e.g. An infinite (or very long) loop, creating too many views at once or a large number of chained constraints.

No more issues.

Happily, there’s now a cure. As of Flash 7 (which is the minimum supported Flash runtime in OpenLaszlo 4.0+), the criteria for triggering these errors are configurable. Hopefully this feature will make it into the OpenLaszlo platform, but for now, you can use the Windows
SWF ScriptLimits Injector (SWFSLI) program to tweak these criteria.

  1. Download the SWFSLI program from: http://www.buraks.com/swfsli/
  2. Compile your OpenLaszlo application SOLO using proxied=”false” in the canvas.
  3. Run SWFSLI against the newly-compiled SWF:
    swfsli myapp.lzx.lzr\=swf7.swf /r65535 /t300 /b

That’s it. SWFSLI will adjust the settings in your original SWF file, and make a backup copy. To deploy, you’ll need a wrapper page. Note that this won’t make your application run faster; it’ll only loosen Flash’s criteria for throwing the Script-Running-Slowly error.

I created two examples (before.swf and after.swf). Both of these run 10,000,000 iterations and then print that they’re done. On my laptop, before.swf consistenly throws the error, after.swf never does:

Tags: OpenLaszlo

0 responses so far ↓

  • There are no comments yet...Kick things off by filling out the form below.

Leave a Comment