protected function button1_clickHandler(event:MouseEvent):void { file = new FileReference(); file.browse([new FileFilter(".jpg .png .gif","*.jpg;*.png;*.gif")]); file.addEventListener(Event.SELECT,selectedHandler); file.addEventListener(Event.COMPLETE,fileCompletehandler); } private function selectedHandler(event:Event):void { trace(file.size,file.name,file.type); file.load(); } private function fileCompletehandler(event:Event):void { uploadImg.source = file.data; } 要求编译的FlashPlayer版本在10以上,否则没有FileReference.load() 和 FileReference.data