请输入您要查询的百科知识:

 

词条 onIOError
释义

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");

随便看

 

百科全书收录4421916条中文百科知识,基本涵盖了大多数领域的百科知识,是一部内容开放、自由的电子版百科全书。

 

Copyright © 2004-2023 Cnenc.net All Rights Reserved
更新时间:2025/3/15 13:19:11