我已经阅读了大多数针对此错误的解决方案,但似乎都没有适用。
我在OS-X上的FlashBuilder中运行一个基本的AS3应用程序。
无论我尝试什么,我都会被告知本机进程是支持,一切运行良好,直到调用start然后出现错误:3219抛出,没有进一步的信息。
所有人都非常感谢!
我在下面提供了我的代码:
package {
import flash.desktop.NativeProcess;
import flash.desktop.NativeProcessStartupInfo;
import flash.display.Sprite;
import flash.errors.IllegalOperationError;
import flash.events.Event;
import flash.events.IOErrorEvent;
import flash.events.NativeProcessExitEvent;
import flash.events.ProgressEvent;
import flash.filesystem.File;
import flash.text.TextField;
public class VauxhallController extends Sprite {
private var debug_txt:TextField;
public var process:NativeProcess;
private var sh:File;
public function VauxhallController() {
if (stage) {
init();
} else {
this.addEventListener(Event.ADDED_TO_STAGE, init);
}
}
private function init($e:Event=null):void {
this.removeEventListener(Event.ADDED_TO_STAGE, init);
build();
if (NativeProcess.isSupported) {
initListeners();
debugMe("Native process supported");
go();
} else {
debugMe("Native not supported");
}
}
private function build():void {
// debug
debug_txt = new TextField();
debug_txt.width = 300;
debug_txt.height= 600;
this.addChild(debug_txt);
}
private function initListeners():void { }
private function go():void {
runShellFile();
}
private function runShellFile():void {
debugMe("runShellFile");
var nativeProcessStartupInfo:NativeProcessStartupInfo = new NativeProcessStartupInfo();
var essArgs:Vector.<String> = new Vector.<String>();
var file:File;
file = File.desktopDirectory.resolvePath("AE/demo.sh");
debugMe("path|"+ File.desktopDirectory.resolvePath("AE/demo.sh").url);
nativeProcessStartupInfo.executable = file;
nativeProcessStartupInfo.workingDirectory = File.desktopDirectory;
nativeProcessStartupInfo.executable = file;
process = new NativeProcess();
process.addEventListener(ProgressEvent.STANDARD_OUTPUT_DATA, onOutputData);
process.addEventListener(ProgressEvent.STANDARD_ERROR_DATA, onErrorData);
process.addEventListener(NativeProcessExitEvent.EXIT, onExit);
process.addEventListener(IOErrorEvent.STANDARD_OUTPUT_IO_ERROR, onIOError);
process.addEventListener(IOErrorEvent.STANDARD_ERROR_IO_ERROR, onIOError);
try {
process.start(nativeProcessStartupInfo);
} catch (error:IllegalOperationError) {
debugMe(error.toString());
} catch (error:ArgumentError) {
debugMe(error.toString());
} catch (error:Error) {
debugMe(error.toString());
}
debugMe("# DONE");
}
public function onOutputData(event:ProgressEvent):void { debugMe("Got: "+ process.standardOutput.readUTFBytes(process.standardOutput.bytesAvailable)); }
public function onErrorData(event:ProgressEvent):void { debugMe("ERROR: "+ process.standardError.readUTFBytes(process.standardError.bytesAvailable)); }
public function onExit(event:NativeProcessExitEvent):void { debugMe("Process exited with: "+ event.exitCode); }
public function onIOError(event:IOErrorEvent):void { debugMe("IOError: "+ event.toString()); }
private function debugMe(_str:String):void { debug_txt.appendText(_str +"\n"); }
}
}
答案 0 :(得分:0)
你读过这篇文章吗? http://www.actionscripterrors.com/?p=2527
<supportedProfiles>extendedDesktop desktop</supportedProfiles>
答案 1 :(得分:0)
我有同样的错误,我的情况是因为我试图在MacOS上打开.exe。验证您的demo.sh脚本是否与.exe文件进行交互。