Cannot get score api to work

houranghourang sagði

fyrir löngu síðan | Færsla #1
Im new here and im trying to add the score api to my game. for some reason it is not working. i have done this on many other websites without issues. It seems to me like its not even trying to call the function SubmitScore as i get no response whatsoever. here is my code:

NonobaAPI.SubmitScore("totalscore", _global.totalscore, 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;
}
}
});

ChrisChris sagði

fyrir löngu síðan | Færsla #2
Remember to include Nonoba.api.NonobaAPI in the same frame.

houranghourang sagði

fyrir löngu síðan | Færsla #3 | sem svar við #2
ok where in the documentation does it say to do that? and what is the exact code to put in? i appreciate your help :)

ChrisChris sagði

fyrir löngu síðan | Færsla #4
Well in general you need to include the code you are to use :)

import Nonoba.api.NonobaAPI;

At the top of your keyframe should do the trick.
Make sure that the Nonoba folder is located in the same folder as your fla file.

houranghourang sagði

fyrir löngu síðan | Færsla #5
not usually with as2. and i do a lot of class stuff.

but thanks that works great :)

ChrisChris sagði

fyrir löngu síðan | Færsla #6
My pleasure :)

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.240.0137ms on SERVER34097