Trying to get the AS2 API working.

hansahansa sagði

fyrir löngu síðan | Færsla #1
Okay so first how is the files suposed to be localated?
I first tried to put the NonobaAPI.as in the same place as my .fla but that gave the the following error

*Error* C:\Documents and Settings\Mats\My Documents\johannes\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{

so I moved it to Nonoba\api\ (with Nonoba in the same place as my .fla) is this the right place?

Second I try to get the highscores working using this code that is suplied in Documention (game.score is my score variable)

NonobaAPI.SubmitScore("highscore", game.score, 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;
}
}
})

I then uploaded my game here as "in development" but no highscore shows up what shall I do?

404404 sagði

fyrir löngu síðan | Færsla #2
Nonoba\api\NonobaAPI.as is where you want it. Sounds like that's where it's at though.

As for your code, I'm too lazy to look through it right now, but I will provide the code that I used for Slipstream.



It's been a while since I've worked with the API, so this is off of memory, but I'm pretty sure it's very important that your "SubmitScore" be in the same frame/level as your "result_callback" function and your "import Nonoba.api.NonobaAPI"

Hope this helps.
Síðast breytt fyrir löngu síðan

hansahansa sagði

fyrir löngu síðan | Færsla #3
Thanks 404, I forgot to import the api :P

Well highscores works now so I'll try to get achievements working :D
Síðast breytt fyrir löngu síðan

hansahansa sagði

fyrir löngu síðan | Færsla #4
Okay everything works now :D http://nonoba.com/hansa/pi-r-action

How long does it take for my achivments to be approved?

EDIT: They work now so I guess it don't take that much time :D
Síðast breytt fyrir löngu síðan

Svara þræði

Skráðu þig núna til að svara þráðum

Spilatorg

Velkomin(n) á spilatorg.is. Spilatorg er sjálfstæð leikjasíða þar sem þú getur spilað bæði einstaklings- og fjölspilunarleiki frítt.

Tól hönnuða

Ef þú ert flash leikja hönnuður, þá erum við með nokkur frábær tól til að hjálpa þér að búa til jafnvel enn betri leiki.

Frábærir leikir

Af hverju prófarðu ekki nokkra af bestu flash netleikjunum sem við erum með, algjörlega frítt?

Copyright ©2007-2012 Spilatorg™ - All rights reserved.298.0171ms on SERVER34097