Firefox 2.x + Mac SWFObject Workaround (White Screen Fix)

(1 minute read)

I’ve been using FF3 for a while now so I didn’t notice this issue but as soon as I loaded FF2 it was obvious. Firefox has issues when you dynamically load flash through SWF object on a Mac. In FF2 with a Mac all you’ll see is a white box that requires you to click on it… then everything will look correct. If you don’t want your users to have to click a flash object just to have the page look the way you intended then try the code below.

To fix it you just need to force a quick little behind the scenes redraw in javascript:

swfobject.addLoadEvent(forceRedraw);

function forceRedraw() {
  document.getElementById("yourflashobjectidhere").style.display = "block";
}

Solution by bobbyvandersluis

Categories: