[Kongregate API] AS3 Integration page 5 (locked)

Subscribe to [Kongregate API] AS3 Integration 129 posts, 66 voices

Sign in to reply


 
avatar for shuurai shuurai 4 posts
Flag Post

Load Manual Method is problematic.

It gives “NULL” error when calling kongregate.services.connect().

This happens in onLoadComplete(evt:Event);

It works however when testing locally until uploaded.

 
avatar for LazerBomb LazerBomb 278 posts
Flag Post

When you retrieve the high score list, how many entries do you get? Is there a way to get a certian person’s score, even if they aren’t in the top of the highscores?

 
avatar for darsoftware darsoftware 1 post
Flag Post

Hey guys, I’m stumped. My game apparently isn’t submitting the high scores data. Yet, the echos when running locally say it’s working fine.

I believe I did everything mentioned in the tutorial. I import import com.kongregate.as3.client.KongregateAPI, then make the variable var kongregate:KongregateAPI = new KongregateAPI(), and then call this.addChild ( kongregate ).

Then when the player presses submit, it calls (from a different class) KongregateAPI.getInstance().scores.submit(totalScore.value) yet, there is no high scores data appearing for my game.

Any idea what could be causing this?

Also: Should the highscores work in preview mode too or must I actually publish it each time to test it?

 
avatar for thinklikemike thinklikemike 2 posts
Flag Post

I was having the same exact problem, I’m not sure what the issue is either.

 
avatar for DTran DTran 220 posts
Flag Post

Can I get some clarification. I’m reading this thread, and Kongregate’s tutorial on implenting their API for AS3 (http://www.kongregate.com/games/Kongregate/kongregate-stats-api-tutorial-actionscript-3). On the high scores part, are we supposed to use the High Scores API, or will the stats API work just as well? The reason I ask is because on page 9 of their tutorial, second paragraph, they say that you can choose to use the High Scores API instead of the stats API if all you need is a simple scoreboard, which leads me to believe that you can retrieve high scores using the stats API. Is this correct?

 
avatar for 92Garfield 92Garfield 3 posts
Flag Post

I’m using this in the beginning:
import com.kongregate.as3.client.KongregateAPI;
var kongregate:KongregateAPI = KongregateAPI.getInstance();
this.addChild (kongregate);

and later i use this:
kongregate.stats.submit(“mostLines”, line);

but no achievment/highscore tab is there, why is that?
(i provided the neded information on the game upload)
game is:
http://www.kongregate.com/games/92Garfield/drawing

 
avatar for Moly Moly 272 posts
Flag Post

I had this problem and I’ve seen a few other people mention it aswell. I’m not sure what I did to fix it, if you’re on your account page and you edit your game you can upload the swf again. I did this a few times and kept specifying the statistics and the scores tab eventually appeared.

 
avatar for 92Garfield 92Garfield 3 posts
Flag Post

sounds like its just f***ing buggy :/

 
avatar for artist117 artist117 5 posts
Flag Post

does it change anything if your computer is a mac because the picture there is running on a windows… is it all the same for scripting and stuff related to that

 
avatar for Moly Moly 272 posts
Flag Post

Earlier in this thread someone mentioned you can put ?debug_level=3 at the end of your game url to debug connecting to the api but that doesn’t seem to work anymore so I can’t see anyway of finding out whether it’s a problem with your game or Kongregate.

 
avatar for Phoenix00017 Phoenix00017 6160 posts
Flag Post

I’m not sure about 3, but I know debug_level=5 will show you that information. However, you have to do it in Firefox with the Firebug plugin running in order to see the output (it used to output directly to chat, but that’s been changed). If level 3 works, that’s great, because level 5 also shows room joins and messages, so you should try to do it in a fairly empty room or it’s hard to read what’s going on.

Garfield – are you trying to use the components method for AS3? If so, I’d recommend using the manual loading method instead. A lot of developers have had more luck with it.

DTran – use the stats API. High scores can be a little buggy, and isn’t nearly as flexible as the stats API.

artist – almost all Kongregate staff members are running Macs, actually. :) Much of our stuff actually works better on Mac because that’s where the development is done.

 
avatar for Moly Moly 272 posts
Flag Post
Originally posted by Phoenix00017:

I’m not sure about 3, but I know debug_level=5 will show you that information. However, you have to do it in Firefox with the Firebug plugin running in order to see the output (it used to output directly to chat, but that’s been changed). If level 3 works, that’s great, because level 5 also shows room joins and messages, so you should try to do it in a fairly empty room or it’s hard to read what’s going on.

Why is this sort of information not more readily available? Is it any of the API documentaion/tutorials? Are there any other useful features you can tell us about?

 
avatar for Phoenix00017 Phoenix00017 6160 posts
Flag Post

The debug level 5 just changed recently, so it might not be in the documentation, but you’re right that it’d be good to put in there somewhere. As for other tricks, I don’t know too many at the moment. Do make sure you check things out before publishing your game – in preview mode only you can see it so you can make sure it all runs well, reports stats, etc. before it goes public. If you have additional questions or issues that don’t get answered in the forums, hit up the Development Support option in the Contact Us page and we can answer more specific questions.

EDIT: I’ve added the debugging documentation to the first page of this thread (though the formatting’s being a bit annoying). Thanks for suggesting that.

 
avatar for 92Garfield 92Garfield 3 posts
Flag Post

I’m using the .FLA way after the mdx way diddnt work (it diddnt appear in componets) gonna try manual way after school.

