Friday, March 27, 2009

Can you write to the file system from flex

Question :Can you write to the file system from flex?
Answer :Yes .
import flash.filesystem.*;
private var stream:FileStream;
private function saveFile():void{
var file:File = File.desktopDirectory.resolvePath("HelloWorld.txt");
var stream:FileStream = new FileStream(), FileMode.WRITE);
var str:String = "Congratulations on your 1st file, Rich Tretola -";
stream.close();"File has been saved to \n" + file.nativePath, "Notice");

No comments: