FileReferenceList (flash.net.FileReferenceList)
589
■
A list of file type descriptions followed by their Windows file extensions and their
Macintosh file types.
Each element in the array must contain a string that describes the file type; a semicolon-
delimited list of Windows file extensions, with a wildcard (*) character preceding each
extension; and a semicolon-delimited list of Macintosh file types, with a wildcard (*)
character preceding each type. The syntax for each element is as follows:
[{description: "
string describing the first set of file types
",
extension: "
semicolon-delimited list of Windows file extensions
",
macType: "
semicolon-delimited list of Macintosh file types"
}]
Example:
[{description: "Image files", extension: "*.jpg;*.gif;*.png", macType:
"JPEG;jp2_;GIFf;PNGf"}, {description: "Flash Movies", extension:
"*.swf", macType: "SWFL"}]
The two formats are not interchangeable in a single
browse()
call. You must use one or the
other.
The list of extensions is used to filter the files in Windows, depending on the file type the user
selects. It is not actually displayed in the dialog box. To display the file types for users, you
must list the file types in the description string as well as in the extension list. The description
string is displayed in the dialog box in Windows. (It is not used on the Macintosh.) On the
Macintosh, if you supply a list of Macintosh file types, that list is used to filter the files. If you
don't supply a list of Macintosh file types the list of Windows extensions is used.
Returns
Boolean
- Returns
true
if the parameters are valid and the file-browsing dialog box is
displayed. Returns
false
if the dialog box is not displayed, if another browse session is already
in progress, or if you use the
typelist
parameter but fail to provide a description or
extension string in any element in the array.
Example
The following example demonstrates the
browse()
method.
import flash.net.FileReferenceList;
var allTypes:Array = new Array();
var imageTypes:Object = new Object();
imageTypes.description = "Images (*.JPG;*.JPEG;*.JPE;*.GIF;*.PNG;)";
imageTypes.extension = "*.jpg; *.jpeg; *.jpe; *.gif; *.png;";
allTypes.push(imageTypes);
var textTypes:Object = new Object();
textTypes.description = "Text Files (*.TXT;*.RTF;)";
Содержание FLASH 8-ACTIONSCRIPT 2.0 LANGUAGE
Страница 1: ...ActionScript 2 0 Language Reference ...
Страница 1352: ...1352 ActionScript classes ...