[Flashcoders] Calling native code from Flash

2011-07-19 Thread Gerry Beauregard
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 realize it's possible to read and write local data files from a SWF (using FileReference) or from an AIR app

Re: [Flashcoders] Calling native code from Flash

2011-07-19 Thread Paul Andrews
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

Re: [Flashcoders] Calling native code from Flash

2011-07-19 Thread Gerry Beauregard
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

Re: [Flashcoders] Calling native code from Flash

2011-07-19 Thread Paul Andrews
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

Re: [Flashcoders] Calling native code from Flash

2011-07-19 Thread Paul Andrews
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

Re: [Flashcoders] Calling native code from Flash

2011-07-19 Thread Karl DeSaulniers
Hi Gerry, Can you utilize php as a mediator? Flash-PHP-DLL PHP eg: ?php if (is_file(path/To/yourfile.dll)) { // true; we can proceed //code to execute dll, format and send results to flash here } else { return false; } ? HTH, Best, Karl On Jul 19, 2011, at 3:06 AM,

Re: [Flashcoders] Calling native code from Flash

2011-07-19 Thread Karl DeSaulniers
Or a perl script maybe. Best, Karl On Jul 19, 2011, at 2:46 AM, 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

Re: [Flashcoders] Calling native code from Flash

2011-07-19 Thread Paul Andrews
On 19/07/2011 09:48, Karl DeSaulniers wrote: Hi Gerry, Can you utilize php as a mediator? Flash-PHP-DLL I think there would be a huge latency, which would defeat the purpose. The fastest alternative I know would be an socket server on the same machine as the flash app. The socket server

Re: [Flashcoders] Calling native code from Flash

2011-07-19 Thread Karl DeSaulniers
Hi Paul, Gerry, Are these runtime calls, or calls to set up runtime? How is the swf published? Local? Server? If Local, you could try javascript. Calling the javascript before you need the results in flash. Then que the results so there is no latency, like a buffer? If server, I would go with

Re: [Flashcoders] Calling native code from Flash

2011-07-19 Thread Paul Andrews
On 19/07/2011 10:27, Karl DeSaulniers wrote: Hi Paul, Gerry, Are these runtime calls, or calls to set up runtime? How is the swf published? Local? Server? If Local, you could try javascript. Calling the javascript before you need the results in flash. Then que the results so there is no latency,

Re: [Flashcoders] Calling native code from Flash

2011-07-19 Thread Karl DeSaulniers
Duly noted. I guess I am not understanding the quickness this has to be done. Best, Karl On Jul 19, 2011, at 4:36 AM, Paul Andrews wrote: On 19/07/2011 10:27, Karl DeSaulniers wrote: Hi Paul, Gerry, Are these runtime calls, or calls to set up runtime? How is the swf published? Local?

Re: [Flashcoders] Calling native code from Flash

2011-07-19 Thread Gerry Beauregard
Thank you Paul and Karl for your responses! Interesting discussion! On 2011-07-19 , at 17:36 , Paul Andrews wrote: On 19/07/2011 10:27, Karl DeSaulniers wrote: Hi Paul, Gerry, Are these runtime calls, or calls to set up runtime? How is the swf published? Local? Server? If Local, you could

Re: [Flashcoders] Calling native code from Flash

2011-07-19 Thread Leandro Ferreira
Have you tried Alchemy? http://labs.adobe.com/technologies/alchemy/ * * * @leandroferreira* * 55 61 91151257* On Tue, Jul 19, 2011 at 07:04, Gerry Beauregard gerry.beaureg...@sonoport.com wrote: Thank you Paul and Karl for your responses! Interesting discussion! On 2011-07-19 , at

Re: [Flashcoders] Calling native code from Flash

2011-07-19 Thread Karl DeSaulniers
Don't know if these will help or get you on the right path.. http://help.adobe.com/en_US/as3/dev/ WSb2ba3b1aad8a27b060d22f991220f00ad8a-8000.html http://www.northcode.com/forums/showthread.php?t=8969 http://www.marijnspeelman.nl/blog/category/actionscript-30/ Best, Karl On Jul 19, 2011,

Re: [Flashcoders] Calling native code from Flash

2011-07-19 Thread Karl DeSaulniers
Did a google for run dll with AS3 Best, Karl On Jul 19, 2011, at 5:04 AM, Gerry Beauregard wrote: Thank you Paul and Karl for your responses! Interesting discussion! On 2011-07-19 , at 17:36 , Paul Andrews wrote: On 19/07/2011 10:27, Karl DeSaulniers wrote: Hi Paul, Gerry, Are these

Re: [Flashcoders] Calling native code from Flash

2011-07-19 Thread Amer
mate , just use SWF Studio http://www.northcode.com , it can do even more complex things , read about it and you'll like it . I use it since 2004 and I did many big things with it . *call dll test example in AS3*http://www.northcode.com/forums/showthread.php?t=8969 *Getting Started

Re: [Flashcoders] Calling native code from Flash

2011-07-19 Thread Gerry Beauregard
On 2011-07-19 , at 18:07 , Leandro Ferreira wrote: Have you tried Alchemy? http://labs.adobe.com/technologies/alchemy/ * * * @leandroferreira* * 55 61 91151257* Yes. Alchemy still runs on the ActionScript Virtual Machine, though, so it's not particularly fast. Nowhere near as fast

Re: [Flashcoders] Calling native code from Flash

2011-07-19 Thread Glen Pike
Hi, Having tried the Ogg encoding program someone wrote as a demo, I am inclined to agree - to work around this, I used AIR's Native Process API to launch the oggenc encoder to encode wav files. If the northcode DLL stuff is no good, maybe consider running your DLL in an application

Re: [Flashcoders] Calling native code from Flash

2011-07-19 Thread Henrik Andersson
Embed the flash player in your own native application. Then add stuff to the api using high level magic and there you go, new stuff for actionscript to use. ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com

Re: [Flashcoders] Calling native code from Flash

2011-07-19 Thread David Cohn
Gerry, If you can go with an app, check out Zinc. It offers several system interfaces, including invoking DLLs directly: http://www.multidmedia.com/support/livedocs/ --Dave On Jul 19, 2011, at 9:00 AM, flashcoders-requ...@chattyfig.figleaf.com wrote: Message: 12 Date: Tue, 19 Jul 2011

Re: [Flashcoders] Calling native code from Flash

2011-07-19 Thread Paul Andrews
On 19/07/2011 17:18, David Cohn wrote: Gerry, If you can go with an app, check out Zinc. It offers several system interfaces, including invoking DLLs directly: http://www.multidmedia.com/support/livedocs/ --Dave It attracted some poor comments at one time - I don't know if that has changed.

Re: [Flashcoders] Calling native code from Flash

2011-07-19 Thread Kevin Newman
Or Pixel Bender - I've heard you can do some heavy processing with that too. Additionally, HaXe has some ways to avoid some of the overhead of Alchemy when using it from AS3. You'd have to do a lot in haxe instead of AS3, but you can use the alchemy stuff though inlining, which accesses the

Re: [Flashcoders] Calling native code from Flash

2011-07-19 Thread Gerry Beauregard
Hi Kevin, Thanks for this! Definitely interesting. In my limited testing with Alchemy, I found that getting large amounts of data across the AS3-Alchemy boundary using ByteArrays was indeed a major bottleneck, so anything that eliminates that bottleneck is welcome indeed! -Gerry On

Re: [Flashcoders] Calling native code from Flash

2011-07-19 Thread Karl DeSaulniers
Hi Gerry, Alchemy optimizations. They look like good reads. Hope they are along the lines of what your looking for. http://blog.frankula.com/?p=211 http://philippe.elsass.me/2010/05/as3-fast-memory-access-without- alchemy/ Best, Karl On Jul 19, 2011, at 10:42 PM, Gerry Beauregard wrote:

[Flashcoders] Alchemy still prerelease?

2011-07-19 Thread Gerry Beauregard
Thanks Karl for the excellent links on Alchemy optimizations! Man this stuff is fiddly. If Adobe could just make their AS VM run as fast as the C# one, devs wouldn't need to jump through these hoops! BTW, does anyone know whether is Alchemy still pre-release? The Alchemy page at Adobe Labs...