Available on all platforms
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 the
FileReferenceList.browse()method, which opens a dialog box that lets the user select one or more files for upload:
- After the
browse()method is called successfully, the
fileListproperty of the FileReferenceList object is populated with an array of FileReference objects.
FileReference.upload()on each element in the
The FileReferenceList class includes a
browse() method and a
property for working with multiple files. While a call to
FileReferenceList.browse() is executing, SWF file playback pauses in
stand-alone and external versions of Flash Player and in AIR for Linux and
Mac OS X 10.1 and earlier.
Dispatched when the user dismisses the file-browsing dialog
box. (This dialog box opens when you call the
Dispatched when the user selects one or more files to upload
from the file-browsing dialog box. (This dialog box opens
when you call the
Creates a new FileReferenceList object. A FileReferenceList object
contains nothing until you call the
browse() method on it and the
user selects one or more files. When you call
browse() on the
FileReference object, the
fileList property of the object is
populated with an array of
An array of
FileReferenceList.browse() method is called and the user
has selected one or more files from the dialog box that the
method opens, this property is populated with an array of
FileReference objects, each of which represents the files the user
selected. You can then use this array to upload each file with the
FileReference.upload()method. You must upload one file at a time.
fileList property is populated anew each time browse() is called
on that FileReferenceList object.
The properties of
FileReference objects are described in the
FileReference class documentation.
Displays a file-browsing dialog box that lets the user select one or more local files to upload. The dialog box is native to the user's operating system. In Flash Player 10 and later, you can call this method successfully only in response to a user event (for example, in an event handler for a mouse click or keypress event). Otherwise, calling this method results in Flash Player throwing an Error.
When you call this method and the user successfully selects files, the
fileList property of this FileReferenceList object is populated with
an array of FileReference objects, one for each file that the user
selects. Each subsequent time that the FileReferenceList.browse()
method is called, the
FileReferenceList.fileList property is reset
to the file(s) that the user selects in the dialog box.
typeFilter parameter, you can determine which files the
dialog box displays.
FileReferenceList.browse() session can be performed at a time on a
FileReferenceList object (because only one dialog box can be opened at
true if the parameters are valid and the
file-browsing dialog box opens.
If the method is not called in response to a user action, such as a mouse event or keypress event.
Thrown for the following reasons: 1) Another FileReference or FileReferenceList browse session is in progress; only one file browsing session may be performed at a time. 2) A setting in the user's mms.cfg file prohibits this operation.
Invoked when the user dismisses the dialog box by clicking Cancel or by closing it.
Invoked when the user has successfully selected an item for upload from the dialog box.