views:

400

answers:

2

I'm writing a game to be run locally, on the user's computer. NOT over the internet.

I want to have a file that will hold the usernames and avatar indices (they're in an array).

I want to know if there's a way to write to files through Flash with AS3. I'm using CS4.

I'd also like to know if you can delete files through Flash, though that's just optional.

Thanks in advance for any help you can give.

A: 

if i understand what you are trying to do then why dont you use Adobe AIR? this is flash for the desktop

teehoo
A: 

If you want to make a game that runs locally on someone's computer, you should make it in Adobe AIR. AIR apps 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 that it couldn't already do in the browser - it can't write or delete local files, for a start. (It can read local files, but only if you disable it from accessing the network.) Moreover, the standalone Flash player is not generally disseminated, so unless the user is a Flash developer they're just going to view your SWF in a browser anyway (unless you plan to publish projectors, which I also wouldn't recommend).

With all that said, however, even if you do your game as local flash content, you can still store information by using SharedObjects. They work the same way offline as online. You can't write the data out as a separate file, but you can store it between sessions easily enough.

fenomas
I'm not using AIR because I don't know anything about it. I'd need to know things like:Would my users need to download anything to be able to use it?Would *I* need to download anything to be able to use it?Would I be able to program in Flash for it? If so, how do I tell it I want it to be in AIR rather than Flash?
dragonridingsorceress
Well, it's difficult to run down in a comment, but you might like to browse some questions here with the adobe-air tag to get an outline. Generally it's comparable to Flash, except that users install and run the content instead of viewing in a browser. They need to get the AIR runtime if they don't have it, but that can be combined with the step of installing the app. Development is done with the same tools as Flash (from Flash authoring, you set this in the same place you'd change which version of Flash you're publishing for, under File > Publish Settings).
fenomas
Other than that, you might check this out: http://www.adobe.com/products/air/everyone/ And of course if you have other questions, post them here! ;)
fenomas