2013-03-04 8 views
0

我正在處理需要從文件系統中獲取圖像的AIR應用程序。它根據預先加載的配置文件確定映像的路徑。空氣在MAC返回文件未找到

問題是,在Windows上,它工作得很好。但在MAC上,我收到#2035錯誤,找不到文件。

這裏是我使用加載圖像的代碼:

var L:Loader = new Loader(); 
     L.contentLoaderInfo.addEventListener(Event.COMPLETE, onImageLoaded); 
     L.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, onLoadError); 
     L.load(new URLRequest(File.desktopDirectory.resolvePath(this.asset_path + [email protected]_name).nativePath)); 

根據該客戶端的錯誤消息被顯示的路徑是正確的:「/用戶/拉克倫/桌面/釋放/圖像/aisle_1.jpg'

在這種情況下,我應該嘗試使用其他方式來訪問文件嗎?

回答

0

你應該嘗試使用File類的代替的nativePath的url財產。

在通常的Mac需要文件協議acccess文件等file:///

L.load(new URLRequest(File.desktopDirectory.resolvePath(this.asset_path + [email protected]_name).url)); 
相關問題