ActionScript3 Reference
Class BigDB
Namespace: playerio
Language: ActionScript 3
Provides access to the BigDB service provided by Player.IO.
Methods | |||
---|---|---|---|
public |
Creates a new DatabaseObject in the given table with the specified key. If no key is specified, the object will receive an autogenerated id. |
||
public |
Delete a set of DatabaseObjects from a table |
||
public |
Delete a range of DatabaseObjects from a table using an index |
||
public |
Load the DatabaseObject with the given key from the given table. |
||
public |
Loads the DatabaseObjects with the given keys from the given table. |
||
public |
Loads or creates DatabaseObjects with the given keys from the given table. New objects are created if there are no existing objects for the given keys. |
||
public |
Loads the DatabaseObject corresponding to the player from the PlayerObjects table |
||
public |
Loads or creates the DatabaseObject with the given key from the given table. |
||
public |
Load a range of DatabaseObjects from a table using an index |
||
public |
Load a DatabaseObject from a table using the specified index. |
BigDB.createObject
public |
|
Creates a new DatabaseObject in the given table with the specified key. If no key is specified, the object will receive an autogenerated id.
Arguments
table:String | |
The table to create the DatabaseObject in. | |
key:String | |
The key of the newly created DatabaseObject | |
data:Object | |
Initial data of the DatabaseObject passed as an object. | |
callback:Function (Default = null) | |
Function executed when the DatabaseObject has successfully been created. The newly created DatabaseObject is passed to the callback handler: function(o:DatabaseObject):void{...} | |
errorHandler:Function (Default = null) | |
Function executed if an error occurs while creating the DatabaseObject |
BigDB.deleteKeys
public |
|
Delete a set of DatabaseObjects from a table
Arguments
table:String | |
The table to delete the DatabaseObjects from | |
keys:Array | |
The keys of the DatabaseObjects to delete | |
callback:Function (Default = null) | |
Function executed when the DatabaseObjects are successfully deleted. No arguments are passed to the the callback methoh. | |
errorHandler:Function (Default = null) | |
Function executed if an error occurs while deleting the DatabaseObjects |
BigDB.deleteRange
public |
|
Delete a range of DatabaseObjects from a table using an index
Arguments
table:String | |
The table to delete the DatabaseObject from | |
index:String | |
The name of the index to query for the DatabaseObjects to delete | |
path:Array | |
Where in the index to start the range delete: An array of objects of the same types as the index properties, specifying where in the index to start loading DatabaseObjects from. For instance, in the index [Mode,Map,Score] you might use new ["expert","skyland"] as the indexPath and use the start and stop arguments to determine the range of scores you wish to delete. IndexPath can be set to null instead of an empty array. | |
start:Object | |
Where to start the range delete. For instance, if the index is [Mode,Map,Score] and indexPath is ["expert","skyland"], then start defines the minimum score to delete | |
stop:Object | |
Where to stop the range delete. For instance, if the index is [Mode,Map,Score] and indexPath is ["expert","skyland"], then stop defines the maximum score to delete | |
callback:Function (Default = null) | |
Function executed when the DatabaseObjects are successfully deleted. No arguments are passed to the the callback method. | |
errorHandler:Function (Default = null) | |
Function executed if an error occurs while deleting the DatabaseObjects |
BigDB.load
public |
|
Load the DatabaseObject with the given key from the given table.
Arguments
table:String | |
The table to load the DatabaseObject from | |
key:String | |
The key of the DatabaseObject to load | |
callback:Function (Default = null) | |
Function executed when the DatabaseObject is successfully loaded: function(o:DatabaseObject):void{...} | |
errorHandler:Function (Default = null) | |
Function executed if an error occurs while loading the DatabaseObject. |
BigDB.loadKeys
public |
|
Loads the DatabaseObjects with the given keys from the given table.
Arguments
table:String | |
The table to load the DatabaseObject from | |
keys:Array | |
Array of keys to load from the given table | |
callback:Function (Default = null) | |
Function executed when the DatabaseObjects are successfully loaded. An array of DatabaseObjects are passed to the method: function(dbarr:Array):void{...} | |
errorHandler:Function (Default = null) | |
Function executed if an error occurs while loading the DatabaseObjects |
BigDB.loadKeysOrCreate
public |
|
Loads or creates DatabaseObjects with the given keys from the given table. New objects are created if there are no existing objects for the given keys.
Arguments
table:String | |
The table to load the DatabaseObjects from | |
keys:Array | |
They keys of the DatabaseObjects to load | |
callback:Function (Default = null) | |
Function executed when the DatabaseObjects are successfully loaded or created: function(dbarr:Array):void{...} | |
errorHandler:Function (Default = null) | |
Function executed if an error occurs while loading or creating the DatabaseObjects |
BigDB.loadMyPlayerObject
public |
|
Loads the DatabaseObject corresponding to the player from the PlayerObjects table
Arguments
callback:Function (Default = null) | |
Function executed when the object has loaded successfully: function(o:DatabaseObject):void{...} | |
errorHandler:Function (Default = null) | |
Function executed if an error occurs while loading the DatabaseObject |
Example
The following example loads the current players DatabaseObject
BigDB.loadOrCreate
public |
|
Loads or creates the DatabaseObject with the given key from the given table.
Arguments
table:String | |
The table from which to load or create the DatabaseObject | |
key:String | |
The key of the DatabaseObject to load or create | |
callback:Function (Default = null) | |
Function executed when the DatabaseObject is successfully loaded or created: function(o:DatabaseObject):void{...} | |
errorHandler:Function (Default = null) | |
Function executed if an error occurs while loading or creating the DatabaseObject |
BigDB.loadRange
public |
|
Load a range of DatabaseObjects from a table using an index
Arguments
table:String | |
The table to load the DatabaseObjects from | |
index:String | |
The name of the index to query for the DatabaseObjects to load | |
path:Array | |
Where in the index to start the range load: An array of objects of the same types as the index properties, specifying where in the index to start loading DatabaseObjects from. For instance, in the index [Mode,Map,Score] you might use new ["expert","skyland"] as the indexPath and use the start and stop arguments to determine the range of scores you wish to load. IndexPath can be set to null instead of an empty array. | |
start:Object | |
Where to start the range load. For instance, if the index is [Mode,Map,Score] and indexPath is ["expert","skyland"], then start defines the minimum score to load | |
stop:Object | |
Where to stop the range load. For instance, if the index is [Mode,Map,Score] and indexPath is ["expert","skyland"], then stop defines the maximum score to load | |
limit:int | |
callback:Function (Default = null) | |
Function executed when the DatabaseObjects are successfully loaded. function(dbarr:Array):void{...} | |
errorHandler:Function (Default = null) | |
Function executed if an error occurs while loading the DatabaseObjects |
BigDB.loadSingle
public |
|
Load a DatabaseObject from a table using the specified index.
Arguments
table:String | |
The table to load the DatabaseObject from | |
index:String | |
The name of the index to query for the DatabaseObject | |
indexValue:Array | |
An array of objects of the same types as the index properties, specifying which object to load | |
callback:Function (Default = null) | |
Function executed when the DatabaseObject is successfully loaded: function(o:DatabaseObject):void{...} | |
errorHandler:Function (Default = null) | |
Function executed if an error occurs while loading the DatabaseObject |