Topic: Actionscript calling python?

I want to make a widget that is able to call python to send and receive info from a serial port. Can this be done? I found pyamf which looks like it does what I want but I am unable.

Re: Actionscript calling python?

Normally, a widget cannot invoke a local executable, for some pretty obvious security reasons.

However, if you're willing to drop the security on your device, it can be done.

There are two ways - use the "exec://" protocol with an XML object:

var x:XML = new XML();
x.onData = function(data) {
     trace(data);
}
x.load("exec://mycommand");

...or use the "bactick" ASnative extension:

  import com.chumby.ChumbyNative;

  var data:String = ChumbyNative.backtick("mycommand");
  trace(data);

You should always use the first one if the command takes more that a few milliseconds to run.

3 (edited by clay_shooter 2011-02-20 20:20:06)

Re: Actionscript calling python?

Where is the ChumbyNative library?  It seems like FlashDevelop won't compile a program with this call in it unless it can find the libraries.


This thread http://forum.chumby.com/viewtopic.php?id=2280 mentioned that additional ASNative calls might get added. Did that ever happen?

Re: Actionscript calling python?

It's on the wiki.