5 Replies Latest reply on Aug 25, 2008 9:51 AM by kglad

    Help! Flashvars causing browser slow down

      Hi All,

      I have a very simple .swf file that is causing some kind of slow down or memory leak. It is effecting the browser its self as moving the mouse cursor around or selecting text becomes sluggish.

      Within the .swf, the stage is only 1px by 1px. It is meant to fit the size of the html element its embedded in. Once the .swf loads it adjusts its stage to the new dimensions. It then draws a rectangle movie clip to fit the new size.

      Once the rectangle is drawn the .swf then draws 50 circles of varying size to animate as a snow effect. I wasn't having any slow down until I added this snow effect in. However let me explain in the next paragraph that the snow is not the real culprit.

      The rectangles fill, stroke, and corner radius. Can all be set by variables sent to the swf. by the Flashvars attribute of object, and embed. Once they are retrieved by the .swf they are processed by a conditional statement I wrote. If one of the attributes isn't set they are set to a default. The code is attached below.

      Heres how I know the snow effect isn't the culprit. If I don't pass the .swf any Flashvars attribute and just let it use the defaults for styleObj in the .swf. The effect runs fine. If I do try to pass it Flashvars the slow down occurs. Is there an issue with my conditional statements?

      I have tried embedding using the SwfObject.js Class and using standard HTML tags. Both display the same issue if Flashvars are passed there's a slowdown if not its fine.

      If anyone could help with this, or shoot me some links with info I would be eternally grateful. I can also provide the source files if you want to take a look at it.

      I have uploaded a test page so you can see the problem in http://www.callmekev.com/client/test/