Comunidad de diseño web y desarrollo en internet online

cargar y salvar imagenes en flex

Citar            
MensajeEscrito el 18 Oct 2012 03:48 pm
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="library:adobe/flex/halo"
xmlns="http://ns.adobe.com/mxml/2009
xmlns:ns= library:adobe/flex/gumbo xmlns:local="*"
backgroundColor="0xFFFFFF">
<Script>
<![CDATA[
private var fileReference:FileReference =
new FileReference();

private function onSave():void
{
//Instantiate on downloading otherwise you will get an error
fileReference = new FileReference();
fileReference.save(myTextArea.text,"myExample.txt");

}
private function onLoad():void
{
//Instantiate on loading
fileReference = new FileReference();
//create the filter which will be just uploading the txt
var myFilter:FileFilter = new FileFilter("Text","*.txt");
fileReference.browse([myFilter]);
fileReference.addEventListener(Event.SELECT,onFileSelect);
fileReference.addEventListener(Event.COMPLETE,onFileComplete);

}
private function onFileSelect(event:Event):void
{
fileReference.load();
}
private function onFileComplete(event:Event):void
{

myTextArea.text =
fileReference.data.readUTFBytes(fileReference.data.length);

}
]]>
</Script>

<mx:Panel id="myPanel" width="500" height="500">
<ns:TextArea width="450" height="450" id="myTextArea"/>
<mx:ControlBar>
<mx:Button label="Save" click="onSave()"/>
<mx:Button label="Load" click="onLoad()"/>
</mx:ControlBar>
</mx:Panel>
</mx:Application>

encontre ese codigo q aplica para archivos txt lo trato de modificar para imagenes , cambiando el txt por jpg y ps eliminando el texarea.. enfin, lo que sucede es que al salvar las imagenes en el equipo, las guarda con el formato supuestamente correcto ,pero no las deja abrir, quedan inutilizables, alguna idea de como modificar bien este codigo?

Por dmentex

10 de clabLevel



 

firefox
Citar            
MensajeEscrito el 20 Oct 2012 08:03 pm
¿Es una aplicación local o de Internet... es decir el upload sería a un servidor?

Jorge

Por solisarg

BOFH

13669 de clabLevel

4 tutoriales
5 articulos

Genero:Masculino   Bastard Operators From Hell Premio_Secretos

Argentina

firefox
Citar            
MensajeEscrito el 26 Oct 2012 08:09 pm
local

Por dmentex

10 de clabLevel



 

firefox

 

Cristalab BabyBlue v4 + V4 © 2011 Cristalab
Powered by ClabEngines v4, HTML5, love and ponies.