10/10/2012 12:32:59 AM
Title:
flash adobe air open exe file error
i am using flash cs6..
i cant open external exe file
and this is my.. code..
import flash.filesystem.*;
var nativeProcessStartupInfo = new NativeProcessStartupInfo();
var file = File.applicationDirectory.resolvePath("test.exe");
nativeProcessStartupInfo.executable = file;
var processArgs = new Vector["<String>"]();
processArgs.push("hello");
nativeProcessStartupInfo.arguments = processArgs;
var process = new NativeProcess();
process.addEventListener(ProgressEvent.STANDARD_OUTPUT_DATA, onOutputData);
process.start(nativeProcessStartupInfo);
function onOutputData(event):void
{
//var stdOut = process.standardOutput;
// var data = stdOut.readUTFBytes(process.standardOutput.bytesAvailable);
//trace("Got: ", data);
}
12/8/2012 8:25:31 AM
it cannot work directly , you need to create native executable that will launch the air application and then AIR can tell the Native application to execute any other file. See these links may help you understand this better
http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/desktop/NativeProcess.html
http://stackoverflow.com/questions/672021/adobe-air-to-execute-program
http://stackoverflow.com/questions/7478322/why-is-air-nativeprocess-not-supported