Convert ActionScript to Javascript

I'm just curious, anyway, to convert ActionScript to Javascript. When I say ActionScript, I mean ActionScript 3. I used google swiffy, but ActionScript 3 is hardly supported. I also heard about Jangara, but that’s not what I want. Even if it's a code comparison! Thank you

+6
source share
3 answers

Javascript and ActionScript (especially AS3) are syntactically similar languages, and both are based on the ECMAScript specification. There are some slight differences in the actual code:

//Actionscript: var a:String = new PlayerName(); //JavaScript: var a = new PlayerName(); 

This is a demonstration that JavaScript does not have explicit variable type declarations, but this is not a real problem.

What you ask for is much broader than syntactic incompatibilities, since JS and AS work with completely different APIs. ActionScript has stages, frames, and other flash files that do not exist in the JavaScript environment. JavaScript - usually works in a browser - is used to manage documents, DOM nodes, and CSS properties.

This means that if you simply perform simple function calls and math (without any dependency on the user or their environment), what your program does simply cannot be transferred to another environment. For example, you cannot specify JavaScript for play() or goToAndStop() because there are no frames for playing, stopping, or transitioning to an HTML document.

Unfortunately, I think you're interested, but the question is almost certainly incorrect. If you have an application built in Flash or any other AS-enabled environment, you probably want to think about porting or rewriting it in a new context.

+3
source

You can take a look at Falcon JS: https://github.com/apache/flex-falcon

+1
source

http://www.gotoandlearn.com/play.php?id=172 Just check it out above. This may be helpful.

0
source

Source: https://habr.com/ru/post/951776/


All Articles