0
저는 flex air 어플리케이션 (Windows 7 OS 사용)을 개발 중입니다. 버튼을 클릭 할 때 내 Windows 사운드 레코더 소프트웨어 (액세서리 섹션에 있음)를 열고 싶습니다. 많이 시도했습니다. 그러나 얻지는 못했습니다.이 방법을 가능하게하는 방법이 있습니까?버튼을 클릭하면 사운드 레코더가 열립니다.
저는 flex air 어플리케이션 (Windows 7 OS 사용)을 개발 중입니다. 버튼을 클릭 할 때 내 Windows 사운드 레코더 소프트웨어 (액세서리 섹션에 있음)를 열고 싶습니다. 많이 시도했습니다. 그러나 얻지는 못했습니다.이 방법을 가능하게하는 방법이 있습니까?버튼을 클릭하면 사운드 레코더가 열립니다.
NativeProcess
을 사용해야합니다. http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/desktop/NativeProcess.html을 살펴보고 예제 코드를 확인하십시오.
필요에 따라 링크 된 예제 코드를 수정, 전체 코드는 NativeProcess
가 지원되는지 확인하고있을 것 같은 녹음기를 실행하려면 : 도움이
package
{
import flash.display.Sprite;
import flash.desktop.NativeProcess;
import flash.desktop.NativeProcessStartupInfo;
import flash.events.Event;
import flash.events.ProgressEvent;
import flash.events.IOErrorEvent;
import flash.events.NativeProcessExitEvent;
import flash.filesystem.File;
public class NativeProcessExample extends Sprite
{
public var process:NativeProcess;
public function NativeProcessExample()
{
if(NativeProcess.isSupported)
{
setupAndLaunch();
}
else
{
trace("NativeProcess not supported.");
}
}
public function setupAndLaunch():void
{
var nativeProcessStartupInfo:NativeProcessStartupInfo = new NativeProcessStartupInfo();
var file:File = File.applicationDirectory.resolvePath("%SystemRoot%\system32\SoundRecorder.exe");
nativeProcessStartupInfo.executable = file;
var processArgs:Vector.<String> = new Vector.<String>();
processArgs[0] = "foo";
nativeProcessStartupInfo.arguments = processArgs;
process = new NativeProcess();
process.start(nativeProcessStartupInfo);
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);
}
public function onOutputData(event:ProgressEvent):void
{
trace("Got: ", process.standardOutput.readUTFBytes(process.standardOutput.bytesAvailable));
}
public function onErrorData(event:ProgressEvent):void
{
trace("ERROR -", process.standardError.readUTFBytes(process.standardError.bytesAvailable));
}
public function onExit(event:NativeProcessExitEvent):void
{
trace("Process exited with ", event.exitCode);
}
public function onIOError(event:IOErrorEvent):void
{
trace(event.toString());
}
}
}
희망을.