Ajax and Flash Compared
There are many opinions on which is better, Flash or Ajax. This page contains a set of criteria by which you can decide which you need for your website.
Ajax Applications
My handy definition of Ajax is:
That is to say Ajax is both fancy effects on a web page and dynamic communication with a server to reduce waiting. Some people have a narrower definition, but that's the one I'm using here.
There are many frameworks designed to help with Ajax app development. DWR is the obvious example to mention, but there are many others like Dojo, Prototype and so on.
Flash Applications
Flash is a brand that is applied to many things. In this context Flash means .swf files. This might be slightly technically misleading, but it is a more common usage. There is only 1 Flash although there are a number of tools like Swish and Laszlo that allow you to generate Flash content (.swf files).
Macromedia has a showcase of rich internet applications written using Flash.
How is Ajax better?
Searchability
Generally web pages are more visible to search engines than Flash pages. Search engine referrals can make a large difference to the traffic that your web-site generates. It is possible to extract the text of a Flash app for search engine indexing. In addition Google and other search engine manufacturers can index .swf files natively. However despite these measures .swf files tend to be less visible to search engines.
Openness
Although the swf format is a published format and there is a significant open source community there appears to be no such thing as an open source Flash player as a result of Macromedia's licencing programme. Developers with a bias towards more open systems and corporations that do not wish to depend on a third party or potential competitor may wish to avoid use of Flash.
Cost
The cost of the Flash development environment can be an issue. $700 may be a significant investment for smaller design shops. Corporations with bureaucratic purchasing departments (if that's not a tautology) may have issue with any price other than $0. At $0 tools can come in under the radar.
There are cheaper alternatives to flash like Swish and free alternatives like Lazlo, however these options may not allow the full power of Flash.
Accessibility
Ajax applications default to following the font and colour settings of their environment were as Flash applications use developer specified settings. This can make it harder for disabled users. In addition environment provided helps like screen readers, acceleration keys and so on may not be available to users of Flash applications. A fully accessible site can be created using Ajax.
Security
Web applications without Flash are often trusted more than their Flash cousins for several reasons.
- Flash is most commonly used in visually distracting advertisements
- It is used as way around pop-up blockers
- It can be used to create immortal cookies.
As a result many users use Flash blockers to control their web experience or approach Flash websites with an initial negative bias.
Ease of development
People writing complex Ajax or Flash applications will often be helped by some advanced tools. However generally the tools needed for Ajax development are both simpler and cheaper than their Flash equivalents.
How is Flash better?
Media Handling
Flash has far better handling of sound and video than pure HTML. As a result of this multimedia richness, most sites wishing to host video content use Flash.
Compatibility
Since there is only one Flash player vendor, there is less need for testing involving many browsers. This is the flip site of the openness argument above. However the latest Flash is not available for all operating systems and the take-up of the latest versions of flash can be slow. Also eeb applications have come a long way recently in 2 respects:
- The number of browsers in active use is significantly less than it was some years ago, and there are less bugs in these browsers than in previous generations.
- There is a growing number of libraries that work around browser incompatibilities.
Vector Graphics
Vector graphics are available in most web browsers either through SVG (native in Mozilla 1.5 or as a plug-in to other browsers) or the Canvas element (in Safari and Mozilla 1.5) or VML (in I.E. since v4).
There are several libraries that present a vector graphics API which is rendered in SVG/Canvas/VML as appropriate, examples include Dojo.gfx. Vector graphics are built into Flash, and a richer set of options are available which are faster than the Ajax alternatives.
Machine Access
Flash applications have better access to machine resources than web apps. A Flash application may be able to access web-cams and other peripherals that a pure web application cannot. Of course this may be seen as a drawback rather than an advantage. (because?)
Conclusion
Which is better? It depends, what do you want?