Save provides simple interface to save and load serialized user data. Data is serialized to String with haxe.Serializer and then stored in text form.

Static methods

@:value({ name : "save" })staticdynamicdelete(name:String = "save"):Void

Deletes save with specified name. Override this method when using custom save lookup. Does not work on flash.

@:value({ checkSum : false, name : "save" })staticload<T>(?defValue:T, name:String = "save", checkSum:Bool = false):T

Loads save with specified name. Returns defValue if save does not exists or could not be unserialized.



Fallback default save value


Name of the save


Set to true if data expected to have crc checksum prepending the data. Should be set for entries saved with checkSum = true.

@:value({ checkSum : false, name : "save" })staticsave(val:Dynamic, name:String = "save", checkSum:Bool = false):Bool

Saves val under the specified name.



When set, save data is prepended by salted crc checksum for data validation. When save is loaded, checkSum flag should be set accordingly.