Adobe Flex Actionscript 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()
stream.open(file, FileMode.WRITE);
var str:String = "Congratulations on your 1st file, Rich Tretola - EverythingFlex.com";
stream.writeUTFBytes(str);
stream.close();
mx.controls.Alert.show("File has been saved to n" + file.nativePath, "Notice");
import flash.filesystem.*;
private var stream:FileStream;
private function saveFile():void{
var file:File = File.desktopDirectory.resolvePath("HelloWorld.txt");
var stream:FileStream = new FileStream()
stream.open(file, FileMode.WRITE);
var str:String = "Congratulations on your 1st file, Rich Tretola - EverythingFlex.com";
stream.writeUTFBytes(str);
stream.close();
mx.controls.Alert.show("File has been saved to n" + file.nativePath, "Notice");
Previous Question | Next Question |
What are the methods called when a UI component is intialized? | What is a drag manager in adobe flex actionscript? |