Is there a way to make a call to the command line, (On Debian) from ActionScript in Adobe Flash? For example, execute files:
python update.py
Steps for this on Windows would also be appreciated!
Is there a way to make a call to the command line, (On Debian) from ActionScript in Adobe Flash? For example, execute files:
python update.py
Steps for this on Windows would also be appreciated!
If you are using Adobe Air version 2.0.x on Linux, you can use the NativeProcess() class (assuming your update.py is flagged as executable (a+x):
var nativeProcessStartupInfo:NativeProcessStartupInfo = new NativeProcessStartupInfo();
var file:File = File.applicationDirectory.resolvePath("update.py");
nativeProcessStartupInfo.executable = file;
var processArgs:Vector.<String> = new Vector.<String>();
processArgs.push("AnUpdateArgument");
nativeProcessStartupInfo.arguments = processArgs;
process = new NativeProcess();
process.addEventListener(ProgressEvent.STANDARD_OUTPUT_DATA, onOutputData);
process.start(nativeProcessStartupInfo);
public function onOutputData(event:ProgressEvent):void
{
var stdOut:ByteArray = process.standardOutput;
var data:String = stdOut.readUTFBytes(process.standardOutput.bytesAvailable);
trace("Got: ", data);
}
Communicating with native processes in AIR
Note: You can not do this via a browser based SWF
OK.
I see I can substitute the value of the file variable for what ever I need executed.That's fine if I want to execute that file. What about a simple command like cd MyDir
or mkdir ThisAndThat
Just plain old passes to the shell will be great. I am also using GNU Gnash with an SFW.