2 waithome waithome 于 2016.02.17 16:50 提问

flash air NativeProcess 相关问题 30C

先附上源码
import flash.desktop.NativeApplication;
import flash.desktop.NativeProcess;
import flash.desktop.NativeProcessStartupInfo;
import flash.filesystem.File;
import flash.events.MouseEvent;

var process:NativeProcess = new NativeProcess;
NativeApplication.nativeApplication.autoExit = true;

var file:File = new File;
file = file.resolvePath("C:/Windows/System32/cmd.exe");

var processArg:Vector. = new Vector.();
processArg.push("/c");
processArg.push("start C:/Windows/System32/osk.exe");

var npsi:NativeProcessStartupInfo = new NativeProcessStartupInfo();
npsi.executable = file;
npsi.arguments = processArg;

stop();

stage.addEventListener(MouseEvent.CLICK, click_handler );

function click_handler( e : MouseEvent ) : void
{
if( process.running )
{
return;
}

process.start(npsi);

}

这段源码在flash编译器里调试运行的时候没有任何问题,点击舞台可以弹出系统软键盘,但是很奇怪的是我发不成exe安装包后,点击安装,然后运行程序,点击应用就调不出软键盘了; Air 3.2,配置文件中 desktop extendedDesktop已添加

1个回答

Mr_dsw
Mr_dsw   Ds   Rxr 2016.02.17 20:26
Csdn user default icon
上传中...
上传图片
插入图片
准确详细的回答,更有利于被提问者采纳,从而获得C币。复制、灌水、广告等回答会被删除,是时候展现真正的技术了!