tags:

views:

28

answers:

2

I want to create a file and write some data (userid) into the file at first run of my application, during the second run all the operation (will go to the next state) based on the file data, is it possible? How to create and write data into file?

+2  A: 

It depends if you're working on a pure-Flex or an AIR project.

  • If you are making an AIR application, you can access local files using the File class (more informations can be found here and here) ;
  • If not, you'll have to use a server-side script (PHP, ColdFusion, JEE...) to do the job, calling it using a HTTPService object for instance.
Zed-K
On a non AIR app, you're gonna need user management and you'd be better off with db tables than plain files.
Amarghosh
Yes, I was talking about a server-side application, but of course it can retrieve/store datas inside either an XML/JSON file or a database.In the case of an AIR project, SQLite might be great and much simplier too for storing user datas.
Zed-K
A: 

If you are not concerned about file's location and max content of file is less than 100 KB then you may make use of Shared Objects in flash.

Nishu