Actionscript 3 从AIR Flex打开iTunes
我正在尝试从Flex的AIR桌面应用程序启动iTunes应用程序。但是我不能像try-catch循环的catch错误中的代码那样做 下面是我用来从空中打开iTunes的片段:Actionscript 3 从AIR Flex打开iTunes,actionscript-3,apache-flex,air,flex4,itunes,Actionscript 3,Apache Flex,Air,Flex4,Itunes,我正在尝试从Flex的AIR桌面应用程序启动iTunes应用程序。但是我不能像try-catch循环的catch错误中的代码那样做 下面是我用来从空中打开iTunes的片段: try { if(currentOS.indexOf("Windows") >= 0) { prepareFilesForSy
try
{
if(currentOS.indexOf("Windows") >= 0)
{
prepareFilesForSynciOS('Windows');
fileItunes = File.applicationDirectory.resolvePath("C:\\Program Files (x86)\\iTunes\\iTunes.exe");
//fileItunes1 = File.applicationDirectory.resolvePath("C:\Program Files (x86)\iTunes\iTunes.exe");
//Alert.show(" fileItunes " + fileItunes.nativePath);
//Alert.show(" fileItunes1 " + fileItunes1.nativePath);
if(!fileItunes.exists)
{
fileItunes = File.applicationDirectory.resolvePath("C:\\Program Files\\iTunes\\iTunes.exe");
//fileItunes1 = File.applicationDirectory.resolvePath("C:\Program Files (x86)\iTunes\iTunes.exe");
//Alert.show(" fileItunes 64 " + fileItunes.nativePath);
//Alert.show(" fileItunes1 64 " + fileItunes1.nativePath);
}
fileItunes.openWithDefaultApplication();
}
else if(currentOS.indexOf("Mac") >= 0 )
{
prepareFilesForSynciOS('Mac');
fileItunes = File.applicationDirectory.resolvePath("/Applications/iTunes.app");
fileItunes.openWithDefaultApplication();
}
}
catch(e:Error)
{
//Alert.show("iTunes was not found on this Computer.");
navigateToURL( new URLRequest("http://www.apple.com/itunes/download/"));
}
当我对错误消息发出警告时,我得到了TypeError 1009
感谢您的帮助。:)
谢谢,
Ankit.访问空中安全沙箱之外的任何东西都是违法行为。除非ITunes应用程序位于ITunes的沙盒位置,否则无法运行ITunes应用程序
因为空气不能做到这一点,您可能不得不依赖本地扩展IE、C++或任何其他本地应用程序编程(我猜它们已经在某个地方之外)调用iTunes应用程序。使用Air套接字在本机应用程序上调用相同的套接字
请澄清你的问题。什么不起作用?你是说你的异常处理程序被触发了吗?你的NRE在哪一行?在catch块中没有任何东西可以触发NRE,因为警报是静态的。