Copy link to clipboard
Copied
How do you get adobe air to save a file inside a folder that's inside the documents folder?
I know how you get adobe air to create a folder inside the documents folder.
import flash.filesystem.*;
// go to documents folder and create a folder caller Test Folder
var dir:File = File.documentsDirectory.resolvePath("Test Folder");
dir.createDirectory();
but I can't figure out how to save text file inside of the folder that was made.
This doesn't work...
// save file to to Arthur Test folder
var string:String = "Text";
var file:File = File.documentsDirectory.resolvePath("myTxtFile.txt");
var stream:FileStream = new FileStream();
stream.open(file, FileMode.WRITE);
stream.writeUTFBytes(string);
stream.close();
it only saves the file inside the documents folder
how do i get it save inside the folder inside the documents folder?
use
var file:File =dir.resolvePath("myTxtFile.txt");
Copy link to clipboard
Copied
use
var file:File =dir.resolvePath("myTxtFile.txt");
Copy link to clipboard
Copied
Thank you!!! It worked!!!
Actually, Thank you TWICE!!!
Thank you for the answer and thank you for the quick reply!
I would have never figured out that was the answer!
Again thank you!!! Now I can finish my project!
Copy link to clipboard
Copied
you're welcome.
Find more inspiration, events, and resources on the new Adobe Community
Explore Now