Trying to get the AS2 API working.

hansahansa said

a long time ago | Post #1
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.NOT_LOGGED_IN:{
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?

404404 said

a long time ago | Post #2
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 a long time ago

hansahansa said

a long time ago | Post #3
Thanks 404, I forgot to import the api :P

Well highscores works now so I'll try to get achievements working :D
Last edited a long time ago

hansahansa said

a long time ago | Post #4
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 :D
Last edited a long time ago

Reply to thread

Sign up now to reply to threads

Funkyball

funkyball.com is an independent gaming site where you can play both single- and multiplayer games for free.

Developer Tools

If you're a flash game developer, we've got some awesome tools to help you make even better games.

Great Games

Why not try some of the very best online flash games we've got, completely free?

Copyright ©2007-2012 Funkyball™ - All rights reserved.351.0201ms on SERVER34097