ActionScript3 Reference
Class Achievements
Namespace: playerio
Language: ActionScript 3
The Player.IO Achievements service
Properties | |||
---|---|---|---|
public |
The list of all achievements; the values of Progress and ProgressGoal will indicate whether the achievement is started/pending/complete. |
||
public |
Set a handler that is called when an achievement is completed. |
||
Methods | |||
public |
This method gets the specified achievement |
||
public |
Load achivements for the specified users. |
||
public |
Add or subtract from the current progress of an achievement. |
||
public |
Complete the specified achievement, by setting the progress to the maximum (ProgressGoal) of the achievement. |
||
public |
Sets the current progress value to the bigger value of progress or the current value, i.e; newProgress = Max(currentProgress,progress) |
||
public |
Sets the progress of the specified achievement. |
||
public |
Refresh myAchievements |
Achievements.myAchievements
public |
|
The list of all achievements; the values of Progress and ProgressGoal will indicate whether the achievement is started/pending/complete.
Achievements.onCompletedHandler
public |
|
Set a handler that is called when an achievement is completed.
Achievements.get
public |
|
This method gets the specified achievement
Arguments
achievementId:String | |
The id of the achievement to get |
Achievements.load
public |
|
Load achivements for the specified users.
Arguments
userIds:Array | |
Array of userIds to load achivements for. | |
callback:Function (Default = null) | |
Callback that will be called with a dictionary where the keys are userIds and the values are their achievments. | |
errorHandler:Function (Default = null) | |
Callback that will be called instead of successCallback if an error occurs. |
Achievements.progressAdd
public |
|
Add or subtract from the current progress of an achievement.
Arguments
achievementId:String | |
The id of the achivement to add progress to. | |
progressDelta:int | |
The delta value that will be added to the current progress of the achievement. | |
callback:Function | |
Callback that will be called with the updated Achievement. | |
errorHandler:Function | |
Callback that will be called if an error occurs. |
Achievements.progressComplete
public |
|
Complete the specified achievement, by setting the progress to the maximum (ProgressGoal) of the achievement.
Arguments
achievementId:String | |
The id of the achivement to complete. | |
callback:Function | |
Callback that will be called with the updated Achievement. | |
errorHandler:Function | |
Callback that will be called if an error occurs. |
Achievements.progressMax
public |
|
Sets the current progress value to the bigger value of progress or the current value, i.e; newProgress = Max(currentProgress,progress)
Arguments
achievementId:String | |
The id of the achivement to work on. | |
progress:int | |
The possible new progress value that should be compared to the current progress value | |
callback:Function | |
Callback that will be called with the updated Achievement. | |
errorHandler:Function | |
Callback that will be called if an error occurs. |
Achievements.progressSet
public |
|
Sets the progress of the specified achievement.
Arguments
achievementId:String | |
The id of the achivement to add progress to. | |
progress:int | |
The new progress value for the achievement. | |
callback:Function | |
Callback that will be called with the updated Achievement. | |
errorHandler:Function | |
Achievements.refresh
public |
|
Refresh myAchievements
Arguments
callback:Function (Default = null) | |
Callback that will be called when the refresh is complete. | |
errorHandler:Function (Default = null) | |
Callback that will be called instead if an error occurs. |