Hoa Nguyen
Hoa Nguyen

Reputation: 14540

How to use library of other languages in Action Script 3?

Is there any way to use the library of other language in Action Script 3 ? For C/C++

I learned that we can use Alchemy: http://labs.adobe.com/technologies/alchemy/

But for other languages (here I mean Ruby or Java), can I use their libs via AS3 ?

Upvotes: 1

Views: 401

Answers (2)

user797257
user797257

Reputation:

Alchemy is a cross-compiler from LLVM to ABC, if the language you are interested in can compile to LLVM, then, in theory, you can compile to ABC. So, Alchemy supports (with some tweaks) also C# or Java (but you will have to spend some time getting them to work together, there's no out of the box solution).

AIR (which is a desktop variant of Flash) can use something called "NativeProcess" which means that granted the operating system can execute the code in the library, then you can do so by creating a new process that calls the function from the library you need.

In AIR, again, there's a new feature called ANE (AIR Native Extensions) - this allows you to bind AIR more tightly to the native code. But, it doesn't need to be native as in object files only, it should be something the underlying system can execute. But I have to confess, I never tried creating any such extension, so my knowledge of it is theoretical.

Upvotes: 2

Adam Harte
Adam Harte

Reputation: 10510

No you can not use Ruby or Java code/libraries in Flash. Alchemy only allows you to use C and C++ libraries. The only way is to port those libraries to ActionScript, or maybe the library you want to use has already been ported to AS3.

It is also possible that there is something similar in AS3. You could ask another question here or on an Flash forum if anyone knows if the library you need has an equivalent in flash.

Upvotes: 0

Related Questions