Humm.. pois estava no caminho,,, valeu. amigo 2009/5/8 Miguel Vaz <[email protected]>
> Estás a utilizar o copyTo de forma errada. > > a forma correcta é: > > origem.copyTo(destino,[true|false]) > > > Tens aqui um exemplo que fiz agora (repara na alteração do filereference > para file no ficheiro de origem e a utilização do copyTo() ): > > > <?xml version="1.0" encoding="utf-8"?> > <mx:WindowedApplication xmlns:mx="http://www.adobe.com/2006/mxml" > layout="absolute"> > <mx:Button x="31" y="49" label="Copia" click="init()"/> > <mx:Script> > <![CDATA[ > import mx.controls.Alert; > import flash.filesystem.File; > import flash.net.FileReference; > import flash.net.FileFilter; > private var sourcefile:File = new File() > private var fileReference:FileReference = new FileReference(); > > private function init():void{ > sourcefile.addEventListener(Event.SELECT, fileSelectedHandler); > try { > var success:Boolean = sourcefile.browse(getTypes()); > } catch (error:Error) { > //erros.text += "\nUnable to browse for files."; > } > > } > > private function fileSelectedHandler(e:Event):void{ > > var newFile:File = File.applicationStorageDirectory; > > newFile= newFile.resolvePath("outradir/"+e.target.name); > sourcefile.copyTo(newFile,true); > > > } > > > private function getTypes():Array { > var allTypes:Array = new Array(getImageTypeFilter()); > return allTypes; > } > > private function getImageTypeFilter():FileFilter { > return new FileFilter("Images (*.jpg, *.jpeg, *.gif, > *.png)", "*.jpg;*.jpeg;*.gif;*.png"); > } > > ]]> > </mx:Script> > > > </mx:WindowedApplication> > > > > > > Miguel Vaz > > > > > -- Michel Melo Imagine Virtual - www.imaginevirtual.com --~--~---------~--~----~------------~-------~--~----~ Recebeu esta mensagem porque está inscrito em Grupo "Mailing List da Comunidade Portuguesa de Rich Internet Applications - www.riapt.org" do Grupos Google. Para enviar mensagens para este grupo, envie um email para [email protected] Para anular a inscrição neste grupo, envie um email para [email protected] Para mais opções, visite este grupo em http://groups.google.com/group/riapt?hl=pt-PT -~----------~----~----~----~------~----~------~--~---
