我正在寻找一个AIR应用程序的示例,它只会加载Firefox。有人可以指出一个可以修改的例子,或者这样做吗?
答案 0 :(得分:1)
<?xml version="1.0" encoding="utf-8"?>
<mx:WindowedApplication xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute">
<mx:Script><![CDATA[
import flash.net.URLRequest;
public function clickButton():void{
var request : URLRequest = new URLRequest('C:\\path to mozilla\firefox.exe');
navigateToURL(request )
}
]]></mx:Script>
<mx:Button click="clickButton()" label="Launch Firefox"/>
</mx:WindowedApplication>
如果不确定位置或mac 使用这样的属性来获取默认文件夹..
var appDir:File = File.applicationDirectory;
var appStoreDir:File= File.applicationStorageDirectory;
var desktopDir:File = File.desktopDirectory;
var docDir:File = File.documentsDirectory;
var userDir:File = File.userDirectory;
var rootDirArr:Array = File.getRootDirectories();