Forums

ForumsProgramming Forum

Creating save files using AS2

Posted Oct 11, '12 at 2:37am

nosajimiki

nosajimiki

12 posts

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?

 

Posted Oct 13, '12 at 3:56pm

Salvidian

Salvidian

3,950 posts

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

;)

Hope that helps!

 

Posted Nov 9, '12 at 4:16pm

nosajimiki

nosajimiki

12 posts

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();
    //

 

Posted Nov 9, '12 at 4:18pm

nosajimiki

nosajimiki

12 posts

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

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();
    //

 

Posted Nov 11, '12 at 7:03pm

arobegamr

arobegamr

120 posts

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.

 
Reply to Creating save files using AS2

You must be logged in to post a reply!