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.
You are not logged in. Please login or register.
chumbysphere forum → Software → 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.
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.
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?
chumbysphere forum → Software → Actionscript calling python?
Powered by PunBB, supported by Informer Technologies, Inc.