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
siguiente »Página 1 2
Mystery dijo
hace mucho tiempo | Publicación #2
Henrik dijo
hace mucho tiempo | Publicación #3 In other news, we seriously need to change the forum so you can post code properly indented.
blissj01 dijo
hace mucho tiempo | Publicación #4 Hey guys, can someone explain this to me fully? I would love to put achievements in the finished version of click.
blissj01 dijo
hace mucho tiempo | Publicación #5 When 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 dijo
hace mucho tiempo | Publicación #6 Blissj01
you need to copy folder called Nonoba into your project directory
you need to copy folder called Nonoba into your project directory
blissj01 dijo
hace mucho tiempo | Publicación #7 | en respuesta a #6Guh, I cant make it work. Everything I try there is an error of some new sort.
wakamoleguy dijo
hace mucho tiempo | Publicación #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 dijo
hace mucho tiempo | Publicación #9 | en respuesta a #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 dijo
hace mucho tiempo | Publicación #10 | en respuesta a #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);
La publicación #11 de Crystal8088 tiene un recórd de -3. mostrar
Crystal8088 dijo
hace mucho tiempo | Publicación #11Hey Help Me to get an Acivement work in the GAME!!!
jjosh dijo
hace mucho tiempo | Publicación #12 ahh i cant put achevements on tank 2008
jjosh dijo
hace mucho tiempo | Publicación #13 can someone help???
Volcano Interactive dijo
hace mucho tiempo | Publicación #14 | en respuesta a #9So THAT'S why I can't put achievements on my games!
Unicorn dijo
hace mucho tiempo | Publicación #15 | en respuesta a #13you have to elaborate on what help you need. what you've tried. what errors your getting. what you're trying to do.
Jhelle dijo
hace mucho tiempo | Publicación #16 | en respuesta a #12I guess Tank 2008 isn't made by you. Only if the game is made by you, you can put achievements into it.
jjosh dijo
hace mucho tiempo | Publicación #17 CrAp
Publicación #18 eliminada
Publicación #19 eliminada
Publicación #20 eliminada
siguiente »Página 1 2
Contestar al tema
Regístrate ahora para responder a éste tema
Chris dijo
hace mucho tiempo | Publicación #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;
}
}
})