var fileFilter:FileFilter = new FileFilter("Images", "*.png;*.gif;*.jpg");
可以在调用browse( )方法时进行过滤设置:
+展开
-ActionScript
fileReference.browse([fileFilter]);
下面的代码只设置了一个过滤器,还可以一次传入多个过滤器,如:
+展开
-ActionScript
var fileFilter1:FileFilter = new FileFilter("Images", "*.png;*.gif;*.jpg"); var fileFilter2:FileFilter = new FileFilter("Documents", "*.txt;*.doc;*.pdf;*.rtf"); var fileFilter3:FileFilter = new FileFilter("Archives", "*.zip;*.tar;*.hqx"); var fileFilter4:FileFilter = new FileFilter("All", "*.*"); _fileReference.browse([fileFilter1, fileFilter2, fileFilter3, fileFilter4]);