Package | org.flixel |
Class | public class FlxSave |
Inheritance | FlxSave Object |
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
Internal tracker for save object close request. | FlxSave | ||
ERROR : uint = 2 [static] | FlxSave | ||
_onComplete : Function
Internal tracker for callback function in case save takes too long. | FlxSave | ||
PENDING : uint = 1 [static] | FlxSave | ||
_sharedObject : 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
Clean up memory. | 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
Handy utility function for checking and warning if the shared object is bound yet or not. | FlxSave | ||
onDone(Result:uint):Boolean
Event handler for special case storage requests. | FlxSave | ||
onFlushStatus(E:NetStatusEvent):void
Event handler for special case storage requests. | FlxSave |
_closeRequested | property |
protected var _closeRequested:Boolean
Internal tracker for save object close request.
_onComplete | property |
protected var _onComplete:Function
Internal tracker for callback function in case save takes too long.
_sharedObject | property |
protected var _sharedObject: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
Handy utility function for checking and warning if the shared object is bound yet or not.
ReturnsBoolean — Whether the shared object was bound yet.
|
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
Clean up memory.
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
Event handler for special case storage requests. Handles logging of errors and calling of callback.
Parameters
Result:uint — One of the result codes (PENDING, ERROR, or SUCCESS).
|
Boolean — Whether the operation was a success or not.
|
onFlushStatus | () | method |
protected function onFlushStatus(E:NetStatusEvent):void
Event handler for special case storage requests.
Parameters
E:NetStatusEvent — Flash net status event.
|