• About WordPress
    • WordPress.org
    • Documentation
    • Learn WordPress
    • Support
    • Feedback
  • Log In
Skip to content

MonoFlauta

Indie Game Developer

Menu
  • Blog
  • Portfolio
    • Games
      • Happy Ghost Studio
      • Etermax
      • Silky Smooth Studio
      • Fun+Mono
    • Frameworks & Tools
      • Framework Goat
      • Twitch Mono Integration
      • Framework Mono
      • Narwhal Engine
    • Others
  • Store
  • About Me

Framework Mono – Managers/SaveManager.as

The SaveManager.as will help you making save files using cookies. This savefiles will be able to be saved and loaded from this script.


How to use SaveManager.as

In order to use the save manager, first you will have to create an instance of it. To create an instance, you will have to pass as parameter a name for the game. For example you can do the following:

 saveManager = new SaveManager("AwesomeGame");

In this case we are calling the game “AwesomeGame”. Once it is created you will be able to save and load information.

If you want to save information you will have to create a dictionary with all the parameters you want to save. For example:

 var data:Dictionary = new Dictionary();
data["CharacterName"] = "N00b";
data["Lvl"] = 100;
data["Gold"] = -26;
saveManager.save(data);

Here we are creating a dictionary with all the information we need and saving it using the save manager. The file will be named with the name we placed for the game.

Now, if we want to load this information we will have to call the function load and once it is loaded, we will be able to get the information:

 saveManager.load();

First we call the method load, then we get acces to the information, for example, we will trace the character name we saved before:

 trace(saveManager.dataLoaded["CharacterName"]);

In addition, when calling the function load we can listen the event Event.COMPLETE that will be dispatched once the load finishes.


Public Functions

  • save(data:Dictionary):void
  • load():void

Public Vars

  • dataLoaded:Dictionary = new Dictionary();

Private Vars

  • _saver:SharedObject;
  • _gameName:String;

Powered by WordPress MonoFlauta 2025 | All Rights Reserved.

Manage Cookie Consent
To provide the best experiences, we use technologies like cookies to store and/or access device information. Consenting to these technologies will allow us to process data such as browsing behavior or unique IDs on this site. Not consenting or withdrawing consent, may adversely affect certain features and functions.
Functional Always active
The technical storage or access is strictly necessary for the legitimate purpose of enabling the use of a specific service explicitly requested by the subscriber or user, or for the sole purpose of carrying out the transmission of a communication over an electronic communications network.
Preferences
The technical storage or access is necessary for the legitimate purpose of storing preferences that are not requested by the subscriber or user.
Statistics
The technical storage or access that is used exclusively for statistical purposes. The technical storage or access that is used exclusively for anonymous statistical purposes. Without a subpoena, voluntary compliance on the part of your Internet Service Provider, or additional records from a third party, information stored or retrieved for this purpose alone cannot usually be used to identify you.
Marketing
The technical storage or access is required to create user profiles to send advertising, or to track the user on a website or across several websites for similar marketing purposes.
Manage options Manage services Manage {vendor_count} vendors Read more about these purposes
View preferences
{title} {title} {title}