Flash CS4 / AS3 Writing local file from local game without saving dialog?
I am writing a game that will run locally on the user's computer. NOT over the Internet.
I want to have a file that will contain usernames and avatars (they are in an array).
I want to know if there is a way to write files via Flash from AS3. I am using CS4.
I would also like to know if it is possible to delete files via Flash, although this is simply not necessary.
Thanks in advance for any help you can give.
a source to share
If you want to make a game that runs locally on someone else's computer, you must make it in Adobe AIR. AIR applications can read and write files, and do all sorts of useful things like show updates in the taskbar, etc. Whereas a simple SWF that you download and run locally can't do anything useful it couldn't do in the browser - it can't write or delete local files to begin with. (It can read local files, but only if you unplug it from network access.) Also, the standalone Flash player is not usually distributed, so unless the user is a Flash developer, it will just view your SWF in the browser anyway (unless you plan on posting projectors which I also don't recommend).
That said, with all that said, even if you're playing as local Flash content, you can still store information using SharedObjects. They work in the same way as online. You cannot write data as a separate file, but you can store it between sessions easily enough.
a source to share