Skip to content

Instantly share code, notes, and snippets.

@ericsk
Created April 24, 2009 03:55
Show Gist options
  • Save ericsk/100924 to your computer and use it in GitHub Desktop.
Save ericsk/100924 to your computer and use it in GitHub Desktop.
<mx:Script>
<![CDATA[
import flash.net.FileFilter;
import flash.net.FileReferenceList;
import mx.collections.ArrayCollection;
[Bindable]
private var uploadPhotos:ArrayCollection;
private var fileTypes:FileFilter = new FileFilter("Images (*.jpg, *.jpeg, *.gif, *.png)", "*.jpg;*.jpeg;*.gif;*.png");
private function addPhotos(): void {
var fileRefList:FileReferenceList = new FileReferenceList();
fileRefList.addEventListener(Event.SELECT, onSelect);
fileRefList.addEventListener(Event.CANCEL, onCancel);
fileRefList.browse([fileTypes]);
}
private function onSelect(event:Event):void {
trace('!!');
}
private function onCancel(event:Event):void {
trace('onCancel');
}
]]>
</mx:Script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment