Sign In Register

How can we help you today?

Start a new topic
Answered

Get raw JSON object from response

Hello,


I'm interested if there is a way to get LeaderboardDataResponse object (and other response objects) as raw JSON data object or AS3 object?

OR if there is a easy way to convert it to the AS3 Object?


I have Facebook Graph API experience and for me it looks like it's much easier for developer to have JSON object as response. It's easier to loop through, trace object contents and etc.


I am new to GS and maybe I'm missing something.


Regards!


Best Answer

Hi Irakli

To get the data from a LeaderboardDataResponse object in AS3 you can use


.send(function(response:com.gamesparks.api.responses.LeaderboardDataResponse):void {
var challengeInstanceId:String = response.getChallengeInstanceId();
var data:Vector.<LeaderboardData> = response.getData();
var first:Vector.<LeaderboardData> = response.getFirst();
var last:Vector.<LeaderboardData> = response.getLast();
var leaderboardShortCode:String = response.getLeaderboardShortCode();
var scriptData:ScriptData = response.getScriptData();
});


Have a look at the documentation for thisĀ here

Thanks

Katie


1 Comment

Answer

Hi Irakli

To get the data from a LeaderboardDataResponse object in AS3 you can use


.send(function(response:com.gamesparks.api.responses.LeaderboardDataResponse):void {
var challengeInstanceId:String = response.getChallengeInstanceId();
var data:Vector.<LeaderboardData> = response.getData();
var first:Vector.<LeaderboardData> = response.getFirst();
var last:Vector.<LeaderboardData> = response.getLast();
var leaderboardShortCode:String = response.getLeaderboardShortCode();
var scriptData:ScriptData = response.getScriptData();
});


Have a look at the documentation for thisĀ here

Thanks

Katie


Login to post a comment