Flash vs Javascript (jQuery) Pros and Cons
Until the availability of Javascript libraries such as jQuery and MooTools adding animation and interactive features that don’t require reloading a web page were out of reach for many web designers/developers unless they used Flash.
This was largely due to Javascript implementations not being consistent in major browsers. Without using a Javascript library you need extensive knowledge about the inconsistencies between the browsers and extensive knowledge about Javascript in order to work around them.
jQuery and MooTools offer a library of routines that are cross browser compatible which greatly reduces the learning curve. These libraries also offer functions to handle many routine tasks making Javascript programming faster and easier to learn.
The Pros & Cons of using Flash vs Javascript:
| Flash Pros | Flash Cons |
|---|---|
|
|
| Javascript Pros | Javascript Cons |
|---|---|
|
|
When to use Flash vs Javascript:
| Application | Flash | Javascript |
|---|---|---|
| Slide Show | X | |
| Form Validation | X | |
| Dropdown Menus | X | |
| Tabbed Panels | X | |
| Popups & Tooltips | X | |
| Expandable/Collapsible Elements | X | |
| Video/Audio Player | X | |
| Complex Animation | X | |
| 3D | X | |
| Complex Multimedia | X |
Flash & Javascript Resources:
| Flash | Javascript |
|---|---|
| Kirupa – nice tutorials Flashloaded – components Digicrafts – components Flash Components Swish – Flash Generator Swift 3D – 3D designer/animator |
jQuery – Javascript Library MooTools - Javascript library jQuery Slideshow jQuery Validation jQuery UI jQuery Lightbox |
While Flash still has a few areas that make it the better choice there are many features that are easily handled by Javascript. If you’re just getting started take a look at jQuery, it simplifies the process of using Javascript and can greatly enhance a web site.
If you enjoyed this post, please consider leaving a comment or subscribe to the feed and get future articles delivered to your feed reader.


