Flash gets a bad rep among programmers. The programming model is very different from typical programming languages, and the uses of the technology have typically been annoying (banner adds, skip-intro splash pages). More recently, AJAX has emerged as an extremely popular way of introducing dynamic behavior into web pages. So why do we even need Flash?
I just finished a HUGE Flash application (MindCanvas) that started out as an AJAX prototype, was developed in Flash, and then had part of the application converted back to AJAX. Whew! At this point, I feel like I can write with some authority on when to use Flash, and when to avoid using it. Flash has specific limitations, but so does AJAX, and it’s important above all to use the right tool for the job.
Capabilities that require Flash
*Audio – As far as I know, no one has figured out a way to make an AJAX application play audio files. This can be important for the little details of an application. It can also be important if you’re making an immersive experience of some kind, as we were. We NEEDED sound.
*Complex animation with arbitrary shapes (i.e. not just rectangles). You’ll know if you need this or not. MindCanvas is a video-game like survey application, and we definitely needed vector graphics to make it come alive.
*Sockets (“pushing” data from the server. Required for multiplayer games, stock-trading applications, etc). We had no need for this in our initial release, but we have a lot of ideas as to how to use MindCanvas to perform multi-player research exercises. We’d use flash communications server to do this in the flash world. There is no equivalent in the DHTML world.
*Integration with client microphone / webcam. We didn’t really need this at present (though it’s nice to know it’s there for the future). But many collaboration applications or consumer media sites will absolutely need this in the next few years.
Capabilities that Flash lacks
* Rapid development: if your code needs to change quickly, or if it needs to be ready in a few weeks, Flash is a poor choice. In our case, the management UI for MindCanvas was originally built in Flash. When we had to change it to meet an early customer’s requirements, we realized that Flash really isn’t what you should be using to do rapid application modification. We ended up reimplementing the management UI as a conventional web application, with bits of AJAX folded in after the fact. I’m extremely glad we did, as we’ve had to do extensive customization to this code as our business model evolved, and making the changes to a Flash application would have taken an unacceptable amount of time. (NOTE: It is possible that FLEX is a faster environment for rapid prototyping. But frankly, I doubt it could be as fast as vanilla web application development, which is such a well-understood problem now that it is extremely easy).
* Excellent handling of text. Something you take for granted on the web is that you will be able to display text of varying sizes in a way that is readable for the user. But font sizes that were easily “big enough” to be legible in html were fuzzy and hard-to-read in Flash. We bought several fonts from third-party vendors : these helped, but didn’t completely solve the problem.
It’s not just the rendering, either. Often it’s nice to be able to copy text from an interface you’re using (for example, to tell a developer that a particular label needs to be reworded). This is impossible if the text is part of a flash file. Even copying text from text areas has problems! (notably in Firefox with Windows XP and Flash 7). Flash is vector graphics at heart, and if your application exists primarily to let users read, produce, and manipulate text, Flash is probably not the best choice.
It you look at these abilities and limitations, you see that Flash is excellently positioned as the Web becomes more of a mainstream, visual medium. As the web matures as a platform, it will become a as much about voice communication, visual communication, and virtual collaboration as about reading and writing text. While it’s not the best tool to use for a classic “Web 2.0” applications (that mostly deal with sharing text and links asynchronously), it’s definitely the best thing going for “Web 3.0” applications that are about real-time, synchronous communication. If I was building the “Flickr of video”, for example, there’s no question what I would use flash heavily.
Update: This article has been translated to italian! Cool!