Skip to content

Instantly share code, notes, and snippets.

@Inviz
Created March 30, 2009 11:34
Show Gist options
  • Select an option

  • Save Inviz/87752 to your computer and use it in GitHub Desktop.

Select an option

Save Inviz/87752 to your computer and use it in GitHub Desktop.
trace('browse');
var filter:Array = new Array();
if (options.typeFilter is Object){
for (var key:String in options.typeFilter) {
filter.push(new FileFilter(key, options.typeFilter[key]));
}
} else if (options.typeFilter is String) {
var description:String = options.typeFilterDescription || options.typeFilter;
var type:FileFilter = new FileFilter(description, options.typeFilter);
filter.push(type);
}
fireEvent('browse', options.typeFilter);
dialog = (options.multiple) ? new FileReferenceList() : new FileReference();
dialog.addEventListener(Event.SELECT, handleSelect);
dialog.addEventListener(Event.CANCEL, handleCancel);
try {
var success:Boolean = dialog.browse();
} catch (e:Error) {
verboseLog('Exception', e.toString());
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment