
584
ActionScript classes
FileReferenceList
(flash.net.FileReferenceList)
Object
|
+-flash.net.FileReferenceList
public class
FileReferenceList
extends Object
The FileReferenceList class provides a means to let users select one or more files for uploading.
A FileReferenceList object represents a group of one or more local files on the user's disk as an
array of FileReference objects. For detailed information and important considerations about
FileReference objects and the FileReference class, which you use with FileReferenceList, see
the FileReference class.
To work with the FileReferenceList class:
■
Instantiate the class:
var myFileRef = new FileReferenceList();
■
Call
FileReferenceList.browse()
, to display a dialog box in which the user can select
one or more files to upload:
myFileRef.browse();
■
After
browse()
is successfully called, the
fileList
property of the FileReferenceList
object is populated with an array of FileReference objects.
■
Call
FileReference.upload()
on each element in the
fileList
array.
The FileReferenceList class includes a
browse()
method and a
fileList
property for
working with multiple files.
Availability:
ActionScript 1.0; Flash Player 8
Example
The following example allows a user to select multiple files and then uploads each of them to
a server.
import flash.net.FileReferenceList;
import flash.net.FileReference;
var listener:Object = new Object();
listener.onSelect = function(fileRefList:FileReferenceList) {
trace("onSelect");
var list:Array = fileRefList.fileList;
var item:FileReference;
for(var i:Number = 0; i < list.length; i++) {
item = list[i];
trace("name: " + item.name);
Содержание FLASH 8-ACTIONSCRIPT 2.0 LANGUAGE
Страница 1: ...ActionScript 2 0 Language Reference ...
Страница 1352: ...1352 ActionScript classes ...