Packageorg.flixel
Classpublic class FlxSave
InheritanceFlxSave Inheritance Object

A class to help automate and simplify save game functionality.



Public Properties
 PropertyDefined By
  data : Object
Allows you to directly access the data container in the local shared object.
FlxSave
  name : String
The name of the local shared object.
FlxSave
Protected Properties
 PropertyDefined By
  _so : SharedObject
The local shared object itself.
FlxSave
Public Methods
 MethodDefined By
  
Blanks out the containers.
FlxSave
  
bind(Name:String):Boolean
Automatically creates or reconnects to locally saved data.
FlxSave
  
erase(MinFileSize:uint = 0):Boolean
Erases everything stored in the local shared object.
FlxSave
  
forceSave(MinFileSize:uint = 0):Boolean
Writes the local shared object to disk immediately.
FlxSave
  
read(FieldName:String):Object
If you don't like to access the data object directly, you can use this to read from it.
FlxSave
  
write(FieldName:String, FieldValue:Object, MinFileSize:uint = 0):Boolean
If you don't like to access the data object directly, you can use this to write to it.
FlxSave
Property Detail
_soproperty
protected var _so:SharedObject

The local shared object itself.

The default value is null.

dataproperty 
public var data:Object

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

The default value is null.

nameproperty 
public var name:String

The name of the local shared object.

The default value is null.

Constructor Detail
FlxSave()Constructor
public function FlxSave()

Blanks out the containers.

Method Detail
bind()method
public function bind(Name:String):Boolean

Automatically creates or reconnects to locally saved data.

Parameters

Name:String — The name of the object (should be the same each time to access old data).

Returns
Boolean — Whether or not you successfully connected to the save data.
erase()method 
public function erase(MinFileSize:uint = 0):Boolean

Erases everything stored in the local shared object.

Parameters

MinFileSize:uint (default = 0) — If you need X amount of space for your save, specify it here.

Returns
Boolean — Whether or not the clear and flush was successful.
forceSave()method 
public function forceSave(MinFileSize:uint = 0):Boolean

Writes the local shared object to disk immediately.

Parameters

MinFileSize:uint (default = 0) — If you need X amount of space for your save, specify it here.

Returns
Boolean — Whether or not the flush was successful.
read()method 
public function read(FieldName:String):Object

If you don't like to access the data object directly, you can use this to read from it.

Parameters

FieldName:String — The name of the data field you want to read

Returns
Object — The value of the data field you are reading (null if it doesn't exist).
write()method 
public function write(FieldName:String, FieldValue:Object, MinFileSize:uint = 0):Boolean

If you don't like to access the data object directly, you can use this to write to it.

Parameters

FieldName:String — The name of the data field you want to create or overwrite.
 
FieldValue:Object — The data you want to store.
 
MinFileSize:uint (default = 0) — If you need X amount of space for your save, specify it here.

Returns
Boolean — Whether or not the write and flush were successful.