I am new to Adobe Flex. I want to write some data stored in a string variable into a 开发者_运维百科text(txt) file. Can some one add sample code here would be helpful for me. Thanks.
You can write to files if you're targetting Flash 10. Read this article to find out how to do it: http://www.mikechambers.com/blog/2008/08/20/reading-and-writing-local-files-in-flash-player-10/
You cannot write to files in Flash, but you can if it's an AIR app. Review the File class in Adobe livedocs.
Since Flash Player 10 you can use the FileReference.save() method.
If you're creating web based apps, the file will have to be created on the server, and you should look for information in that using the technology of your choice. ColdFusion uses the cffile tag, as one example.
FileReference.save will give your user the ability to save a file, but you have limited control in naming or location.
If you're using AIR, you can save information to the local drive using the File class.
精彩评论