Nice list – it’s annoying to develop with flash only to find it won’t work with so many browsers especially the iPhone.
ActionScript is a true object oriented language. It can be compiled with all the benefits of compile time checking.
I’ve yet to see any substantial amount of JavaScript that wasn’t a mess.
this is a very shallow point of view
agree with hmm. your pro/con list based on what javascript has accomplished (after flash).. what about complex yet practical animation processes like springgraphs or actually smooth carousels. i’m not a fanboy of either, but as hmm said, it is a shallow viewpoint.
Great List, thanks for sharing…
Liked the Flash & Javascript Resource very much.
http://sulvision.com
hmm/Mark – thanks for the feedback. I was not trying to diminish the impact of Flash in any way. I think a lot of jQuery plugins get their inspiration from Flash.
Now that there are viable alternatives to some of the things Flash does it’s worth considering the pros & cons of each solution.If you look at the carousels on the NFL team sites some use Flash and some use Javascript. I bet people with mobile devices prefer the Javascript sites.
If I Ieft out some pros and cons please let me know what they are. My mind is open…
Agreed, JS can be disabled by the user. But Flash can be just as easily. I’d suggest replacing that con with “Different implementation between browser versions”.
@Dean, I’ve worked with ActionScript extensively. Because the language supports both static and dynamic typing you can create just as huge of a mess with it as you can with JavaScript. In fact, ActionScript and JavaScript are based on the same standard of ECMAscript.
The biggest drawback of ActionScript is Adobe’s near-incompetence when it comes to their virtual machine (the Flash VM). That thing leaks like a sieve, is bug ridden and has a nasty tendency of crashing the browser on frequent basis.
I’d vote for JavaScript any day of the week and twice on Sunday. With the amount of innovation in JavaScript interpreters coming from the Mozilla camp alone I believe the future is much brighter for it than it is for Flash.
@Yeah, you say you’d take JS any day over Flash. I want to say the same, but are there situations when using Flash just makes more sense than JS? The post mentioned complex animation – could the animation used on Pandora have been done just as easily in JS?
hah, there seems to bit of a bias here. Flash does not require a very high learning curve for animation. I have worked very extensively with flash over the past 10 years and it has come a long way and allows you to get crazy nerdy, but has kept a lot of the simple features.. Don’t get me wrong, I’d love to see javascript move up to par with things like video and animation (because that’s how it should be). As for now flash still wins.
But I am having an affair with jquery..
“Javascript cons: Source Code Not Protected”
This applies also to flash. Flash movie source code is not protected, there are a lot of tools out there that is able to decompile swf files giving you access to all compiled resources.
“Javascript cons: Users can disable Javascript support”
This applies to flash as well. Disabling javascript in your browser also disables its support for playing flash-files.
Websites are now created with support for mobile access (PDAs, IPhone, BlackBerry…) and Javascript is used because it’s supported across different mobile platforms. In this article (http://topcweb.com/content/site-animation-javascript-libraries-vs-flash) you can get a general overview of the movement towards the use of Javascript.
its quite obvious Flash’s day is over.
the only people who still use Flash are those idiots who think by having pointless effects and animations are somehow “world changing”.
frankly, spending hours creating pointless useless animations in flash is a waste of time.
stick with Jquery, its free, easy to implement and it doesn’t suck like Flash does.
Flash is a one company disgrace, often used by those sad individuals who think it is a matter of life or death.
what a sad pathetic bunch flash users are.
the only thing flash is good for is showing video, and thats about it.
flash is for morons
jquery is for people with common sense.
I must say this article looks biased. I can only agree to a certain extent of a comparison if a developer has actually worked on both jquery/javascript and flash extensively and by extensively, I mean knowing ins and outs of both the technologies to actually make a comparison.
Otherwise, we will just keep on seeing one-dimensional posts like this (and we have seen plenty before).
Peace.
- Tahir.
Tahir
The article is intended to provide objective information. If you feel it’s biased can you provide any specific examples to support this?
DLL, having worked with Flash as my bread and butter for 12 years. I’ve recently refocused myself back on the Web 2.0 effort. You kept a little away from the out right abuses of Flash probably a little more than you should of.
-Flash UI Components are normally a CON in the end. They are super heavy, have a huge learning curve and often misbehave with focus issues. Version changes nullify any work you do on past projects.
-Browser UI components are responsive, and work natively, carry no weight and are skin-able without wanting to pull out every last hair on your body. Richer plugins available online.
-Flash literally changes versions every time I blink, and the changes are more than just a plug in update with new codec features or “its 20% faster”. They alter the language, they abandon. They splinter off into Flex now and just muddy the waters with implementation experiments.
-Browsers have to put up with IE6 and the slug that is progress literally at a snails pace. Maybe IE12 will adopt the webkit?!?!
-Flash cannot display rich amounts of data without eventually being crippled by 3 FPS video experiences.
-HTML/CSS/JavaScript handle large amounts of text superior.
-Flash currently doesn’t make use of full CSS/HTML formatting resulting in a poor text experience unless you spend every waking hour of your day hand recreating the content.
- Flash does how ever have better Font support which also eventually turns in to a CON after 500KB of fonts are included.
-Flash can easily be decompiled. Heck, they even reconstruct the FLA and class libraries. Its about as good of a protection of minifying and base62′ing JavaScript.
-Browsers have vast amounts of debug tools
-Flash is closed off with a garage community effort to backdoor it.
I pretty much run “click to flash” now in OSX because I’m sick of my laptop overheating, or my battery getting killed by some worthless animation chewing up the CPU. I would venture to say as much of the “awe” and “cool” features of a pretty vectored animated site are also wasted inevitably wasted on the size, speed and hardware requirements to take advantage of it. Which is why commonly you’ll see game maker sites just going crazy. Anyone with a system older system is just getting murdered by that type of design.
Big disadvantage of Flash is lack of usability and customizability (from user stand point). In Flash galleries, you cannot open images in new tabs, and have to see all of them with useless and frustrating animation, one by one.
Also, in Flash sites, if font is too small, you cannot do anything about this, in html you may use user css (small offtopic).
nice post… however, for the record, flash does work on both PSP and PS3.
Thanks for the correction – I tested this on my PS3 and it does support flash. Though some sites such as Hulu still don’t work, which may not be a Flash issue.
If you’re doing simple animation obviously javascript is better especially with the use of libraries like jQuery
galleries can be also accomplished using jQuery but you get a performance hit with the browser if you animations start to get too intensive, the main reason being that most animation actions done by javascript will cause the browser to redraw *everything* on the screen… sometimes even the whole page even if it’s not in view…
after doing some simple tests, I decided to go with flash for a simple slideshow that used fading in and outs as transitions…solely because a single fade in and out transition took up 1 whole core of my duo core processor (i.e. 50% of my total CPU usage), using flash to do the same thing wouldn’t even move the usage meter :O
So my verdict is:
- use javascript for short, simple animations
- flash for anything that you want to look nice :O and ‘flashy’
Oh and a small tip for javascript animations:
If you’re doing a slideshow and just ’sliding’ the photos sideways or up/down, dun use absolute position and animate the ‘top’ css attribute; make a container for the slideshow, give it overflow: hidden, and animate the scrollTop/scrollLeft of the container, this way the browser will not redraw the whole page.
and you can open images in new tabs :O
edit to above: you can open images in new tabs for flash :O
wow… the bias here is ridiculous. And for those of you who claim to have 10 years of experience I would love to see your portfolio to prove this. I also have over 10 years of experience and I can say until JQuery/ Javascript can do have the stuff found on sites like http://2advanced.com/ and http://www.thefwa.com/ don’t even try comparing javascript with Flash.
Where the data form processing power of flash lacks Flex picks up. And the interpreted non compiled code of JavaScript makes serious application development a mess. Try creating a multi-tier call center app. using JavaScript browser side. adobe Flex/AIR code development make such things a breeze.
Flash/Flex not only surpasses JavaScript on the design side it goes into areas JavaScript could only dream. Application development and true OOP with AS3.0 That means full on encapsulation, inheritance, polymorphism.
Yes… there are decompiling tools for flash apps, but there are obfuscation tools that will make even the best decompiled tools unreadable.
yeah I have been doing web development for 1 year… before that I was a programmer in J2ee and C… Lol… so I never had the chance at a formal art education… but I am slowly getting pretty good with PS and AI… here is my thought on this…
JS is used for simple animations and ALL image galleries (going overboard with image galleries is pointless)…
FLASH… oh flash… although you have some drawbacks you are the king of kings when it comes to giving an artist a canvas… as Tom said: “until JQuery/ Javascript can do half the stuff found on sites like http://2advanced.com/ don’t even try comparing javascript with Flash.”
For most sites where content is King (97 percent of the time)… its probably best to stick with JS… but those rare times where you just want to blow people away and make them rethink what a web visit experience is… there is no doubt in this noobs mind that FLASH is the king for now… who knows what will happen in a decade (if im still around then LOL)
IT WAS WRITTEN!!!!
It’s clear there are some strong feelings about this type of comparison, but it seems most people agree with the recommendations listed in the table “When to Use Flash vs Javascript”.
Javascript source code can now be a little more protected if it’s compiled with Googles Closure Compiler.
I must add that an important factor also is the objective of the project to be able to choose between one or the other technology