基本介紹
- 中文名:事件偵聽器
- 外文名:onIOError
- 說明:上傳用的flash的變數
- 類型:ActionScript 2.0 語言
錯誤提示,類型,主要功能,可用性,參數,示例,英語原文,
錯誤提示
onIOError(FileReference.onIOError 事件偵聽器)
onIOError = function(fileRef:FileReference) {}
這是一個上傳用的flash的變數,很多網友反映G盤出現這個錯誤,多試幾次。
類型
ActionScript 2.0 語言
主要功能
當發生輸入/輸出錯誤時調用。
當上載或下載由於下列任何原因而失敗時調用此偵聽器:
當播放器正在讀取、寫入或傳輸檔案時發生輸入/輸出錯誤。
SWF 檔案嘗試將檔案上載到要求身份驗證(如用戶名和密碼)的伺服器。在上載期間,Flash Player 不提供用戶用於輸入密碼的方法。如果 SWF 檔案嘗試將檔案上載到要求身份驗證的伺服器,則上載會失敗。
SWF 檔案嘗試在獨立或外部播放器中從要求身份驗證的伺服器下載檔案。在下載期間,獨立和外部播放器不提供用戶用於輸入密碼的方法。如果這些播放器中的 SWF 檔案嘗試從要求身份驗證的伺服器下載檔案,則下載會失敗。只有在 ActiveX 控制項和瀏覽器外掛程式播放器中,檔案下載才有可能成功。
傳遞到 upload() 中的 url 參數的值包含無效協定。有效協定包括 HTTP 和 HTTPS。
重要說明:只有在瀏覽器中運行的 Flash 應用程式(也就是說使用瀏覽器外掛程式或 ActiveX 控制項的應用程式)可以提供對話框來提示用戶輸入用戶名和密碼以進行身份驗證,然後只用於下載。對於使用外掛程式或 ActiveX 控制項進行的上載或者使用獨立或外部播放器進行的上載和下載,檔案傳輸會失敗。
可用性
ActionScript 1.0;Flash Player 8
參數
fileRef:flash.net.FileReference - 啟動操作的 FileReference 對象。
示例
下面的示例在觸發 onIOError 事件時跟蹤訊息。為簡單起見,此示例中不包含其它事件偵聽器。
import flash.net.FileReference;
var listener:Object = new Object();
listener.onIOError = function(file:FileReference):Void {
trace("onIOError");
}
var fileRef:FileReference = new FileReference();
fileRef.addListener(listener);
fileRef.download("http://www.macromedia.com/NonExistentFile.pdf", "NonExistentFile.pdf");
英語原文
E文好的可以看看原文
onIOError (FileReference.onIOError event listener)
onIOError = function(fileRef:FileReference) {}
Invoked when an input/output error occurs.
This listener is invoked when the upload or download fails for any of the following reasons:
An input/output error occurs while the player is reading, writing, or transmitting the file.
The SWF file tries to upload a file to a server that requires authentication, such as a user name and password. During upload, Flash Player does not provide a means for users to enter passwords. If a SWF file tries to upload a file to a server that requires authentication, the upload fails.
The SWF file tries to download a file from a server that requires authentication, in the stand-alone or external player. During download, the stand-alone and external players do not provide a means for users to enter passwords. If a SWF file in these players tries to download a file from a server that requires authentication, the download fails. File download can succeed only in the ActiveX control and browser plug-in players.
The value passed to the url parameter in upload() contains an invalid protocol. Valid protocols are HTTP and HTTPS.
Important: Only Flash applications that are running in a browser -- that is, using the browser plug-in or ActiveX control -- can provide a dialog to prompt the user to enter a user name and password for authentication, and then only for downloads. For uploads that use the plug-in or ActiveX control, or that upload and download using either the standalone or external players, the file transfer fails.
Availability: ActionScript 1.0; Flash Player 8
Parameters
fileRef:flash.net.FileReference - The FileReference object that initiated the operation.
Example
The following example traces a message when the onIOError event is triggered. For simplicity, none of the other event listeners are included in this example.
import flash.net.FileReference;
var listener:Object = new Object();
listener.onIOError = function(file:FileReference):Void {
trace("onIOError");
}
var fileRef:FileReference = new FileReference();
fileRef.addListener(listener);
fileRef.download("http://www.macromedia.com/NonExistentFile.pdf", "NonExistentFile.pdf");