PDA

View Full Version : RemoteObject images / flv / mp3 transfer ?



andreiashu
August 29th, 2007, 10:20 AM
Hi there, I'm new to AS3 & Flex and this forum.
Is there a way to call RemoteObjects composed by images, flvs and mp3s from AS3 ?
Thanks

andreiashu
August 29th, 2007, 02:19 PM
oki, i will reply to myself :)
I've found a way to get gifs and jpegs transferred ( eg: http://www.bytearray.org/?p=93 and http://www.bytearray.org/?p=90 ) but couldn't find something useful for sound / flvs though...
If you have any ideas please let me know.

magalini
September 11th, 2007, 01:43 AM
I'm trying in that way:



public function downloadvideo():void {


var request:URLRequest = new URLRequest("http://...home.flv");

var loader:URLLoader = new URLLoader();
loader.addEventListener(Event.COMPLETE, downloadVideoHandler);
try {loader.load(request);}
catch (error:ArgumentError){trace("An ArgumentError has occurred.");}
catch (error:SecurityError){trace("A SecurityError has occurred.");}
}
public function downloadVideoHandler(event:Event):void {
var videoStorage = (event.target.data)

var fsStorage:File = File.applicationStorageDirectory.resolve("prisma.flv");
var fs:FileStream = new FileStream

fs.open(fsStorage, FileMode.WRITE);
fs.writeObject(videostorage);
fs.close();
}





but the output file is unreadable and bigger than the original