That's quite a mouthful of code there.
Personally, I would have written it like this for clarity:
import Nonoba.api.NonobaAPI;
result_callback = function(response:String, count:Number){
switch(response){
case NonobaAPI.SUCCESS:{
trace("The achievement was awarded, the user has now received this achievement " + count + " times")
break;
}
case NonobaAPI.NOT_LOGGED_IN:{
trace("The user is not logged in")
break;
}
case NonobaAPI.ERROR:{
trace("An error occurred.")
break;
}
}
}
NonobaAPI.AwardAchievement("key1", result_callback);
All the code you need for actionscript 2
Mystery said
a long time ago | Post #2
Henrik said
a long time ago | Post #3In other news, we seriously need to change the forum so you can post code properly indented.
blissj01 said
a long time ago | Post #4Hey guys, can someone explain this to me fully? I would love to put achievements in the finished version of click.
blissj01 said
a long time ago | Post #5When i try and test my movie, i get this:
*Error* C:\Documents and Settings\...\My Documents\Flash\classes\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{
Total ActionScript Errors: 1 Reported Errors: 1
*Error* C:\Documents and Settings\...\My Documents\Flash\classes\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{
Total ActionScript Errors: 1 Reported Errors: 1
Chris said
a long time ago | Post #6Blissj01
you need to copy folder called Nonoba into your project directory
you need to copy folder called Nonoba into your project directory
blissj01 said
a long time ago | Post #7 | in reply to #6Guh, I cant make it work. Everything I try there is an error of some new sort.
wakamoleguy said
a long time ago | Post #8I'm having an error with this. When I test the game, I get this:
*Error* C:\Documents and Settings\Will\My Documents\My Games\fla\Nonoba\api\NonobaAPI.as: Line 131: There is no method with the name 'Delegate'.
var loadTimer = setInterval(Delegate.create(NonobaAPI, function(){
Total ActionScript Errors: 1 Reported Errors: 1
I looked in the API and Delegate is an imported function. Does anybody know what the problem is and better yet, how to fix it?
*Error* C:\Documents and Settings\Will\My Documents\My Games\fla\Nonoba\api\NonobaAPI.as: Line 131: There is no method with the name 'Delegate'.
var loadTimer = setInterval(Delegate.create(NonobaAPI, function(){
Total ActionScript Errors: 1 Reported Errors: 1
I looked in the API and Delegate is an imported function. Does anybody know what the problem is and better yet, how to fix it?
Chris said
a long time ago | Post #9 | in reply to #8This turns out to be a problem for people using MX 2004 as they do not have the proper helping classes, I will make sure that we do not use the Delegate class in the next version of the api!
Chris said
a long time ago | Post #10 | in reply to #2Ye, well I am known for liking anonymous methods.
Anyway here is a basic version that is even resistant to flash AS auto-format;
function KillHandler(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;
}
}
};
NonobaAPI.SubmitScore("kills",100,KillHandler);
Anyway here is a basic version that is even resistant to flash AS auto-format;
function KillHandler(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;
}
}
};
NonobaAPI.SubmitScore("kills",100,KillHandler);
Post #11 by Crystal8088 has a score of -3. show
Crystal8088 said
a long time ago | Post #11Hey Help Me to get an Acivement work in the GAME!!!
jjosh said
a long time ago | Post #12ahh i cant put achevements on tank 2008
jjosh said
a long time ago | Post #13can someone help???
Volcano Interactive said
a long time ago | Post #14 | in reply to #9So THAT'S why I can't put achievements on my games!
Unicorn said
a long time ago | Post #15 | in reply to #13you have to elaborate on what help you need. what you've tried. what errors your getting. what you're trying to do.
Jhelle said
a long time ago | Post #16 | in reply to #12I guess Tank 2008 isn't made by you. Only if the game is made by you, you can put achievements into it.
Post #18 deleted
Post #19 deleted
Post #20 deleted
Reply to thread
Sign up now to reply to threads
Chris said
a long time ago | Post #1If so this should award the achievement key1
import Nonoba.api.NonobaAPI
NonobaAPI.AwardAchievement("key1", function(response:String, count:Number){
switch(response){
case NonobaAPI.SUCCESS:{
trace("The achievement was awarded, the user has now recived this achievement " + count + " times")
break;
}
case NonobaAPI.NOT_LOGGED_IN:{
trace("The user is not logged in")
break;
}
case NonobaAPI.ERROR:{
trace("An error occurred.")
break;
}
}
})