Trying to get the AS2 API working.
0 points
Okay so first how is the files suposed to be localated?
I first tried to put the NonobaAPI.as in the same place as my .fla but that gave the the following error
*Error* C:\Documents and Settings\Mats\My Documents\johannes\NonobaAPI.as: Line 8: The class 'Nonoba.api.NonobaAPI' needs to be defined in a file whose relative path is 'Nonoba\api\NonobaAPI.as'.
class Nonoba.api.NonobaAPI{
so I moved it to Nonoba\api\ (with Nonoba in the same place as my .fla) is this the right place?
Second I try to get the highscores working using this code that is suplied in Documention (game.score is my score variable)
NonobaAPI.SubmitScore("highscore", game.score, function(response:String){
switch(response){
case NonobaAPI.SUCCESS:{
trace("The score was submitted successfully")
break;
}
case NonobaAPI.NOTLOGGEDIN:{
trace("The user is not logged in")
break;
}
case NonobaAPI.ERROR:{
trace("An error occurred.")
break;
}
}
})
I then uploaded my game here as "in development" but no highscore shows up what shall I do?
0 points
Nonoba\api\NonobaAPI.as is where you want it. Sounds like that's where it's at though.
As for your code, I'm too lazy to look through it right now, but I will provide the code that I used for Slipstream.
It's been a while since I've worked with the API, so this is off of memory, but I'm pretty sure it's very important that your "SubmitScore" be in the same frame/level as your "result_callback" function and your "import Nonoba.api.NonobaAPI"
Hope this helps.Last edited 5 weeks ago
1 points
Thanks 404, I forgot to import the api :P
Well highscores works now so I'll try to get achievements working :DLast edited 5 weeks ago
0 points
Okay everything works now :D http://nonoba.com/hansa/pi-r-action
How long does it take for my achivments to be approved?
EDIT: They work now so I guess it don't take that much time :DLast edited 5 weeks ago
Reply to thread
Sign up now to reply to threads.