Writing data into a text file in Adobe Flex

允我心安 提交于 2019-12-11 01:07:39

问题


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.


回答1:


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/




回答2:


You cannot write to files in Flash, but you can if it's an AIR app. Review the File class in Adobe livedocs.




回答3:


Since Flash Player 10 you can use the FileReference.save() method.




回答4:


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.



来源:https://stackoverflow.com/questions/3179288/writing-data-into-a-text-file-in-adobe-flex

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!