2013-03-05 94 views
0

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

我想传递一个提示命令png2atf -c p -i starling-atf.png -o starling.atf,我的NativeProcess ...

所以,我选择一个png文件,从File().load对象,然后我想利用这个文件并发送作为一个参数我的NativeProcess,并通过提示命令(png2atf -c p -i starling-atf.png -o starling.atf)进行对话....

任何想法?

+0

你说你有麻烦...有什么麻烦?它是否按预期工作,或者你不确定如何通过文件路径作为参数? – puggsoy 2013-03-05 14:52:20

+0

你有什么尝试?我的猜测是,您需要将文件路径传递到'png2atf'命令,就像您在命令提示符中那样。 – 2013-03-05 15:24:41

+0

@Antonie Lassauzay多数民众赞成的问题,我不能通过行命令作为参数... – RafaelFelisbino 2013-03-06 06:13:46

回答

0

@puggsoy妳写的,问题是空间......我把一些空间与指定参数时,这就是为什么.. 这里的正确代码:

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);