Can I use JavaScript to do the same what Adobe Flash does? - javascript

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?

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.
Mr.Doob's Playground
Spiderman Animation
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

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!

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.

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

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.

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!!!!

Related

What caused Flash and Actionscript to become irrelevant? [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 6 years ago.
Improve this question
At first glance this question may seem like I'm looking for opinions or a discussion, but hear me out. While I'm sure everyone has their own opinion of which tools are best to use, there have got to be some factual reasons why Flash's popularity faded away. I'm sure there were certain events and inventions that caused people to prefer other tools, and I'm dying to know what those events are. So I am looking for answers that are based on facts and events. All I can gather from the research I've done and the projects I've seen is that Flash used to be really popular for creating interactive media or cartoon-like movies, but now it's not.
The background story to this question is that over the past few months I've been creating a project with Adobe Animate and Actionscript for a college class. It's been fun and I find that Animate is extremely useful. I would like to think that the skills I've learned will be useful in the future, but I've heard from several different people that Flash is pretty much irrelevant now and I can't figure out why.
I know that front end developers are using Javascript and HTML/CSS for most things, and I do understand some of the advantages. Javascript programs seem to have more open-source availability, and of course no one wants to pay a subscription for Adobe products forever. But what I don't get is what replaced the visual aspect of the "stage". Something as simple as drawing a circle could become hard really quick, or tedious at the least, if you're just using code alone. And if you draw two or more objects, you have to worry about their relative positions. Flash makes that super simple by allowing you to just drag them to where they need to be. But once again I imagine it would be really boring to have to use trial and error to position things solely with code.
So are the Javascript coders using something similar to Flash for their animations that I'm just not aware of, or are they really just using code alone? If they are just using code, WHY would they give up the stage aspect of design?
Politics, sadly. Flash was/is superior to HTML5 in almost every way (explained below), but there were a number of non-technological factors that ushered in its demise. Below are a few that come to mind:
1) Ads. This was the way most people grew to recognize Flash content; if it was flashy and annoying, it was probably Flash. This was unfortunate as it was not the technology itself that was the problem, but the use of it. (the fact that Flash was used so much for this type of content says something about how effective Flash was at creating this type of content).
2) Full Flash websites/games. Again, this was not so much a problem with Flash, but those who used it to create the content. Often devs will produce content on machines that are significantly faster than the average user's, and do most, if not all, testing locally.
3) The 1st iPhone was quite slow compared to those that exist today, and it was slow compared to a majority of computers as well. It is no surprise then that a technology that specializes in multimedia, running in a virtual machine, may have problems running on such a device; however, to say this would be to say something negative about the device, and rather than do that a 100% of the blame was put on the technology. The average consumer's experience with my previous points made this tactic easy to pull off.
4) Adobe gave up after losing the PR battle. There were many things they could have done to save Flash, such as: not dropping Android support, not dropping Flex support, not dropping Flash Builder support, and not ignoring the dwindling Flash engineer community. There is no reason why the iPhone could not run Flash today (and run it well), and there is no reason why Adobe couldn't create a transcompiler to convert content; I already did this (flash api, full as3 language support, e4x, etc.), but it's not open source as of yet. If one engineer could do this, they certainly could have!
5) Overblown publicity of Flash vulnerabilities. Critical vulnerabilities are found in programs all the time, browsers, operating systems (yes, even OS X), etc. But due to the growing discontent for Flash in the general public, issues found in Flash were covered as if Flash was the only program that was exposing people to vulnerabilities.
Technology: Is/was Flash tech superior? Absolutely, HTML5 was actually a huge step back, and here is why:
1) Flash was stable. If you got your app to work, it would almost be guaranteed not only to function exactly the same in all browsers and operating systems, but also to look identical as well. Want to develop an HTML5 app? Either use a javascript library to fix all/most browser inconsistencies, or welcome yourself to a debugging nightmare. So, of course, you add that abstraction layer, but now what happens when you still have an issue? Well, now you have to dig through that layer..
2) Flash/AS3 does it better. Want to have pixel perfect text across all devices? Flash, yes. HTML5, nope. Want REAL classes, typing, Vectors, weak references, interfaces, objects as keys, namespaces, private variables, asset embedding, etc. ? Flash, yes. HTML5.. while it's possible to create a compile-to-JavaScript language to pull most of this off, now you have to deal with that output when you're debugging. How about complex, nested, animations? How easy/fast is that to do in Flash... Sure, editors can be made to output the equivalent in HTML5, but most will not stream like Flash did, and will have severe limitations compared to what Flash can do.
3) The Flash API. The Flash API was well documented, powerful, and pretty simple to use. Compare this to the joy of searching online looking at compatibility lists and vendor prefixes for HTML5.
4) todo... there is quite a bit more.
HTML5 is better only in the fact that it is 100% open (and it's not a plugin, which people tend to dislike). The SWF specification is open, and there was an open-source Flash player (the Tamarin project); so, it is not as if Flash was completely closed like some would suggest; personally, I would trade the openness of HTML5 for stability and consistency any day.
However, if openness is one's primary concern, then one would probably view the step backwards in capability and efficiency as worth it.
BTW: I actually write all my HTML5 and NodeJS code in Flash/AS3 and compile to HTML5/JS. I can still use Flash for debugging (and as my gold standard if you will), which is fantastic..

JavaScript or Flash for multiplayer webgame?

I was recommended these two languages as a good option for multiplayer web game development, but I don't know what are restrictions of these languages in terms of game development. I personally like JavaScript, but I'm not sure about client-server communication and security.
Game is going to be 2D turn based strategy.
Shortest answer: Flash.
Short answer: Flash is your best option at the moment, but it's entirely possible to make a good quality game with javascript, there's libraries out there that make the drawing part really easy.
Long answer: For action heavy games, such as a fast paced platformer or a fighting game, Flash is your best option. Flash is also the only option if you want to be able to sell your game to various portals, since they have not yet opened up the ability to license HTML5/Javascript games.
However, Javascript is a viable game development language. Angry Birds on Google+ (and in the chrome store) uses Javascript, and only uses Flash for audio. In fact, audio is currently the biggest challenge, and there's slowly more solutions to that as well. Combine that with stuff like socket.io and the emerging WebGL, and you've achieved parity with most Flash and Unity games.
That said, there are drawbacks to Javascript. Namely, it is much harder to protect the code from being stolen or hacked, and depending on various factors, you're cutting out a subset of users who might be running IE8 and below. There are solutions to these problems, and there is one major drawback of Flash (doesn't work on iOS), but generally, these should be pointed out.
if to be short, it's too hard to draw via javascript. So if you game deals with graphics or animation, it better to use actionscript. IMHO, actionscript is the best if you want to design browser game, javascript will be needed to deal with browser only (if that'll be needed).
UPD: take a look at Haxe. It's multi-platform language. You can target both flash and JS on Haxe.
I would recommend Flash, unless you care about the iOS audience. Having a socket running in your multiplayer game is extremely valuable, and easy to accomplish. Meanwhile, unless you want to demand a specific browser from your users, the never ending headache of browser/platform incompatibility, especially in something as javascript intensive as a multiplayer game, makes Flash the obvious choice. And of course, performing animations is what flash is best at. Achieving similar results in HTML is in many cases impossible, but in all cases MUCH more work.
Oh, and welcome to Stack! :)
Go javascript. But you should look at http://socket.io/ if you go the javascript route

