The Mixed Messages of swfobject
August 7th, 2008
Articles
swfobject must be one of the most useful javascript files ever created. I could explain why I feel this way, but going over the brief history of flash embedding is too painful to relive. If you don't know what swfobject is, check it out here here. It will save your life.
There's one thing that has always bugged me about swfobject - the alternate content. In every implementation of swfobject I've ever seen, there's always a friendly message for the users to upgrade their flash player as a fallback in case the javascript detects that the users don't have the correct flash version.
At first glance, this seems like a great idea. Here's the problem, though: with the way this is always implemented, if javascript breaks or is disabled, the users are told to upgrade flash. In other words, if the javascript doesn't run, the user is told the problem lies with their flash player rather than javascript. At this point, you've just given the user a completely false error message. Imagine the pleasure of leaving the site to upgrade your flash player to either find out you already have the latest version, or return to the site to find that it's still telling you to upgrade. This is a major oversight in the standard implementation of swfobject.
Fortunately, there's an incredibly easy way around this. In fact, it's so simple, there's no reason not to do it - I'll show you how...

