Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What are some good ways to Save/Load files in AS3?

I am writing a game in ActionScript3 using Flixel as a base. I have been unable to find a good method for saving and loading files from the player's local hard drive. I know Flixel has a way to save game data to...I think...cookies that the player doesn't really have access to, and I want to avoid this.

I first learned programming in Java, and one thing I've seen a lot of is scanning (Scanner) and printing (PrintWriter) lines of strings to/from text files. Something like this for AS3 would be my ideal, but if there are other methods I'm open.

Does AS3 have anything in its basic library that can do this task well? Are there libraries I can download and include that do this well/better?

like image 707
Martin Avatar asked Nov 27 '25 13:11

Martin


1 Answers

If your game is going to run on a webpage your options are limited. Due to security concerns Flash is limited to reading and writing files specifically selected by the user.

Should you be using Air to make a standalone game, you will have regular access to the filesystem and can write files much like with Java.

If not, you will be pretty much stuck with Flash cookie equivalent, SharedObject.

like image 168
grapefrukt Avatar answered Dec 02 '25 05:12

grapefrukt