Whats with that examples? when i copy the whole code, libary and buttons, textboxes… it still wont work because getInstance() isnt used
How do the examples work? Why do you make examples that are completly different from the tutorial?

 
avatar for coollavagames coollavagames 3 posts
Flag Post

If your game uses MochiCrypt/Mochi Version control (or any other loader), this is how you can get the highscore-system working with Flash (ActionScript 3):

Download the KongregateAPI component and add it to your component path or library (DON’T add it to the stage directly) .

Add following code to for example ENTER_FRAME event (DON’T add this code to the constructor of the main MovieClip):

var wrapper:DisplayObjectContainer = root;

while(wrapper.parent) {
wrapper = wrapper.parent; // this codes finds the MochiCrypt -loader
}

kongregate = new KongregateAPI();
wrapper.addChild(kongregate); // add the api to MochiCrypt loader

Now you can upload your swf to MochiAds and THEN uploaded the encrypted version to Kongregate.

After this read the “Testing your API on Kongregate” section on this topic to see if your code works or not.

Just got this working on http://www.kongregate.com/games/coollavagames/stack-up-fever

 
avatar for coollavagames coollavagames 3 posts
Flag Post

I emailed Kongregate support and I got really helpful message back from a guy named Anthony, which said that you also have to manually specify your High score as “statistics”.

So if you see that your scores are sent to Kongregate ok by your game, but you don’t see the high score tab, remember to add the “statistic” for the high score.

 
avatar for taha116 taha116 22 posts
Flag Post

how could i make use of these in my PHP/text and browser based game?

 
avatar for fishkicker fishkicker 2 posts
Flag Post

hey if any one knows a good and free download that isnt just a trial period i could use one so if you could leave me a note wether in private message or just in forum i could use one my old one crashed

 
avatar for ThomasFrancis ThomasFrancis 4 posts
Flag Post

Can somebody help me. i am having the same problem as the few above me. I CANNOT get this API to work. I’ve tried all the methods. And nothing works.

 
avatar for EugeneMailov EugeneMailov 2 posts
Flag Post
Originally posted by coollavagames:

If your game uses MochiCrypt/Mochi Version control (or any other loader), this is how you can get the highscore-system working with Flash (ActionScript 3):

Download the KongregateAPI component and add it to your component path or library (DON’T add it to the stage directly) .

Add following code to for example ENTER_FRAME event (DON’T add this code to the constructor of the main MovieClip):

var wrapper:DisplayObjectContainer = root;



while(wrapper.parent) {

wrapper = wrapper.parent; // this codes finds the MochiCrypt -loader

}



kongregate = new KongregateAPI();

wrapper.addChild(kongregate); // add the api to MochiCrypt loader

Now you can upload your swf to MochiAds and THEN uploaded the encrypted version to Kongregate.

thanx, this one almost helps!
but i also made it a little bit my way:
- placed code in first frame, right into preloader
- used this instead of root

 
avatar for ShellScripter ShellScripter 22 posts
Flag Post

Sorry , i have a question , in my game LongShinTa:http://www.kongregate.com/games/ShellScripter/longshinta
,i have implemented the Kongregate API , when the game is finished , it will call the submit funciton for
kongregate object , like this:

Main.kongregate.stats.submit(Main.playerName, score );

Where Main.playerName is the player name and score is the final score .

My problem is :

1. Have i done all the necesary for submit score??
(
//My code about kongregate object
Main.kongregate:KongregateAPI=new Kongregate();
Main.stage.addChild(Main.kongregate);
Main.kongregate=KongregateAPI.getInstance();

//Upload final score
Main.kongregate.stats.submit(Main.playerName, score );
)

2.If what i have done is all necesary,where can i check out the score?? (for common players)

 
avatar for RedSpaceship RedSpaceship 31 posts
Flag Post

Is there a way to manually load the API? I’ve tried the traditional method using URLRequest but it doesn’t seem to work in a MochiCrypt/Version Control game.

 
avatar for jonathanasdf jonathanasdf 1592 posts
Flag Post
Originally posted by RedSpaceship:

Is there a way to manually load the API? I’ve tried the traditional method using URLRequest but it doesn’t seem to work in a MochiCrypt/Version Control game.

Originally posted by EugeneMailov:
Originally posted by coollavagames:

If your game uses MochiCrypt/Mochi Version control (or any other loader), this is how you can get the highscore-system working with Flash (ActionScript 3):

Download the KongregateAPI component and add it to your component path or library (DON’T add it to the stage directly) .

Add following code to for example ENTER_FRAME event (DON’T add this code to the constructor of the main MovieClip):

var wrapper:DisplayObjectContainer = root;





while(wrapper.parent) {


wrapper = wrapper.parent; // this codes finds the MochiCrypt -loader


}





kongregate = new KongregateAPI();


wrapper.addChild(kongregate); // add the api to MochiCrypt loader

Now you can upload your swf to MochiAds and THEN uploaded the encrypted version to Kongregate.

thanx, this one almost helps!

but i also made it a little bit my way:

- placed code in first frame, right into preloader

- used this instead of root

that said, the method needs a small change-instead of ENTER_FRAME put it in INIT.

 
avatar for gf23 gf23 8 posts
Flag Post

I’m having trouble with the scores api.

I will try to use the stats api but I am unsure how to load a list of stats.

 
avatar for Arkatufus Arkatufus 21 posts
Flag Post

I WAS using the Player Info service.
Some other devs are actually planning on using it and couldn’t finish their project because the service was missing.
I thought it was a bug and would be resolved later, I guess thats the end of that then.

Sign in to reply


Click Here