Packagemochi.as3
Classpublic class MochiScores
InheritanceMochiScores Inheritance Object



Public Properties
 PropertyDefined By
  onCloseHandler : Object
[static]
MochiScores
  onErrorHandler : Object
[static]
MochiScores
Public Methods
 MethodDefined By
  
[static] Method: closeLeaderboard Closes the leaderboard immediately
MochiScores
  
getPlayerInfo(callbackObj:Object, callbackMethod:Object = null):void
[static] Method: getPlayerInfo Retrieves all persistent player data that has been saved in a SharedObject.
MochiScores
  
onClose(args:Object = null):void
[static]
MochiScores
  
requestList(callbackObj:Object, callbackMethod:Object = null):void
[static] Method: requestList Requests a listing from the server using the current game id and mode.
MochiScores
  
scoresArrayToObjects(scores:Object):Object
[static] Method: scoresArrayToObjects Converts the cols/rows array format retrieved from the server into an array of objects - one object for each row containing key-value pairs.
MochiScores
  
setBoardID(boardID:String):void
[static] Method: setBoardID Sets the name of the mode to use for categorizing submitted and displayed scores.
MochiScores
  
showLeaderboard(options:Object = null):void
[static] Method: showLeaderBoard Displays the leaderboard GUI showing the current top scores.
MochiScores
  
submit(score:Number, name:String, callbackObj:Object = null, callbackMethod:Object = null):void
[static] Method: submit Submits a score to the server using the current id and mode.
MochiScores
Property Detail
onCloseHandlerproperty
public static var onCloseHandler:Object

onErrorHandlerproperty 
public static var onErrorHandler:Object

Method Detail
closeLeaderboard()method
public static function closeLeaderboard():void

Method: closeLeaderboard Closes the leaderboard immediately

getPlayerInfo()method 
public static function getPlayerInfo(callbackObj:Object, callbackMethod:Object = null):void

Method: getPlayerInfo Retrieves all persistent player data that has been saved in a SharedObject. Will send to the callback an object containing key->value pairs contained in the player cookie.

Parameters

callbackObj:Object
 
callbackMethod:Object (default = null)

onClose()method 
public static function onClose(args:Object = null):void

Parameters

args:Object (default = null)

requestList()method 
public static function requestList(callbackObj:Object, callbackMethod:Object = null):void

Method: requestList Requests a listing from the server using the current game id and mode. Returns an array of at most 50 score objects. Will send to the callback an array of objects [{name, score, timestamp}, ...]

Parameters

callbackObj:Object — the object or class instance containing the callback method
 
callbackMethod:Object (default = null) — the string name of the method to call when the score has been sent. default: "onLoad"

scoresArrayToObjects()method 
public static function scoresArrayToObjects(scores:Object):Object

Method: scoresArrayToObjects Converts the cols/rows array format retrieved from the server into an array of objects - one object for each row containing key-value pairs.

Parameters

scores:Object — the scores object received from the server

Returns
Object
setBoardID()method 
public static function setBoardID(boardID:String):void

Method: setBoardID Sets the name of the mode to use for categorizing submitted and displayed scores. The board ID is assigned in the online interface.

Parameters

boardID:String — The unique string name of the mode

showLeaderboard()method 
public static function showLeaderboard(options:Object = null):void

Method: showLeaderBoard Displays the leaderboard GUI showing the current top scores. The callback event is triggered when the leaderboard is closed.

Parameters

options:Object (default = null)

submit()method 
public static function submit(score:Number, name:String, callbackObj:Object = null, callbackMethod:Object = null):void

Method: submit Submits a score to the server using the current id and mode.

Parameters

score:Number — - the string name of the user as entered or defined by MochiBridge.
 
name:String — - the number representing a score. Can be an integer or float. If the score is time, send it in seconds - can be float
 
callbackObj:Object (default = null) — - the object or class instance containing the callback method
 
callbackMethod:Object (default = null) — - the string name of the method to call when the score has been sent