Web Developer Musings

In favour of Flash, Part 2

25 June 2009, 10:38 Comments (1)

For several years rather than adding to or aiding website functionality, Javascript was infamous for flashing rainbow text, snowflakes and rockets that follow the cursor. Flash can also be held equally responsible for many moments of eye trauma, often with the added benefit of sound effects. Flash (until the last 18 months or so) held the upper hand in abusing the user because it was so much easier to implement. Popular Javascript copy-and-paste websites still list their array of scripts alongside a tally of legacy browsers they are compatible with, an unpleasant reminder of trying to make that cursor-following-screen-shaking-firework-mega-effect work when I was 14.

Frameworks have taken the hassle out of Javascript, particularly jQuery which removes almost all regular Javascript syntax. This makes it much faster to develop with when learnt. It allows a developer to traverse elements without worrying about nodes, get into AJAX without any hassle and all at the same time as taking care of most browser compatibility issues. At 18KB Gzipped it is no surprise that it has huge popularity. jQuery is easier to use than Mootools and YUI (they still follow roughly standard JS syntax) and tiny when compared to the huge Prototype library.

However, as mentioned in my earlier article the ease of development has led to ignorance about degradation, SEO and accessibility so nothing really has changed. There's a mass of websites with massive frameworks attached just so the website can have some tabs, a slide show or have an element animate in - any of which some CSS and 1KB of basic JS can sort out. While I am not against JS frameworks as a rule - for instance when they are working to provide a large amount of functionality - it is when they are being used to complete basic tasks in a fundamentally bad way that makes me want to confiscate them. The over reliance on JS is annoying, Orange have one of the most frustrating and unusable websites around; and they're a communications company.

So what about Flash? It is too an ideal basis to create an over-the-top web interface when really a simple HTML page would have done but when animations can aid a user's understanding, enjoyment and flow around your website it can be ideal. Creating a text based but highly interactive site will usually weigh-in below 50KB - less than most JS frameworks - and at least your interface will be consistent, there will be no widgets begging for attention, no developer tools popping-up because debug code was left in or any problems with an element just not showing up from time to time. What's the best thing about learning Actionscript? It makes creating well structured, degradable Javascript really easy.

In favour of Flash, Part 1

23 May 2009, 14:13 Comments (0)

Over the last two years Javascript has gained in popularity and taken a large market share away from Adobe Flash in delivering online multimedia and interactive applications. I believe the main reasons for this are developers becoming more concerned with accessibility and simplification of implementing Javascript.

On the first issue I am unconvinced there is a winner. Though Flash can be made in an accessible manner supporting tab and access keys it isn't a suitable tool for delivering a universally usable website or widget. Flash is mainly used for creating interactions that simply do not suit this kind of navigation, or at least developing a Flash project supporting keyboard focus and mouse would take too much time for the small audience gain it may or may not receive. Conversely, forcing the majority of mouse users on to the keyboard to interact with your website is also highly likely to confuse rather than captivate the audience.

As good or bad as Flash may be for accessibility this does not grant my automatic support for Javascript. As most good designers and developers know, a website relying on Javascript for core functions must be built using progressive enhancement. The common adoption of Javascript frameworks has meant there are thousands of plug-ins, widgets and mash-ups in widespread use that lack of any degradation - though this may be relief for users who do not want to know what you're writing on Twitter anyway.

OK, this is all a bit pre-2004 and Javascript access is normal for over 99% of Internet users but there is a much more important question: 'But what does it look like in Internet Explorer/Opera/Safari/Chrome and on my mobile phone/console/MP3 player?'. Though many JS frameworks are well tested and provide a shortcut for providing cross-browser compatible code there are very few areas where behaviour truly is, especially when mobile. Flash entirely side-steps this, the player is available on almost anything and will render and work in the same way almost all of the time. Flash also negates the need to worry about end users having support for various media other than a version of Flash Player installed equal or above the one you have published your work with.

I do not think there is a winner when accessibility is primary concern. Creating accessible Javascript or Flash is difficult, though the former requires full understanding of many programming languages and how they all work together; HTML, CSS, Javascript, browser compatibility and at least the basics of a dynamic server-side language. Flash however requires an understanding of only one.