Package | org.flixel |
Class | public class FlxSave |
Inheritance | FlxSave ![]() |
Property | Defined 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 |
Property | Defined By | ||
---|---|---|---|
_closeRequested : Boolean | FlxSave | ||
ERROR : uint = 2 [static] | FlxSave | ||
_onComplete : Function | FlxSave | ||
PENDING : uint = 1 [static] | FlxSave | ||
_so : SharedObject
The local shared object itself. | FlxSave | ||
SUCCESS : uint = 0 [static] | FlxSave |
Method | Defined By | ||
---|---|---|---|
FlxSave()
Blanks out the containers. | FlxSave | ||
bind(Name:String):Boolean
Automatically creates or reconnects to locally saved data. | FlxSave | ||
close(MinFileSize:uint = 0, OnComplete:Function = null):Boolean
A way to safely call flush() and destroy() on your save file. | FlxSave | ||
destroy():void | FlxSave | ||
erase():Boolean
Erases everything stored in the local shared object. | FlxSave | ||
flush(MinFileSize:uint = 0, OnComplete:Function = null):Boolean
Writes the local shared object to disk immediately. | FlxSave |
Method | Defined By | ||
---|---|---|---|
checkBinding():Boolean | FlxSave | ||
onDone(Result:uint):Boolean | FlxSave | ||
onFlushStatus(event:NetStatusEvent):void | FlxSave |
_closeRequested | property |
protected var _closeRequested:Boolean
_onComplete | property |
protected var _onComplete:Function
_so | property |
protected var _so:SharedObject
The local shared object itself.
The default value is null
.
data | property |
public var data:Object
Allows you to directly access the data container in the local shared object.
The default value is null
.
ERROR | property |
protected static var ERROR:uint = 2
name | property |
public var name:String
The name of the local shared object.
The default value is null
.
PENDING | property |
protected static var PENDING:uint = 1
SUCCESS | property |
protected static var SUCCESS:uint = 0
FlxSave | () | Constructor |
public function FlxSave()
Blanks out the containers.
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).
|
Boolean — Whether or not you successfully connected to the save data.
|
checkBinding | () | method |
protected function checkBinding():Boolean
ReturnsBoolean |
close | () | method |
public function close(MinFileSize:uint = 0, OnComplete:Function = null):Boolean
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.
Parameters
MinFileSize:uint (default = 0 ) — If you need X amount of space for your save, specify it here.
| |
OnComplete:Function (default = null ) — This callback will be triggered when the data is written successfully.
|
Boolean — The result of result of the flush() call (see below for more details).
|
destroy | () | method |
public function destroy():void
erase | () | method |
public function erase():Boolean
Erases everything stored in the local shared object. Data is immediately erased and the object is saved that way, so use with caution!
ReturnsBoolean — Returns false if the save object is not bound yet.
|
flush | () | method |
public function flush(MinFileSize:uint = 0, OnComplete:Function = null):Boolean
Writes the local shared object to disk immediately. Leaves the object open in memory.
Parameters
MinFileSize:uint (default = 0 ) — If you need X amount of space for your save, specify it here.
| |
OnComplete:Function (default = null ) — This callback will be triggered when the data is written successfully.
|
Boolean — Whether or not the data was written immediately. False could be an error OR a storage request popup.
|
onDone | () | method |
protected function onDone(Result:uint):Boolean
Parameters
Result:uint |
Boolean |
onFlushStatus | () | method |
protected function onFlushStatus(event:NetStatusEvent):void
Parameters
event:NetStatusEvent |