Troubles with add API

Subscribe to Troubles with add API 4 posts, 2 voices

 
avatar for acidDICA acidDICA 51 posts

I uploaded a simple game to see if I could get the API to work with Flash MX, despite it supposedly being for ‘AS 2.0’.

At first glance it seemed to work fine, but though it recorded 100 clicks for each of my games at first (it takes 10 clicks to complete a game), the ‘totalClicks’ stat soon started acting up. Refreshing the scores window after each click, I find it’s remaining static for about 5 clicks, then jumping upwards 330-700 points.

And yet, the .swf hasn’t altered and my code looks like:

onClipEvent (mouseDown) { _root.kongregateStats.submit(“totalClicks”,1); //other, un-related stuff }

Is it possible that my using Flash MX is the problem? Or are there any known problems with the add stat system?

I also got a highscore of 0, but that’s my fault (unrelated problem – could be uploaded before initialisation by right-click-playing).

 
avatar for OuTrIgHtChAoS OuTrIgHtChAoS 368 posts

my guess would be that it’s counting clicks while your mouse button is held down after clicking and that your stat is an add/increase stat. the way your game works it probably only counts when you first click and it takes 10 of those clicks to win, but it sends a lot more clicks than that to the server?

 
avatar for acidDICA acidDICA 51 posts

The ‘it takes 10 clicks to complete a game’ was a typo. It takes 100 clicks to call a game.

As stuff within the (mouseDown) handler should only be called, the score should be sent once – 100 times per game. Checking the debug screen, this seems to be the case. And yes it is set to ‘add’ mode.

The issue is that it adds on more than the value being sent over.

A total of 100 per game is sent, but as many as 1000 may be added. http://www.kongregate.com/games/acidDICA/100-cl…

See my other thread for more explanation. http://www.kongregate.com/forums/4/topics/9102

 
avatar for acidDICA acidDICA 51 posts

Without any changes on my part, the behaviour of the ‘Add’ system seems to have changed and now works as I expected.

I can only guess that there was a previous problem but it’s since been fixed?