Displaying articles with tag development

Fix SWFUpload error "A script in this moving is causing Adobe Flash Player 9 to run slowly"

Posted by paul, Tue Sep 11 12:57:00 UTC 2007


Recently, I have been integrating
SWFUpload, a flash tool for uploading multiple files, into a rails application. This is a great open source solution, similar to the new flickr photo upload tool, for uploading multiple files. I was using it to upload photos to a photo sharing system. The problem was that if the upload took more then 60 seconds I kept getting this annoying error:

A script in this moving is causing Adobe Flash Player 9 to run slowly. If it continues to run, your computer may become unresponsive. Do you want to abort the script?
The documentation tells you to use this windows program to fix the problem.
SWF ScriptLimits Injector (SWFSLI) is a Win32 console (command line) application that can modify/remove/add 'ScriptLimits' tag to a SWF file. Flash MX 2004 (Flash 7) will not add this tag to exported SWF files. In Flex, you can specify the values like <mx:Application scriptTimeLimit="nnnnn" />>. Default values in Flex are 60 seconds and 1000 recursions.
Trouble is, no matter what options I used, this tool never fixed the problem.
Reading through the SWFUplad forums , I found this post
I was able to get this issue resolved by downloading Flash 8, adding a dummy movie file, and calling the SWFUpload constructor from the movie onEnterFrame event. (I also had to change the name of the SWFObject in the ActionScript to oSWFUpload.
Some guy hacked SWFUload, and his patched version works like a champ! You can download his version from
http://www.santokudesign.com/swfupload/SWFUpload.zip
The first time I tried to download this file, I got a 403 error, so here is a mirrored download in case the link goes down again.

If you are looking for a way to upload large numbers of files at once, this really is a GREAT tool.

1 comment | Filed Under: | Tags: development