Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

ActionScript VS JavaScript

Explorer ,
Mar 14, 2017 Mar 14, 2017

Thank you for your attention. Would you please describe all the pros and cons of using AS and JS? And in which cases it's more sensible to use each of them? Thank you!

2.0K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Mar 14, 2017 Mar 14, 2017

actionscript in an as3 project is much more powerful than javascript.

but as3 projects can't viewed by all (most notably mobile) browsers.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Mar 14, 2017 Mar 14, 2017

So, if I want to be sure my animation plays on every device and browser I need to use JavaScript, right?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Mar 14, 2017 Mar 14, 2017

If it is just an animation there wouldn't be any code in it. You would have the option to make the animation in one format and convert it to the other one. If you started with AS3 you would need to be careful not to rely on features that don't exist in HTML5 Canvas. By having two versions you could give desktop users a better experience by showing the SWF, and for mobile browser users you would show them the Canvas version.

One big problem that can come up is synchronizing the sound and animation. In AS3 that is easy, you can set the sound sync to Stream, and the two will keep together on all devices. With Canvas you can't do that. There are code solutions to the problem, or you could just make your animation less demanding, so that it keeps up with the sound.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Mar 14, 2017 Mar 14, 2017
LATEST

if you want your project to be viewable by the max number of browsers (including mobiles), you can't use actionscript/as3.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Mar 14, 2017 Mar 14, 2017

Usually it isn't a matter of pros and cons, it's that you don't have a choice. These are examples where you must use AS3:

Making SWFs for desktop browsers.

Creating an iOS app.

Creating an Android app.

Creating an AIR desktop app.

For any animation that is going be exported as video, AS3 documents give you more filter effects.

And some possible times you would have to use Javascript:

For some reason your IT department refuse to allow Flash Player to be installed.

What you are making has to be viewable in mobile browsers, or in a web view inside a mobile app.

If you really had a free choice of which one to use, you would only choose Javascript if you didn't know ActionScript and didn't have the time to learn it.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines