命令行调用中的Adobe Flash [英] Command Line Calls in Adobe Flash
本文介绍了命令行调用中的Adobe Flash的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
有没有一种方法,使一个从ActionScript在Adobe Flash中调用命令行,(在Debian)?例如,执行文件:
Is there a way to make a call to the command line, (On Debian) from ActionScript in Adobe Flash? For example, execute files:
蟒蛇update.py
也将是AP preciated的步骤在Windows操作系统上!
Steps for this on Windows would also be appreciated!
推荐答案
如果您正在使用Adobe AIR的2.0.x版本的Linux,你可以使用的NativeProcess()类(假设你的update.py被标记为可执行文件(一+ X):
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);
}
与AIR 本机进程通信
注:通过基于浏览器的SWF你不能做到这一点。
Note: You can not do this via a browser based SWF
这篇关于命令行调用中的Adobe Flash的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文