So, I recently started working again on a game I began a few years back. I noticed that savable flash games became popular about the time AS3 came out; but, I was wondering if there is a way to create a saveable game-state using AS2. If so, how do I create and access them?
Since most tutorials on this are confusing, I created this template for others to use. Just copy it into your _root header, and call the functions from your main menu buttons.
var saveData:SharedObject = SharedObject.getLocal("XXsaveFileNameXX" // use a unique file name like "starDustV1B12" so that other games will not overwrite it.
*didn't post right* Since most tutorials on this are confusing, I created this template for others to use. Just copy it into your _root header, and call the functions from your main menu buttons.
[quote] var saveData:SharedObject = SharedObject.getLocal("XXsaveFileNameXX" // use a unique file name like "starDustV1B12" so that other games will not overwrite it.
Other games can't overwrite your save file. Flash separates shared objects by URL, so only an swf file with the same name and location can save to that shared object. The name is only used to distinguish between different save files for that specific swf.