我正在爲Adobe AIR開發應用程序。當我通過ADL運行它時,該應用在Adobe Flash CC上運行良好。當我發佈桌面應用程序並運行它時,出現以下錯誤: VerifyError:錯誤#1014:無法找到類flash.filesystem :: File。Adobe AIR應用程序在ADL上正常工作,但在單次運行時崩潰
這很奇怪,因爲實際上,當我在Adobe Flash之外運行應用程序時,應用程序通過Flash Player運行。
引起該問題的代碼是這樣的:
import flash.filesystem.File;
import flash.filesystem.FileStream;
import flash.filesystem.FileMode;
function saveData(): void {
var pathToFile: String = File.documentsDirectory.resolvePath('test.txt').nativePath;
var someFile: File = new File(pathToFile);
var stream: FileStream = new FileStream();
stream.open(someFile, FileMode.WRITE);
stream.writeUTFBytes(csv);
stream.close();
}
它崩潰的
var pathToFile: String = File.documentsDirectory.resolvePath('test.txt').nativePath;
任何想法?
您在「文件」>「發佈設置」中指定了哪個播放器? – Brian 2014-10-06 17:20:38
它是用於桌面的AIR 15.0.0.249。 ActionScript 3.0 – tim 2014-10-06 22:33:24