class flixel.util.FlxSave

Available on all platforms

A class to help automate and simplify save game functionality. * Basicaly a wrapper for the Flash SharedObject thing, but * handles some annoying storage request stuff too.

Instance Fields

var data:Dynamic

Allows you to directly access the data container in the local shared object.

var name:String

The name of the local shared object.

function new():Void

Blanks out the containers.

function bind(Name:String):Bool

Automatically creates or reconnects to locally saved data. * *

Name

The name of the object (should be the same each time to access old data). *

returns

Whether or not you successfully connected to the save data.

function close(?MinFileSize:Int = 0, ?OnComplete:Bool ->Void = null):Bool

A way to safely call flush() and destroy() on your save file. * Will correctly handle storage size popups and all that good stuff. * If you don't want to save your changes first, just call destroy() instead. * *

MinFileSize

If you need X amount of space for your save, specify it here. *

OnComplete

This callback will be triggered when the data is written successfully. *

returns

The result of result of the flush() call (see below for more details).

function destroy():Void

Clean up memory.

function erase():Bool

Erases everything stored in the local shared object. * Data is immediately erased and the object is saved that way, * so use with caution! * *

returns

Returns false if the save object is not bound yet.

function flush(?MinFileSize:Int = 0, ?OnComplete:Bool ->Void = null):Bool

Writes the local shared object to disk immediately. Leaves the object open in memory. * *

MinFileSize

If you need X amount of space for your save, specify it here. *

OnComplete

This callback will be triggered when the data is written successfully. *

returns

Whether or not the data was written immediately. False could be an error OR a storage request popup.