Time to de-Flash your site?
Editor's Note: This story is excerpted from Computerworld. For more Mac coverage, visit Computerworld's Macintosh Knowledge Center.
Robert Cunha, an iPad- and iPhone 4-toting systems administrator for the public school system in Burlington, Mass., has experienced his share of the duality of being an Apple fan.
On one hand, Cunha helped roll out the districtâs one-on-one iPad implementation, which puts an iPad in the hands of every teacher and student. But on the other hand, Cunha confirms what many Apple users cite asâ"and every Web developer knows to beâ"a major frustration: The lack of Flash support in Appleâs mobile devices.
âWhen I am accessing a website that has Flash, I usually get a blank part of the screen, or a red box where the Flash element is,â Cunha says. âOr I may just get a static image.â If the organization behind that website hasnât developed a scaled-down mobile-friendly alternative, Cunha says he usually avoids the site totally.
Cunhaâs experiences illustrate a growing dilemma for corporate website strategists and developers: We live in an increasingly mobile society, and managers, coworkers and customers increasingly access the Web from mobile devices. If you want the mobile Web experience to be truly accessible, you may need to create a scaled-down version of your website for iDevices, and keep Flash off it.
That does not necessarily mean avoiding Flash entirely. But it does mean you must be aware of how your customers access your site, and what type of experience they require.
âThereâs no immediate hurry to remove Flash video from main sites,â says Jeffrey Hammond, an analyst with Forrester Research. âWhat I advise companies to do is to start encoding video in H.264 and VP8 too,â and then detect which browsers customers are using. Depending on the browser, âserve up the video stream that is best for it,â Hammond suggests. For versions of IE lower than 9, that means Flash.â
Plus, Hammond says, âroughly 40 percent of current desktop browsers are still not HTML5 Video capableâ"Flash remains a good option for them.â
Where Adobe stands
Ben Forta, director of developer relations at Adobe, agrees with the strategy of using Flash on a main website for those features and functions that it works best with, and developing applications for mobile sites that best suit usersâ needs.
In November 2011, Adobe announced its intent to stop Flash Player support for mobile browsers. Analysts expect Flash support on the desktop to stop at some point, too, but not anytime soon.
âMost of the interest now is on Flash for applications,â Forta explains. âIn the past, Flash picked up where Web browsers left off. For example, if you wanted a pop-up menu, you needed to use Flash. No one would use Flash anymore for a pop-up menu.â
The focus nowâ"and going forwardâ"is on working with Flash outside the browser, Forta says. A developer can code in Flash still, but package that code as a native application that can be written for a specific device. Adobeâs Fresh AIR application enables developers to do exactly that, Forta says: Write code once, then use it for both main and mobile-friendly sites.
Just saying ânoâ to Flash
Developers agree that there is no other application that can directly replace Flash and do what Flash does as well as it does. And that includes HTML5â"the only seriously suggested substitute for Flashâ"despite all its promise.
Sometimes a developer still needs to use both Flash and HTML5, for different reasons, says Joseph Crawford, a Web developer and Flash expert at Slackers Radio. âIn some ways this is the worst of all possible worlds, but itâs where we are right now.â
Flash is âwonderful atâ anything to do with animation, with lots of interactivity, with gaming, with going full-screenâ"video playback, for instanceâ"says Joseph Crawford, a Web developer and Flash expert at Slackers Radio in San Diego. âHTML5 is still catching up with Flash in terms of compatibilityâ"but still, you donât often have a choice to go either/or,â he explains.
If a developer chooses HTML5 only, âyou often end up needing Flashâ to help play multimedia for Firefox, for instance, Crawford says. âAnd if you go Flash only, you end up needing to provide a non-Flash optionâ for iPads and iPhones, or for the increasing number of people who have browsers with Flash blockers. âIn some ways, this is the worst of all possible worlds,â Crawford says, âbut itâs where we are right now.â
If developers are asked to de-Flash a website, their response may depend on how long theyâve been working with the application, and how strategic a role development plays.
âI donât think of what I do as âde-Flashingâ a website,â explains Dale Cruse, senior user interface designer at Digital Results Group, in Boston. âFlash and HTML5 are not direct replacements for each other. Itâs not like taking off glasses and putting in contact lenses. Instead, Flash and HTML5 are two different things.â
That said, if a client hires him to get rid of Flash and go with HTML5â"which has happenedâ"âwhat I do is take the opportunity to sell the client on a complete redesign of their website,â Cruse explains. âIf you exploit what HTML5 is good at, youâll probably have a positive outcome. But if a client views HTML5 as a direct replacement for Flash, theyâre probably setting themselves (and their developer) up to fail.â
What about HTML5?
So just what is wrong with using HTML5 as a replacement to Flash? A few things, says Forresterâs Hammond. The main issues he sees with HTML5 video right now include:
- Limited support for digital rights management; itâs coming, but right now it makes it difficult for companies like Netflix to protect media.
- Limited support for variable streaming rates â" if your connection weakens (goes from five bars to three, for instance), the server has problems adjusting to the bit rate you are getting, so you end up with frozen video downloads.
- Inconsistent codec support. Chrome supports VP8, and IE9 and Safari support H.264, which means developers have to encode for multiple formats.
Donovan Adams, a senior interactive developer who has worked at Syfy/NBCUniversal and Macys.com, agrees. âThe biggest and most obvious thing is compatibility on iOS devices. HTML5 works on iOS and Flash doesnât,â Adams notes. But HTML5 doesnât work across the same number of browsers as does Flash, he says.
Another issue Adams points to is that the Flash pluginâ"one of the three major components of Flashâ"âis just now getting much-needed performance enhancements,â Adams continues. âI still believe that as people push the HTML5 envelope, similar issues will come up with performance regardless of Flash or no Flash.â
Adams says heâs been developing with Flash for close to 10 years. âItâs changed considerably over the course of the years, and has been an important part of the Web experience.â Adams says he see Flash as a tool for creative exploration, whereas HTML has traditionally been a tool for data and content delivery.
âObviously there is overlap, but because of this basic conceptâ"along with Flash being in the private or closed domainâ"Flash has been able to evolve as a platform much quicker,â Adams says. âAs long as Flash has support and Adobe continues to invest in the platform, I donât see HTML5 catching up to it anytime soon.â
When asked about specific examples of using HTML as a Flash replacement, Adams says, âIâve seen a number of well-done experiences in HTML5, but I find myself feeling like they would have come off slightly better using Flash. Certain things such as image quality and image rendering characteristics, as well as synchronization, just seem to feel better in Flash.â
A growing need
There is no data readily available regarding how many companies have already created scaled-down mobile-friendly websites, but the number is increasing, analysts agree. They also agree that the amount of Web traffic from mobile devices is growing dramatically.
The situation requires that developers understand their users, how they are accessing web content and how that accessibility may change.
âItâs hard to deny the influence of a very rapidly growing computing market segment [phones and tablets] and of the best-marketedâ"and arguably the best-madeâ"products in that category,â Slackers Radioâs Crawford says. Appleâs devices âare commonplace, easy to test on, and straightforward to cater toâ"as a result, they get more attention from Web developers than other mobile devices.â
So when does Crawford recommend using Flash, and when should it be avoided?
âUse Flash when you can have at least some assurance that the population is using a desktop browser,â advises Crawford. âFor the most part, using a desktop browser implies that your visitor will have Flash.â
But donât limit your focus to just your siteâs home page, Crawford says. Use Flash when there are no other options, he suggests. Then, âthere are things Flash is simply better at. And Flash still has a place for things where HTML5 technologies donât cover every browserâ â" for example, when multimedia playback is required.
âI think the basic best practice from a business perspective is to be platform-agnostic,â Adams chimes in. âBut how you go about doing that depends on the project, creative needs and budget.â
He explains further: âThe creative and technical requirements would dictate the best approach.â If there are extensive creativity demands, including the need for video, games or multimedia ads, for instance, âthen Flash would be an ideal option, with a fallback designâ for mobile.
âIn many cases, the fallback design can get close to the Flash version, since you arenât dealing with [the same] browser-compatibility issues covered by the Flash version,â Adams says.
How to de-Flash
When asked what the steps would be for a developer to de-Flash a website, Joseph Crawford, a Web developer and Flash expert at Slackers Radio in San Diego, suggests the following.
Flash on a website may be internal (files under your control) or external (Flash used by external services), Crawford says. Hereâs what to do accordingly.
Internally:
- Identify the portions of your site that are built in Flash by finding files with the extension .swf.
- Convert the code from .swf using a conversion tool such as Googleâs Swiffy or Adobeâs Wallaby and test the results. If the results are satisfactory, you can then use this code in place of the Flash content. Code is converted to a combination of HTML, CSS and JavaScript.
If the conversion tools fail, further evaluation is needed. In many cases, basic slideshows or music players can be replaced with JavaScript libraries: jQuery, Prototype and MooTools are just a few of the popular plugins available.
Crawford says, âThere is a thriving community developing tools such as jQuery Cycle Plugin for basic slideshows, and jPlayer for multimedia playback, that are excellent.â This is worth noting because support for multimedia in HTML5 is not yet complete, he says. âRemoving Flash entirely may not be possible.â
Externally:
- Identify the portions of your site that call external services that may be using Flash. (For example, video and audio files served from services such as YouTube may call Flash movies to play their content.)
- Search the external sites for newer embed code that works regardless of the presence of Flash. Test, and then replace the old code. YouTube at one time used object code to embed Flash. Currently, YouTube recommends iframe code that calls the appropriate content based on browser capabilities.
For more complex applications, there may be no other choice but to reprogram. In these cases, a cost-benefit analysis of your options needs to done.
No Flash? No problem!
Flash can be eliminated from many websites, or left out when the sites are initially developed. The key, Crawford says, is what type of content the site will host, and what sort of experience you want the user to have.
âAs long as Flash has support and Adobe continues to invest in the platform, I donât see HTML5 catching up to it anytime soon,â says Donovan Adams, a senior interactive developer who has worked at Syfy/NBCUniversal and Macys.com.
âFor most websites, youâll be able to remove Flash entirely,â Crawford says. âMy websites are content-based: text, images, and a content management system. Flash isnât necessary for any of that. All of that can be done in JavaScript and HTML.â
Still, there are times when only Flash will really do, Crawford says. âFlash is still justified for multimedia content: interactive visualizations of data, for example; video presentations; rich media advertising; games. These are the cases where Flash shines.â
Still, Adams says, âI never try to avoid using Flash unless there is a specific reason, such as a site that requires iOS-viewable content, or the project experience isnât suited to a specific platform.â Flash requires some horsepower to render correctly, he points out, something most smartphones donât have in abundance. So although, technically, you might be able to run Flash on an Android device, you might not want to.
Getting down to details
âYou have three major components to Flash as a developer,â Adams explains: The plugin, which is installed in the browser on the machine of both the end user and the developer; the language itself â" referred to as ActionScript 3 â" and the I.D.E. or integrated development environment, which is the software used to create the files used by the plugin to display the content.
âI donât see any major shortcomings with ActionScript 3 as a language in itself,â Adams says. âThere are a number of features that would make it betterâ"such as threading, more advanced audio processing and image manipulation added to the core language.â But overall, he considers it âa straightforward and flexible language.â
âIn my opinion, a lot of the bad rap Flash gets is specifically related to the plugin itself and poor development,â Adams says. âI wonât get into the I.D.E., as that is more a matter of personal preference. There are also a number of ways to create Flash content, as well as tools available. The ironic thing is that Adobe only really makes money from the I.D.E. itself,â while the plugin and languageâ"both of which are essentially free of chargeâ"âget most of the attention.â
Building too much functionality
The reason many sites now run into trouble with the growing number of mobile users, Crawford believes, is that developers wanted to get too fancy in the first placeâ"building in functionality beyond what the user experience ever needed.
âThe classic example is restaurant websites which have rich photography, music, an introductory animation and slideshow,â Crawford explains. âUltimately such sites use Flash in a way that works against some very common user needs: What is the restaurant address? How do I get there? What are your hours? Can I get a reservation?â
An all-Flash website simply is empty if the developer did not put in place a fallback âother than âyour browser is not good enough for this site, please upgrade,â â Crawford says. âOn the desktop, people have been complaining about splash animations and overly complex Flash sites for years, too. Anticipate your usersâ needs and cater to them.â
He believes the growing use of mobile devices that donât like Flash will encourage many developers âto pull awayâ from gratuitous overuse of Flash elements in general.
The most important thing is to think in terms of which development tools will provide the best customer experience, not what best fits your comfort zone as a developer, experts agree.
âIâd be lying if I said I still use Flash as much as I did before,â says Adams. âAnd I think most Flash developers would agree with me. Iâve been doing a lot of Web standards development lately, and I miss ActionScript as a language dearly. However, in todayâs digital space itâs about using the right tool for the job.â
[David Weldon is a freelance business and technology writer in Massachusetts, and a former Computerworld senior editor.]