.flash filename="file.swf" bbox=420x440 version=9 fps=12 background=#666666 .edittext log width=500 height=180 color=black multiline html border # http://jeanmichel.gens.free.fr .box b_idle width=67 height=18 color=#222222 fill=#CCCCCC line=1 .edittext live_e width=45 height=18 border text="Images" color=black .button live_b .show live_e as=idle .show live_e as=hover x=1 y=1 .end .put live_b x=210 y=3 .put log x=0 y=23 .action: package { import flash.display.* import flash.text.* ; import flash.net.* ; import flash.media.*; import flash.errors.*; import flash.events.* ; public dynamic class Main extends MovieClip { private var fr :FileReference; private var ff :FileFilter ; private function trace (s:String) { this.log.text+=s+"\n"; } private function onSelect(e) { fr.upload(fr.name); trace(fr.name ); } public function Main() { //this.log.backgroundColor=0xffcc44; fr=new FileReference(); fr.addEventListener(Event.SELECT,onSelect); ff=new FileFilter("Images","*.jpg;*.gif;*.png"); this.live_b.addEventListener(MouseEvent.MOUSE_DOWN,clic); trace("ok"); } private function clic(e){ try { fr.browse([ff]); } catch (op:IllegalOperationError) { trace(op); } } } } .end # action .end # .flash