Pages Menu
Categories Menu

Posted by on Nov 19, 2009 in Code |

OSX Firefox Flex/Flash redraw bug workaround

There’s a known redraw bug in the OSX version of the Firefox Flash Player plugin that’s pretty irritating. If you do something that causes too many redraw events to get called in quick succession, Flash will fail to redraw the screen properly, and you end up with a mish-mash of phantom objects on the screen:

This happens most commonly with older versions of SWFAddress, but can also happen if you have a canvas with a scrollbar on it, and you scroll up and down rapidly. If the .swf fills the window, the user can fix this issue by resizing the browser window, thus causing the entire .swf to redraw. However, this is clearly not a workable solution. The most obvious way to fix this problem would seem to be to call invalidateProperties() and/or validateNow() on the parent Canvas, but this doesn’t actually work. The Flash Player seems to think it has already been redrawn, and doesn’t do it again.

A quick workaround? Make the parent canvas invisible and then visible again. This causes it to be redrawn. For instance, if you have a canvas with a scroll bar that is causing the problem, you can add an event handler to the Canvas’ scroll event, and cycle the visibility off and on. It’s imperceptible to the user, and fixes the issue.

<mx:Canvas scroll=”handleScrollEvent(event)”/>

private function handleScrollEvent(event:ScrollEvent):void
{
this.visible = false;
this.visible = true;
}

facebooktwittergoogle_plusredditpinterestlinkedinmail

Comments

comments