4
\$\begingroup\$

Both Javascript and AS3 are implementations of ECMAScript.

Is there a fundamental technical reason for Flash being so much more prevalent as a game-publishing platform, when compared to Javascript?

\$\endgroup\$
2
  • 8
    \$\begingroup\$ A semantic quibble here: Flash is a platform. ActionScript 3 is an implementation of ECMAScript that can be easily compiled to the Flash platform, and can be used to script animations/apps in the Flash studio. ActionScript 2 was sort of like Javascript, but was definitely not a proper implementation of ECMAScript. AS3 arrived in 2006. \$\endgroup\$ Apr 12, 2011 at 18:14
  • 1
    \$\begingroup\$ So maybe the better question would be: Why is Flash + AS3 more prevalent than HTML + Javascript? That would make the answers below more valid.. the abilities of Flash + AS3 have just been more advanced and around longer.. \$\endgroup\$
    – James
    Apr 12, 2011 at 23:40

7 Answers 7

9
\$\begingroup\$

As with everyone else, I'm going to assume you mean Flash vs what's collectively being called the HTML5 technologies.

I believe Flash is still more popular because:

  • Momentum. Plenty of people who are interested in producing Flash type games are already well versed in Flash. People who are aspiring to create that sort of game are learning from them. Along with this comes a reluctance to switch for what seems like the sake of switching.

  • Environment. The Flash designer is an integrated package that deals with asset management, authoring of data like animation curves, editing scripts, compilation, optimization and packaging, all with relatively low friction. There is no real competing HTML5 based environment to work in. With HTML5 you're still looking at reinventing a lot of the wheel just to get started.

  • Robustness. HTML5, in its current state, is relatively new and still quite janky for game applications. The rules are constantly changing, which is exciting but not conducive to actually finishing a project. Flash, for better or worse, works as advertised. Its self contained graphics engine is several generations in, with support for all manner of advanced features, and should behave identically in all supported environments. HTML5 is a blank canvas still, and one that will behave differently depending on how it's viewed.

  • Reference materials. This goes hand in hand with the environment and momentum reasons above: there's plenty of stuff to learn from if you're making a flash game; years of articles, discussions and postmortems. There really isn't that much stuff that talks about HTML5 yet.

\$\endgroup\$
6
\$\begingroup\$

Flash is a lot more than ECMAScript. Although there were attempts to introduce some features of ActionScript into ECMAScript version 4, those were abandoned.

JavaScript only got usable for most type of games very recently. JavaScript in HTML5 nowadays offers:

  • performance gains dune to compilation into native code
  • 2D and 3D canvas
  • native Video And Audio support

But those things are provided by flash for a decade.

\$\endgroup\$
3
  • \$\begingroup\$ "performance gains dune to compiling", sorry but, javascript is not a compiled programming language, as3 is. Although some javascript implementations use JIT compilers. \$\endgroup\$
    – user4248
    May 12, 2011 at 13:33
  • 1
    \$\begingroup\$ The concept of "compiled programming language" is strange. Any programming language can be compiled into another language. That AS3 is typically compiled before deployment into some other language does not offer any significant performance gain because that is not machine code. \$\endgroup\$ May 13, 2011 at 13:54
  • \$\begingroup\$ "Native audio support" is barely there. The fact that SoundManager 2 has to embed a tiny flash stage as a backup audio engine is evidence enough for me that HTML5 is not ready to be a reliable platform for game development. \$\endgroup\$ Jun 25, 2011 at 12:32
5
\$\begingroup\$

Flash:

Originally developed by Macromedia, Flash was introduced in 1996, and is currently developed and distributed by Adobe Systems,

"Javascript" really means HTML 5, when compared to Flash:

The HTML5 specification was adopted as the starting point of the work of the new HTML working group of the World Wide Web Consortium (W3C) in 2007. This working group published the First Public Working Draft of the specification on January 22, 2008

(Emphasis added.)

\$\endgroup\$
2
  • 1
    \$\begingroup\$ I would disagree that "JavaScript really means HTML5". I think that is backwards. I believe that HTML5 really means the combination JavaScript, HTML, and CSS. \$\endgroup\$
    – Adam Harte
    Apr 12, 2011 at 21:23
  • 1
    \$\begingroup\$ Exactly. When someone compares Javascript to Flash, they are really comparing HTML5 to Flash (which as you say, is comparing {JS, HTML, CSS, maybe WebGL, etc.} to Flash). \$\endgroup\$
    – user744
    Apr 12, 2011 at 21:28
4
\$\begingroup\$

Flash is a more established platform, and people are more used to using it to code games. In my experience, compiled AS3 running in the Flash Player runs much faster than Javascript running in-browser, and it offers easier access to things like sound and embedded files. Flash apps can also be encapsulated in a single .SWF file, while HTML5 apps written using Javascript tend to have a more complicated distribution method, since assets, scripts, and pages usually need to be separate files.

It's not entirely a fair comparison; Flash is compiled (to an extent), while Javascript is at best just-in-time-compiled for most web applications.

\$\endgroup\$
3
\$\begingroup\$

The semantic quibble Gregory made in his comment gets at the root of the issue here. Flash is a very established gaming platform because of the combination of ActionScript 3 and a host of powerful multimedia capabilities. While JavaScript was always just as good of a language, only recently has it been coupled with the powerful multimedia capabilities of HTML5.

As others are pointing out, you can compare ActionScript to JavaScript, and you can compare Flash to HTML 5, but comparing Flash to JavaScript is like saying "Which is better, Linux or C#?"

\$\endgroup\$
1
  • \$\begingroup\$ C# definitely, I wouldn't want to give up using C#, and with linux I would have to, well XNA C# that is. \$\endgroup\$ May 18, 2011 at 3:22
2
\$\begingroup\$

I think this is a lot to do with tooling and marketing.

Most people back in the early AS2 and even AS1 days of Flash, were introduced via the Flash IDE. This was a great tool, were you could draw or import graphics, and add scripts very easily to get things happening very quickly. Macromedia (now Adobe) owes a lot of it popularity to this easy, graphics based entry point. There was not really much else out there that was even close (well, besides Director. Which I still love btw).

So Flash became a popular game creation tool before ActionScript was popular. ActionScript just provided a way to add the interactivity. The IDE is what really made it popular.

Things are different these days, at the platform has matured into many different part. It is now quite common to make Flash games without even touching the Flash IDE.

\$\endgroup\$
1
\$\begingroup\$

The biggest reason is because ActionScript contends only with the version of Flash you're using. You can reach a wide audience fairly quick with ActionScript in Flash because of the market penetration of some of the most recent versions of Flash (the adoption rate is quick). Now think about JavaScript; it is not a single implementation of ECMAScript, but several interpretations of the ECMAScript standard, which all depend not only on the browser, but browser version. Adoption rate for the updated browsers for a general audience (think IE) is very slow. It just makes more sense to choose Flash (or even Java) because it is more portable.

\$\endgroup\$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .