Packagenet.flashplusplus.Snapdragon.GameCenter
Classpublic class SDGameCenterManager
InheritanceSDGameCenterManager Inheritance flash.events.EventDispatcher



Public Methods
 MethodDefined By
  
SDGameCenterManager(namespace:Namespace)
Constructor of SDGameCenter singleton class.
SDGameCenterManager
  
Get the achievement progress of the local player from the iOS Game Center.
SDGameCenterManager
  
Authenticates local player.
SDGameCenterManager
  
getInstance(nameSpace:Namespace):SDGameCenterManager
[static] Function to get SDGameCenterManager instance.
SDGameCenterManager
  
Get local player object.
SDGameCenterManager
  
isAuthenticated():Boolean
Checking if the local player is authenticated.
SDGameCenterManager
  
Checking if the actual device running the application is capable of using the iOS Game Center.
SDGameCenterManager
  
Get the existing leadeboards from the iOS Game Center.
SDGameCenterManager
  
leaderboardScoreRequest(category:String, timeScope:String, playerScope:String, start:int, length:int):void
Get the scores of a specific leadeboard from the iOS Game Center.
SDGameCenterManager
  
reportScoreForLeaderboard(category:String, score:int):void
Reporting score for a specific leaderboard.
SDGameCenterManager
  
Clears achievement progress data of the local player.
SDGameCenterManager
  
Shows the native iOS Game Center view of achievements.
SDGameCenterManager
  
showLeaderboard(category:String, timeScope:String):void
Shows the native iOS Game Center view of leaderboards.
SDGameCenterManager
  
submitAchievement(identifier:String, progress:Number, showBanner:Boolean = true):void
Submits an achievement to iOS Game Center in the name of the local player.
SDGameCenterManager
Constructor Detail
SDGameCenterManager()Constructor
public function SDGameCenterManager(namespace:Namespace)

Constructor of SDGameCenter singleton class. It cannot be used directly, use getGameCenterManager property of Snapdragon instead.

Parameters
namespace:Namespace — is an internal namespace, so this method cannot be used.

Throws
error — when it is called.
Method Detail
achievementRequest()method
public function achievementRequest():void

Get the achievement progress of the local player from the iOS Game Center.


Events
net.flashplusplus.Snapdragon.GameCenter.events.SDAchievementEvent.ACHIEVEMENT_PROGRESS_COMPLETE — When the request was successfully completed. The event contains the progress data in achievements vector.
 
net.flashplusplus.Snapdragon.GameCenter.events.SDAchievementEvent.ACHIEVEMENT_PROGRESS_ERROR — When there was an error by the requesting progress data.
gameCenterAuthentication()method 
public function gameCenterAuthentication():void

Authenticates local player. iOS Game Center features will not be accessable, while local user is not authenticated.


Events
net.flashplusplus.Snapdragon.GameCenter.SDAuthenticationEvent.AUTHENTICATION_COMPLETE — When the authentication was successful.
 
net.flashplusplus.Snapdragon.GameCenter.SDAuthenticationEvent.AUTHENTICATION_ERROR — When there was an error by the authentication process.
getInstance()method 
public static function getInstance(nameSpace:Namespace):SDGameCenterManager

Function to get SDGameCenterManager instance. It is not meant to be used.

Parameters

nameSpace:Namespace — is an internal namespace, so this method cannot be used.

Returns
SDGameCenterManager — the only instance of SDGameCenterManager object.
getLocalPlayer()method 
public function getLocalPlayer():SDPlayer

Get local player object.

Returns
SDPlayer — the local player object if the user is authenticated, null otherwise.
isAuthenticated()method 
public function isAuthenticated():Boolean

Checking if the local player is authenticated.

Returns
Boolean — true if the local player is authenticated.
isGameCenterAvailable()method 
public function isGameCenterAvailable():Boolean

Checking if the actual device running the application is capable of using the iOS Game Center.

Returns
Boolean — true if Game Center features are applicable, else returns false.
leaderboardListRequest()method 
public function leaderboardListRequest():void

Get the existing leadeboards from the iOS Game Center.


Events
net.flashplusplus.Snapdragon.GameCenter.events.SDLeaderboardEvent.LEADERBOARD_LIST_COMPLETE — When the request was successfully completed. The event contains the list of leaderboards in the leaderboards vector.
 