Tools for HTML 5

Everyone keeps saying flash is dead, silverlight is dead, and the future is HTML 5. Most technical people I've talked to seem feel that this is a generally accepted fact. Just a matter of when the spec will be finalized, and when each major browser will finally incorporate all the individual features. But it seems to me there's a big elephant in this room: where are the tools?
Flash. Maybe on it's way out, but it had one hell of a designer. It had drawing tools, layers, timeline support, tweening, etc. It made building rich UI and animations REALLY EASY, which is why it's everywhere. Without flash I'm assuming we turn to canvas? We can't be planning on doing all our UI in code? Where is my 'Canvas Studio MX'?
Video. So we agreed on a totally open/free format with ogg vorbis. Sweet. Is there a good open source set of libraries out there for converting/authoring an ogg file?
Javascript. If we jump on board the HTML5 bus, we're pretty much all agreeing that the engine runs only on Javascript right? Is there some really effective JS IDE out there? Notepad++ is good, but is there something that can make refactoring a really huge application NOT a PITA? And here I'm referring to the fact that JS is dynamically typed, and so today it seems really difficult to get A)Intellisense, and B)Refactoring Support(Rename Method, Get Reference Count etc.). Either the language needs to change, or we need a really smart editor.
Maybe I'm raving here, but I'm a web dev by profession, and I would LOVE to get away from propietary compilers and overcomplicated,convoluted 'super tools' that cause more problems that they fix. But these points seems like real problems to me, and I'm surprised they aren't being given more attention. Or maybe they are, and if so, please feel free to show me the light :)
Web developers come from a variety of backgrounds ranging from Computer science to Graphic design. The coding environment they use reflects this variety and whilst some coders are comfortable writing an entire application using only Textmate, some others prefer to work with Aptana, the Flash IDE or Dreamweaver ( no quality comparison here ).
I think your point is valid , if Flash is about to be replaced by HTML5 , the web developers who were using tools such as the Flash IDE will expect tools on the par with what they're used too.
Another way to look at your question could be to wonder if Flash's announced death isn't the death of a certain vision of the web. A vision led by creatives who , not comfortable with the pure coding approach , could nonetheless express themselves with Flash, which to a certain extent , hid some of the complexities of programming or at least made it easier for them to tackle.
I agree that there are some tools missing at the moment and as PatrickS mentions, it depends on your perspective and what you are used too.
A website developer would be fairly happy at the moment. Not much changes for them. They keep the same workflow and as more tools become available they will be added to their environment - and besides, they can get by with just copying-n-pasting with notepad etc.
An animator can currently not do much with HTML5. They require a tool such as Flash IDE. It must also integrate with packages such as illustrator. Could be a while before we see a stable, usable tool.
An Applications developer (which is the area that I fall into) will probably try to avoid HTML5. Simply because JavaScript is not suitable for large applications development. Netbeans at the very least exists and appears to support things like code completion, refactoring etc which will help if you end up having to do some serious JS development- but I suspect it does not match Visual Studio.
A games developer developing something of significance would have the same issues at the applications developer and animator. While yes you can make a game just through code, things like platformers, adventures games etc really need a Flash IDE to layout all the graphic assets. Likewise, for programming, JavaScript will be more pain than AS3 or C#
Flash: There are a number of strong languages that do amazing things without the nice fluffy UI and timeline, layers and such. I'm sure one will come along, but is not a show-stopper, not do many people care right now - so no elephant (IMHO).
Javascript: There is no shortage of places IDE's where you can use Javascript. Sure you can use Notepad if you like, or else Eclipse, TextMate etc... I see an editor as an aid and not a dependency when refactoring code. JS has its problems but to date its proven (again, just my opinion) that it has more to offer to compensate for that.

