Flash vs. Ajax

I’ve been hearing a lot of Flash vs. Ajax arguments lately, and unfortunately, they almost always start off in the wrong way.

It’s very common to hear people argue about Flash websites or RIAs vs. Ajax websites or RIAs, but this is always the wrong way to approach building any website. Would you have an argument with an architect about whether to build a house out of wood vs concrete? Of course not, they would use each material to build the parts of the house that the respective material is best for. Sometimes you might want to build a shack or barn out of all wood, sometimes you might want to build an all brick house, but many times you’ll want to use the best material for each section of the house. Build the foundation out of concrete, the walls and roof out of wood.

Websites and web applications should be treated the same way. Break things down to a component level and go from there. Use the right tool for each component. If you can do it well with HTML/Javascript, go for it. If it would work out better with Flash, then why waste time recreating something with Javascript that you could build 3 times faster with Flash? There are plenty of great examples of this today around the internet:

One of my favorite examples is Google Finance. They use HTML and Javascript for the stuff that is best suited for that, and then when they need to show a nice graph, they drop in a great interactive Flash graph and talk to it using Javascript as needed. The Flash controls the Javascript, and the Javascript can control the Flash as needed.

Another example is Flickr. They started out using Flash to display all of the images, including the image notes and the other toolbar options along with each image. While this might have been a good choice as the site started out, it was soon replaced by a more efficient HTML version of the toolbar and notes system that works just as well as the Flash version. They did end up keeping one small bit of Flash so users can rotate images and see a preview before they save it.

So the next time you start planning a website and you start thinking: “Hmm, Flash or Ajax?” Instead of looking at it from a site-wide perspective, try thinking about your site as a series of components, and then choose Flash or HTML/Javascript for each individual component instead.

I’m on the BBC!

After my session at Flash on the Beach I was interviewed by a BBC reporter. I ended up getting into the article and on the air (or was it just the podcast? who knows).

You can read the article here where they misspelled my name (twice!) and in the podcast they say I’m a ‘Freelance Java developer’ of which I am neither… But I can’t be too hard on him, as he’s probably not the first person to confuse Java with Javascript.

Here’s the article, and here’s a direct link to the mp3. Fast forward to around 24:00 to hear my part.

Recent SWFObject sightings

Lately I’ve been seeing SWFObject pop up all over the place. Most notably in Digg.com’s new redesign for their embedded video player. Makes sense since YouTube has been using it to embed their videos for months now, and Digg labs has been using it for a while to embed their cool charts and graphs and things.

MSN Radio is using it to embed their radio player, the Transformers movie site uses it (sweet!).

And in other yet related news, I set up a new SWFObject forum (still adding in a few things like the FAQ!) for people to use instead of the mailing list which has been growing quite a bit and is getting a bit too big to manage it well.

Update: The TED conference site uses SWFObject too (and looks like a really sweet conference this year), but of course they didn’t invite me to speak ;).

Corrupt Flash Player install after IE 7 upgrade

I’ve been seeing a few mails about this since the Internet Explorer update was released, so I wanted to post some info about it to maybe help the people having issues.

The complaint generally goes something like this:

A user has Flash Player 9 (or other version) installed on their system and everything works fine with IE6. That user then runs the IE7 update and their computer stops showing Flash content on sites like YouTube or MSN video and other Flash sites. However, if the user goes to some other sites with Flash content, the content will play just fine, even if the site requires the Flash 9 Player.

I’m not sure of the official cause for this, and am still doing some research into what causes it, but a first guess I have is that when you upgrade from IE7, the browser install is not correctly reinstalling your existing Flash Plugin, so scripts that check for the Flash Player are failing, but since the plugin file is there, if you visit a site that does not use a detection script (like SWFObject) you will see the Flash content just fine.

There may not be a solution to this for the sites using detection scripts – they rely on a series of Windows registry entries that seem to be missing after an IE7 upgrade.

For users, here is a fix that seems to work well:

  1. Quit all open programs. This step is important because other programs may be using the Flash Player, and if they are, the uninstaller will fail silently.
  2. Run the Adobe Flash Player Uninstaller.
  3. Reinstall your Flash player.

If you are still having problems after running the uninstaller and reinstalling the plugin, please post a comment with your system setup and other relevant details. (And remember, sometimes a system restart can make a difference with problems like this, so try that first).

UPDATE (1-8-2007): Added a new step 1.

Flash on the Beach session notes

Just a quick post to provide my session slides and links:

Session Slides (pdf)

Links:

http://blog.deconcept.com/swfobject/

http://www.asual.com/swfaddress/
http://exanimo.com/as2/StateManager

Further Reading:
http://blog.deconcept.com/2006/03/13/modern-approach-flash-seo/
http://www.adobe.com/devnet/flash/articles/progressive_enhancement.html

Enjoy! If you were in the session, leave a comment and let me know what you thought of the presentation, and include ways I can make the next one better if you like.