net.flashplusplus.Snapdragon.GameCenter.events.SDLeaderboardEvent.LEADERBOARD_LIST_ERROR — When there was an error by the requesting leaderboard data.
leaderboardScoreRequest()method 
public function leaderboardScoreRequest(category:String, timeScope:String, playerScope:String, start:int, length:int):void

Since : iOS 6.0

Get the scores of a specific leadeboard from the iOS Game Center.

Parameters

category:String — is the leaderboard id.
 
timeScope:String — is the time scope of the leaderboard. Possible values can be accessed through the static constants of the SDLeaderboard class: TIME_SCOPE_ALL_TIME, TIME_SCOPE_TODAY, TIME_SCOPE_WEEK
 
playerScope:String — is the player scope of the leaderboard. Possible values can be accessed through the static constants of the SDLeaderboard class: PLAYER_SCOPE_GLOBAL, PLAYER_SCOPE_FRIENDS
 
start:int — is the start index.
 
length:int — is the number of items in the range (can be 0).


Events
net.flashplusplus.Snapdragon.GameCenter.events.SDLeaderboardEvent.LEADERBOARD_SCORE_REQUEST_COMPLETE — When the request was successfully completed. The event contains the list of scores in the scores vector.
 
net.flashplusplus.Snapdragon.GameCenter.events.SDLeaderboardEvent.LEADERBOARD_SCORE_REQUEST_ERROR — When there was an error by the requesting score data.
reportScoreForLeaderboard()method 
public function reportScoreForLeaderboard(category:String, score:int):void

Reporting score for a specific leaderboard.

Parameters

category:String — is the leaderboard id.
 
score:int — is the score being reported for the current user.


Events
net.flashplusplus.Snapdragon.GameCenter.events.SDLeaderboardEvent.LEADERBOARD_SCORE_REPORT_COMPLETE — When the report was successfully completed.
 
net.flashplusplus.Snapdragon.GameCenter.events.SDLeaderboardEvent.LEADERBOARD_SCORE_REPORT_ERROR — When there was an error by reporting the score.
resetAchievements()method 
public function resetAchievements():void

Clears achievement progress data of the local player.


Events
net.flashplusplus.Snapdragon.GameCenter.events.SDAchievementEvent.ACHIEVEMENT_RESET_COMPLETE — When the progressdata was successfully deleted.
 
net.flashplusplus.Snapdragon.GameCenter.events.SDAchievementEvent.ACHIEVEMENT_RESET_ERROR — When there was an error by deleting the data.
showAchievements()method 
public function showAchievements():void

Since : iOS 6.0

Shows the native iOS Game Center view of achievements.


Events
net.flashplusplus.Snapdragon.GameCenter.events.SDAchievementEvent.ACHIEVEMENT_VIEW_CLOSED — When the animation of closing the view was finished.
showLeaderboard()method 
public function showLeaderboard(category:String, timeScope:String):void

Since : iOS 6.0

Shows the native iOS Game Center view of leaderboards.

Parameters

category:String — is the leaderboard id.
 
timeScope:String — is the time scope of the leaderboard. Possible values can be accessed through the static constants of the SDLeaderboard class: TIME_SCOPE_ALL_TIME, TIME_SCOPE_TODAY, TIME_SCOPE_WEEK


Events
net.flashplusplus.Snapdragon.GameCenter.events.SDLeaderboardEvent.LEADERBOARD_VIEW_CLOSED — When the animation of closing the view was finished.
submitAchievement()method 
public function submitAchievement(identifier:String, progress:Number, showBanner:Boolean = true):void

Submits an achievement to iOS Game Center in the name of the local player.

Parameters

identifier:String — is the id of the achievement.
 
progress:Number — is the completion of the achievement in percentage. Game center stores it as an integer.
 
showBanner:Boolean (default = true) — is for showing the banner of the achievement completion.


Events
net.flashplusplus.Snapdragon.GameCenter.events.SDAchievementEvent.ACHIEVEMENT_SUBMIT_COMPLETE — When the achievement was submitted to the Game Center successfully.
 
net.flashplusplus.Snapdragon.GameCenter.events.SDAchievementEvent.ACHIEVEMENT_SUBMIT_ERROR — When there was an error by the submission process.