How far is HTML (and SVG and CSS and WebGL and JavaScript) to reproducing what Flash/Flex can do today?

As a Flash and Flex developer it is a little disheartening to see the strides in HTML5. Don't get me wrong I have nothing against progress, for me it is just that currently it is easier to write an app in Flash vs AJAX. I love writing in Flash and Flex and think ActionScript is a really great language. But, it appears the strides made in ActionScript or making their way to JavaScript and that video in HTML 5 may make Flash/Flex a thing of the past.
So when do you think (if ever) that HTML will or is a competitor to Flash/Flex for RIA or will browser incompatibility stop this from ever happening?
The reason I am asking is because I don't know if continuing in Flash/Flex is a good idea career wise if HTML 5 can do more. Just looking for some answers from other developers using the technologies.
There are four things that hold the "modern browser" back from where flash is today.
1) Tools. Animating et al with Flash is obviously much easier to do. Plus JS/SVG don't have the "direct" animation support that Flash does right now. It can be done, but it's manual.
2) Performance. JS/SVG/Canvas can not perform as fast, and certainly not as consistently across browsers, as Flash can. Not every application needs the performance, and JS et al are catching up. But at the moment, they still lag behind in total overall performance.
3) Browser adoption. Ye Olde browser wars. Different implementations, different speeds, legacy browers, etc. All the issues the afflict the portable web are in place for the modern browser technologies. So, it's more work to make a portable artifact, and even then it simply may not work, especially on older browsers.
4) Content protection. Flash is hardly the bastion of content safety in terms of IP control etc, but it's night and day over JS, HTML, SVG, etc. where it's all pretty much free for the taking. This will especially confound things like video which right now is mostly bastioned behind Flash players vs simply streaming mp4s to the client.
We've already seen some of the more clever "Javascript ads" (those annoying, floating animated panels for example). I'm waiting for more of those, just as simply animated mini ad apps vs flash. The primary reason most users who disable Flash do so, is to disable applications. JS mini ads won't have that problem.
However, the primary creator of those ads are the creative folks specifically targeted by Flash. It's easy to use for them without being "real technical". Until you can do that with Javascript and the rest, Flash will have a large market for it.
I think the original poster is asking where do cutting edge open web technologies (draft standards) stand versus Flash/Flex. Ignoring questions of browser support and developer tools, look just at features (as you'll see, I know the web side much better):
Vector Graphics
Flash: Yep.
Web: SVG.
Raster Graphics
Flash: Yep.
Web: Canvas.
Audio
Flash: Yep, with ADPCM, MP3, HE-AAC (MPEG-4 Part 3).
Web: HTML5 audio tag with MP3, Ogg Theora, Ogg Vorbis, WAV.
Video
Flash: Yep, with On2 VP6, Sorenson Spark, Screen video, Screen video 2, H.264. The Windows version of Flash 10.1 has hardware-accelerated H.264 decoding.
Web: HTML video tag with Ogg Theora, H.264.
Animation
Flash: Yep.
Web: Yep, via some Javascript DOM commands and via CSS3 properties for animations, 2D transforms, 3D transforms. Some browsers (e.g. Mobile Safari) hardware accelerate some of properties.
I think the big differences currently (given the caveats mentioned above) are performance and implementing all these features. While Javascript is very good in many ways, the programming experience isn't nearly as integrated as in Flash/Flex's ActionScript (note that many of the animation features that are done in CSS). If you want to learn more about where open web standards are going, check out HTML5 Doctor.
HTML/CSS/Javascript together solve a different problem than Flash does.
HTML and CSS are about the appearance of your page, and are the 'universal' language of the internet. Really it's the only language the browser natively understands. Javascript is natively supported in most browsers, but was a glue language never intended to allow the flexibility of Flash.
Flash/Flex are about creating a portable (albeit proprietary) application framework. However, without HTML, Flash and Flex don't exist.
A developer can never stop learning. If it's not HTML5, it'll be something else. I would continue programming what you love, but start playing with HTML5 and see what it can do. It will expand your horizons and help you to think about things in a new way. But you don't have to give up what you're doing now, especially as HTML5 still isn't ready for the mass market yet.

Are HTML-based AIR apps equally fast/powerful v. Flex AIR, or just a "lesser" sibling?

I've got a HTML/JS (YUI framework) photo-organizer that needs access to the local FS. Should I move HTML/JS to AIR, or bite the bullet and "port" it to Flex AIR?
I know what the marketing says, but I want the real answer -- what an I "giving up" by going HTML/JS AIR? I'd like to get some feedback from people with deep experience building HTML-based AIR apps.
I don't think you'll see many issues in using the HTML AIR mode, AIR uses the Webkit engine under the covers iirc, which can work well enough, and has most of the same native features of the Flash/Flex built applications. You'll also see most of the HTML5 features you'd find in Safari. I would say if you need animations that Flash will generally run better than Canvas at this point... There's plenty of examples of ExtJS and other frameworks running on AIR.
As to what you are giving up, I don't think you'd lose anything from an HTML to HTML/AIR standpoint. You could gain a lot of what you gain in having an application in general based in Flash over straight HTML. In flex specifically controls and other features can be more readily tweaked than standard HTML controls. The animation tools in Flash are much nicer. ActionScript doesn't line up to JS on a one to one basis, so there may be issues with code. Dealing with remote content/data is actually a little nicer imho in AS over XHR, though only when dealing with XML.
From an administrative standpoint, going to AIR with HTML from an already written application is probably the shortest path. If you REALLY needed to, you could convert later, and a lot of the underlying logic would be worked out. Time to market would be shorter with whatever is closest to what you are already using more often than not.
Not really, since FS access is available with the HTML/JS version. However, the other route does open up some more native support for application development -- Animation for example, richer controls etc which you will have to live without otherwise. You will greatly miss the debugger and the profiler as also the design view when you move to complex applications. Also, note that if you are worried about sharing your source you probably shouldn't use the HTML/JS way.

Categories

Resources