views:

184

answers:

6

Is JavaScript capable of doing the same what Flash does? And if it is the case, can it be a good idea to switch from Adobe Flash to JavaScript?

+2  A: 

Depends on what functionality you are looking for. While javascript has much evolved recently and many frameworks were introduced it cannot be compared to Flash in terms of creating rich web interfaces. I think though that progressively new concepts will be introduced like HTML5, usage of the GPU and HTML + javascript might one day fill the gap.

Darin Dimitrov
+3  A: 

Is JavaScript capable of doing the same what Flash does?

No, definitely not. While both share some capabilities, like animations and interactive interfaces, JavaScript's and Flash's design philosophies differ fundamentally, and in terms of features in those fields, Flash is certainly way, way ahead.

And if it is the case, can it be a good idea to switch from Adobe Flash to JavaScript?

It might, depending on what exactly you are doing in Flash. If you outline that in more detail, you will certainly get more concrete answers.

Pekka
It depends on what you consider "features".If you're building an arcade-style game, Flash has more features.If you're building a web site to promote a business, HTML+JavaScript offers a lot of "features" to users that Flash can't: users can resize the page, they can copy and paste the text, they can deep-link to pages within the site, they can create mash-ups, they can override the CSS of your site for accessibility, etc.
dmazzoni
@dmazzone By "features", I mean animation and interactive design only. Editing to make that more clear.
Pekka
@dmazzoni - with the exception of users overriding the stylesheet those other features you mentioned are all available in Flash/Flex.
free-dom
+3  A: 

Here's a response to Apple's recent trumpeting of HTML5 - Jump back in time with HTML5. There's still plenty of reasons to use Flash!

The Apple HTML5 demos (left parts) only work with Safari (4.7% of all users on all devices). Some HTML5 features work, others won't work on other browsers. As a matter of fact, HTML5 is not really a standard at all. The Flash TODAY demos (right parts) show how 97% of all websurfers can experience Flash the way it is supposed to be today & tomorrow: fresh & innovative. By the way, these Flash-examples are extremely hard or simply impossible to build with HTML5

Paul Dixon
+3  A: 

Hell you can use javascript to "do" flash!! Check this out! Smokescreen

On a serious note, flash has its own advantages. Like e.g. games and some very specialized apps like audio video editing etc. Maybe javascript and HTML5 is not there yet, but its getting close!

naikus
Uh, correction: you can use javascript to "do" a limited subset of flash. It's not as if smokescreen is going to let you convert chatroulette.com, or a DRM-protected flash video player, or twenty other things.
fenomas
@fenomas I didn't think you understood the answer (the first line is a joke to emphasize how cool smokescreen was), or you did not read it completely. The second part talks about what you are saying. Please read it. And why the down vote?I'm no flash hater, nor html5/js slave.
naikus
I don't downvote things for ideology, only accuracy ;) I just don't think it's correct to say that HTML5/JS are getting close to Flash's capabilities... either on the pure features side, or perhaps more importantly on external things like penetration, consistency, and tooling (for my money those sorts of things are responsible for a very big piece of Flash's developer share). To be honest, outside of vanilla video playback and ad banners I don't really think of Flash and HTML5 as competing technologies.
fenomas
It obviously doesn't look like you do it for accuracy. Check your own 1st comment. It specifically talks about my first statement in the answer
naikus
@fenomas: Your statements still don't make @naikus's answer incorrect, so I don't think the downvote was deserved. He isn't trying to say that HTML5 is better than Flash--in fact, there is nothing in his answer to suggest that. He was merely pointing out that a lot of things that are possible in Flash are also possible in HTML5.
musicfreak
@musicfreak: I'm not sure what you mean. The answer as stated says two things; that javascript can "do" Flash and that HTML5/JS are getting close to Flash - and as noted, I think the first is misleadingly imprecise and the second is not accurate. Neither I nor naikus is saying either is "better"!
fenomas
+7  A: 

No, JavaScript cannot do what Flash does. Maybe HTML5 w/ canvas,JavaScript w/ JQuery,CSS3, some Webkits and some SVG/JPG to handle pictures and animations can make an attempt at what Flash was 5-10 years ago.

Video

JavaScript - There is only one implementation I know that slice the video into JPEGs then dram it onto the canvas. No clue what happens if one wanted to stream a file.

<video> tag - Best thing to come along. I would not lie. But this is not JavaScript.

Audio

JavaScript - I remember once it could be used for MIDI files but then it needed compatibility checks based on the browser

<audio> tag - Same reasoning as <video> tag, it is not JavaScript

Animation

These are three places I know making the cream of the crop that can be made with JavaScript.

  1. Mr.Doob's Playground
  2. Spiderman Animation
  3. SmokeScreen Flash to JavaScript

Note well. Do not talk about Apple Demos ... that is a joke and all marketing. They have only optimized for their browser (Safari)

Also do not talk about what Steve did or did not say. He is a pro at marketing. The other steve (Steve Wozniak) is the engineer.

(1) I highly respect because Mr.Doob really pushed that <canvas> and JS . (2) Was great animation that could be accomplished by a teenager in Flash IDE 5 years ago ... way too much effort to make something so simple. (3) Is really good yet you start with the Flash File ^.^

Lines Of Code

In many cases ActionScript, better yet the Flash IDE make animation a breeze with half the lines of codes (or maybe even simple drag and drop on timelines) than JavaScript. Libraries such as JQuery were brought in to try to shorten the amount of code. Even then in most cases less code/implementation was needed in ActionScript.

Accessibility and Performance

This is in the hands of the developer and has nothing to do with the language. Flash is capable of providing deep linking with SWFAddress (Ajax), page resizing (Stage Scale) and so forth. People constantly talk about performance with Flash, yes this is true but this is poor design on the developer for memory management.

Updates

JavaScript will be limited by the <canvas> and other elements to achieve what Flash can do.How ? If issues started to occur in HTML5, what would you do ? Send in a bug request ? No ... you will wait a next 3-5 years for HTML6 specification.

Suggestion

I suggest looking through Mr.Doob's work, Webby Awards and google the best of Flash Websites. Look at them carefully see if you can bring up case studies. Like this one : Creating marketing platforms with Adobe Flex Website under study : http://www.bombaysapphire.com/

And a word to a wise , one of your favorite websites - YouTube, would not have survived if it was not for Flash :D

phwd
The video tag is not Javascript no, but the question poster probably means "Is the browser natively capable of..."\
Bart van Heukelom
Just to add, HTML5 video and audio is still not at the level that Flash is. Flash video/audio is much more robust than what HTML5 has to offer at the moment.
musicfreak
A: 

Javascript is vast. But it cannot replace Flash.! The biggest Advantage of using flash is hiding the source code.. Which in Javascript is nt applicable always.!

Flash is Used in Animation of Cartoons and 3D web sites etc.. Of course u cannot create a front end competing to Flash..

One good solution would be => If you want ur site to hav good programming properties den go for javascript..

If U want ur site to be good in Front end design den go for Flash!! Although flash has its scripting language [Actionscript] its not dat much flexible as javascript!!!!

Noddy Cha