All the code you need for actionscript 2

next »Page 1 2

ChrisChris said

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

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

a long time ago | Post #3
In other news, we seriously need to change the forum so you can post code properly indented.

blissj01blissj01 said

a long time ago | Post #4
Hey guys, can someone explain this to me fully? I would love to put achievements in the finished version of click.

blissj01blissj01 said

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

a long time ago | Post #6
Blissj01

you need to copy folder called Nonoba into your project directory

blissj01blissj01 said

a long time ago | Post #7 | in reply to #6
Guh, I cant make it work. Everything I try there is an error of some new sort.

wakamoleguy said

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

a long time ago | Post #9 | in reply to #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 said

a long time ago | Post #10 | in reply to #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);
Post #11 by Crystal8088 has a score of -3. show

Crystal8088 said

a long time ago | Post #11
Hey Help Me to get an Acivement work in the GAME!!!
Post #12 by jjosh has a score of -2. show

jjoshjjosh said

a long time ago | Post #12
ahh i cant put achevements on tank 2008

jjoshjjosh said

a long time ago | Post #13
can someone help???

Volcano InteractiveVolcano Interactive said

a long time ago | Post #14 | in reply to #9
So THAT'S why I can't put achievements on my games!

Unicorn said

a long time ago | Post #15 | in reply to #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 said

a long time ago | Post #16 | in reply to #12
I guess Tank 2008 isn't made by you. Only if the game is made by you, you can put achievements into it.
Post #17 by jjosh has a score of -3. show

jjoshjjosh said

a long time ago | Post #17
CrAp
Post #18 deleted
Post #19 deleted
Post #20 deleted
next »Page 1 2

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.62.4001ms on SERVER34096