Cannot get score api to work

houranghourang said

2 months ago | Post #1
Im new here and im trying to add the score api to my game. for some reason it is not working. i have done this on many other websites without issues. It seems to me like its not even trying to call the function SubmitScore as i get no response whatsoever. here is my code:

NonobaAPI.SubmitScore("totalscore", _global.totalscore, 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;
}
}
});

ChrisChris said

2 months ago | Post #2
Remember to include Nonoba.api.NonobaAPI in the same frame.

houranghourang said

2 months ago | Post #3 | in reply to #2
ok where in the documentation does it say to do that? and what is the exact code to put in? i appreciate your help :)

ChrisChris said

2 months ago | Post #4
Well in general you need to include the code you are to use :)

import Nonoba.api.NonobaAPI;

At the top of your keyframe should do the trick.
Make sure that the Nonoba folder is located in the same folder as your fla file.

houranghourang said

2 months ago | Post #5
not usually with as2. and i do a lot of class stuff.

but thanks that works great :)

ChrisChris said

2 months ago | Post #6
My pleasure :)

Reply to thread

Sign up now to reply to threads

Nonoba

nonoba.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-2009 Nonoba™ - All rights reserved.46,8003ms on NONOBA-WEB1