Adobe Flex Actionscript Question:

Download Job Interview Questions and Answers PDF

Can you write to the file system from flex?

Adobe Flex Actionscript Interview Question
Adobe Flex Actionscript Interview Question

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");

Download Adobe Flex Actionscript Interview Questions And Answers PDF

Previous QuestionNext Question
What are the methods called when a UI component is intialized?What is a drag manager in adobe flex actionscript?