使用NativeProcess,actionscript3转换文件时遇到麻烦

时间:2013-03-05 12:05:15

标签: actionscript-3

我正在尝试制作一个程序来转换ATF纹理中的png文件,但是当我尝试使用NativeProcess时我遇到了一些麻烦......我正在使用带有IntelliJ IDEA的actionscript 3。

我想将该提示命令png2atf -c p -i starling-atf.png -o starling.atf传递给我的NativeProcess ...

所以,我从File().load对象中选择一个png文件,然后我想获取此文件并作为参数发送到我的NativeProcess并通过提示命令进行对话({ {1}})...

有什么想法吗?

1 个答案:

答案 0 :(得分:0)

@puggsoy你写的,问题是空格...我用args放了一些空格,这就是为什么.. 这里是正确的代码:

f.nativePath = "C:/projects/SDK/Adobe Gaming SDK 1.0.1/Utilities/ATF Tools/Windows/png2atf.exe";

    nativeProcessStartupInfo.executable = f;

    // now create the arguments Vector to pass it to the executable file
    var processArgs:Vector.<String> = new Vector.<String>();
    processArgs[0] = "-c";
    processArgs[1] = arg;
    processArgs[2] = "-i";
    processArgs[3] = input;
    processArgs[4] = "-o";
    processArgs[5] = output;
    nativeProcessStartupInfo.arguments = processArgs;
    process = new NativeProcess();
    process.start(nativeProcessStartupInfo);

nativeProcessStartupInfo.executable = f; // now create the arguments Vector to pass it to the executable file var processArgs:Vector.<String> = new Vector.<String>(); processArgs[0] = "-c"; processArgs[1] = arg; processArgs[2] = "-i"; processArgs[3] = input; processArgs[4] = "-o"; processArgs[5] = output; nativeProcessStartupInfo.arguments = processArgs; process = new NativeProcess(); process.start(nativeProcessStartupInfo);