

Javascript or Flash Widgets debate. Help me choose what to use. - thomasswift

What are your thoughts, tips, and/or best practices for either?
======
jsjenkins168
I personally prefer lightweight javascript over the often slower flash
equivalent. Rich UI functionality is generally easier to implement in flash
though. But this can be a heated debate so watch out..

Some things to consider: The iPhone supports javascript but not flash, Adobe
does not have flash out for x86_64 Linux, Flash is a proprietary closed
platform.

~~~
codeLullaby
"slower flash equivalent" ?

The basic file size of an empty swf file is approximately 35 bytes.Apart from
this 35 bytes, everything else is developer contribution. The file size
depends on what kind of assets you want to embed in your flash widget. If you
embed more images,mp3s etc., the file size will increase. One of the greatest
strengths of flash is the speed at which the 'flash virtual machine'
initializes. A swf file churned out by a good developer will perform well.

Having said that i would personally prefer to go with a javascript version, if
the widget doesnt require video or hardcore visual effects.Why lock yourself
in a closed piece of software unless its acutely necessary ?

A major disadvantage of using flash is that, flash by default will place
itself on top of everything else in a webpage. A work around for this is to
set wmode as "transparent". But this will drastically reduce performance of
flash widget in Gecko browsers.And hence, as far as possible, use javascript.

~~~
darius
Keep hearing the same 'closed software' regarding flash and I don't understand
why. There are quite a few open source platforms that produce swfs (open
laszlo, aptana, even flex is open source now). Regarding the flash player, it
is not any more closed software than IE is.

Also isn't it nice not to have to write javascript code for each browser that
exists out there?

~~~
codeLullaby
You are right. One of the greatest advantages of Flash is that, you need to
code only once, and you can deploy the swf wherever Adobe's flash player
works.But thats the catch! The format's license do not allow the creation of
software that could 'play' SWF files. The license only allows the creation of
software that could 'create' swf files. Aptana, Openlaszlo are all development
environments that could 'create' SWF. In short, Adobe doesn't want anyone to
mess up with the Flash Player.As you may already know, Gnash is an open source
movement in this direction.

What if Netscape said only Netscape's browser could handle javascript although
you could write the script in emacs or notepad or whatever .. ?

As a widget usually requires only very little coding, its worth coding it in
Javascript ,if it isnt too Rich with animation,video or audio.When it comes to
these rich factors, there is no question that flash is the best choice.

------
epi0Bauqu
Pretty much everyone has JavaScript. While for what you are doing, probably
everyone in your target audience has Flash, but keep in mind for different
versions the % of the general population that has it installed is not 100%:
[http://www.adobe.com/products/player_census/flashplayer/vers...](http://www.adobe.com/products/player_census/flashplayer/version_penetration.html)

Adobe (who has an incentive to inflate their numbers though I'm not saying
they are) puts Flash 9 at 84.0%. Below that you get into the high 90s. But if
your whole product is based on a viral loop, and you can achieve the same
thing with JavaScript, that few % can be important when compounded over time.

------
tocomment
Any advice on making widgets in general? I'd like to make one for my site in a
few months and I don't know the first thing about them.

How can a javascript widget even work with the browser restricting javascript
to access other domains?

------
ed
Play to the particular technology's strengths... flash for video or
performance and javascript for flash-disabled clients or working closely with
the DOM

------
bosky101
for anything that needs to push data frequently - javascript/ajax for anything
that needs to pull data frequently - flash

and dont worry about that javascript widgets slowing thing! the web as we know
it ,is fragmented in data anyway.

------
thomasswift
thanks for all the comments and thoughts

