I should add that one of the reasons it may not be possible, is the possibility of calling malevolent code from flash violating the security sandbox or just code that could crash the flash player/browser itself. I think Adobe will be reluctant to have a feature that risks sandbox security or could compromise the flash player in any way. I don't think Air offers a gateway either, but I may be wrong.

On 19/07/2011 09:06, Paul Andrews wrote:
On 19/07/2011 08:46, Gerry Beauregard wrote:
Hi Paul, thanks for the quick response.

The use case would be to call some CPU-intensive audio signal processing code, most likely written in C++ and packaged as a DLL. The idea is that a SWF (or AIR app) would try to detect the presence of the DLL on the user's machine; if the DLL is present, the SWF (or AIR app) would use the native signal processing functions implemented in it, otherwise it would rely on a simplified lower-quality implementation coded in AS3.
I can't think of any way to do what you want. All the native code workarounds I know of really aren't efficient for real-time calls and the overhead would outweigh the benefit. Be interesting if anyone suggests a method.


-Gerry

On 2011-07-19  , at 15:25 , Paul Andrews wrote:

On 19/07/2011 08:15, Gerry Beauregard wrote:
Hi folks,

Does anyone know whether there's a way to call native code from a Flash SWF or AIR app, for example to call functions in a DLL? Something like Java's JNI but for Flash?
I have never heard of anyone doing that and I know of no direct mechanism to do so.

What is your use-case?


I realize it's possible to read and write local data files from a SWF (using FileReference) or from an AIR app (using the File class), but that's reading and writing data, not running code. I also know it's possible to run C code compiled using Alchemy - but that's not really native code, as Alchemy-compiled code isn't native code, but rather byte-code that runs on the ActionScript VM.

-Gerry
_______________________________________________
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

_______________________________________________
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

_______________________________________________
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


_______________________________________________
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


_______________________________________________
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Reply via email to