All the code you need for actionscript 2

siguiente »Página 1 2

ChrisChris dijo

hace mucho tiempo | Publicación #1
First of all make sure you downloaded the api and copied the Nonoba folder from ActionScript 2 into your project.

If 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;
}
}
})

MysteryMystery dijo

hace mucho tiempo | Publicación #2
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);

HenrikHenrik dijo

hace mucho tiempo | Publicación #3
In other news, we seriously need to change the forum so you can post code properly indented.

blissj01blissj01 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.

blissj01blissj01 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

ChrisChris dijo

hace mucho tiempo | Publicación #6
Blissj01

you need to copy folder called Nonoba into your project directory

blissj01blissj01 dijo

hace mucho tiempo | Publicación #7 | en respuesta a #6
Guh, I cant make it work. Everything I try there is an error of some new sort.

wakamoleguy dijo

hace mucho tiempo | Publicación #8
I'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?

ChrisChris dijo

hace mucho tiempo | Publicación #9 | en respuesta a #8
This 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!

ChrisChris dijo

hace mucho tiempo | Publicación #10 | en respuesta a #2
Ye, 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);
La publicación #11 de Crystal8088 tiene un recórd de -3. mostrar

Crystal8088 dijo

hace mucho tiempo | Publicación #11
Hey Help Me to get an Acivement work in the GAME!!!
La publicación #12 de jjosh tiene un recórd de -2. mostrar

jjoshjjosh dijo

hace mucho tiempo | Publicación #12
ahh i cant put achevements on tank 2008

jjoshjjosh dijo

hace mucho tiempo | Publicación #13
can someone help???

Volcano InteractiveVolcano Interactive dijo

hace mucho tiempo | Publicación #14 | en respuesta a #9
So THAT'S why I can't put achievements on my games!

Unicorn dijo

hace mucho tiempo | Publicación #15 | en respuesta a #13
you have to elaborate on what help you need. what you've tried. what errors your getting. what you're trying to do.

JhelleJhelle dijo

hace mucho tiempo | Publicación #16 | en respuesta a #12
I guess Tank 2008 isn't made by you. Only if the game is made by you, you can put achievements into it.
La publicación #17 de jjosh tiene un recórd de -3. mostrar

jjoshjjosh 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

Juegamigo

juegamigo.com es un sitio de juegos independiente donde puedes jugar solo o en conjunto en los juegos multijugador de una manera gratuita.

Herramientas para Desarrolladores

Si eres un desarrollador de juegos flash, tenemos unas increíbles herramientas que te ayudarán a hacer aún mejores tus juegos.

Juegos Padrísimos

¿Por qué no jugar algunos de los mejores juegos flash en línea que tenemos?, ¡es completamente gratis!

Copyright ©2007-2012 Juegamigo™ - All rights reserved.31.2001ms on SERVER34096