ForumsProgramming ForumCreating save files using AS2

4 7580
nosajimiki
offline
nosajimiki
12 posts
Nomad

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?

  • 4 Replies
Salvidian
offline
Salvidian
4,170 posts
Farmer

I'm not entirely sure because I don't use AS2, but I did find several different search results that might help you.

sj=1&ei=Hcd5UPzsBaHLyAGD9YGIDQ&ved=0CBsQvwUoAA&bav=on.2,or.r_gc.r_pw.r_qf.&fp=1bf5dd3d33e5ab69&bpcl=35277026&biw=1280&bih=709">

Hope that helps!

nosajimiki
offline
nosajimiki
12 posts
Nomad

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.

function restart(){
_root.saveData.clear();
//

nosajimiki
offline
nosajimiki
12 posts
Nomad

*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.

function restart(){
_root.saveData.clear();
//

arobegamr
offline
arobegamr
130 posts
Nomad

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.

Showing 1-4 of 4