00:00
00:00
Newgrounds Background Image Theme

Someone gifted MetalSlayer69 supporter status!

We need you on the team, too.

Support Newgrounds and get tons of perks for just $2.99!

Create a Free Account and then..

Become a Supporter!

Here is how I get medals to work for flash

562 Views | 2 Replies
New Topic Respond to this Topic

Quite a few people have been asking about medals recently so thought I'd just stick my method here to save trying to find it in my overcrowded sentbox every time somebody asks. Originated here (for Ruffle). Presumably you'll want to make an AS2 game anyway since it's most reliable with Ruffle but if not, let me know and I can see what shape my AS3 games are in. Also presumably the more up to date API works now (or maybe not considering the amount of people asking about it) but I never bothered checking since my way works, what's the point. Anyway, here's the method-


"Let me write these steps out as I do them myself because this button always seems to be a pain in the ass to find.

-Create new project (has to be a game).

-Name it otherwise Newgrounds will shit itself.

-Click API tools at the bottom.

-Click "I agree, show me your tool" at the bottom.

-Click advanced on the next screen to show more text.

-Click "click here" on the line highlighted below.

iu_938724_2348424.webp

-Copy the following from the top of the screen.

Your API ID

Encryption Key

-A link to medal section will be at the bottom but should be clear how to get to it from your project page (it's easy to use so no worries there).


Next, download this- https://www.newgrounds.com/dump/item/6e44c08f9ac6c486f988ca7b764b14f0

-Open it.

-Click the API Connector object that's on the screen.

-Under properties, you'll notice spaces to copy in your API ID and Encryption Key.

-Copy in your API ID and Encryption Key.

-Copy and paste the connector object onto the first frame of your project (will appear wherever you put it. can drag it off frame if preferred)

-Then use this code to unlock medals.


import com.newgrounds.*;

API.unlockMedal("MEDAL NAME GOES HERE");


You'd think you wouldn't need the first line every time but last I checked, you do.

Here's also a way to reposition the popup (that's very helpfully not mentioned anywhere).


import com.newgrounds.*;

API.unlockMedal("MEDAL NAME GOES HERE", 69, 420);

//Puts it at position 69, 420. Change the numbers to change the position.


Looks like I also left the scoreboard object in there. Here's the code to submit a score.

com.newgrounds.API.postScore("SCOREBOARD NAME", Score);

//SCOREBOARD NAME is whatever you named the scoreboard here on Newgrounds in the game settings. Score is a variable you create yourself in the game (can name it whatever you like). Whatever value it has will be displayed on the scoreboard.


Ignore the flash ad object, they don't even get approved anymore.


Any problems, let me know. Old ass system so probably inevitable but this is the most reliable way I've got them to work anyway."


Nobody beats the 83457 and all that.

Patreon : Ko-fi : YouTube : Twitter

BBS Signature

Response to Here is how I get medals to work for flash 2023-04-03 06:40:51


I don’t use Flash but I think you are using Newgrounds.io and that doesn’t work exactly for flash. Maybe you need to switch to the old Newgrounds API. That’s just what I think, you can take it with a grain of salt.


Crazy? I was crazy once.

BBS Signature

Response to Here is how I get medals to work for flash 2023-04-03 06:46:08


At 4/3/23 06:40 AM, Prismisho wrote: I don’t use Flash but I think you are using Newgrounds.io and that doesn’t work exactly for flash. Maybe you need to switch to the old Newgrounds API. That’s just what I think, you can take it with a grain of salt.


Wasn't asking advice, this is a guide on how to do just that.


Nobody beats the 83457 and all that.

Patreon : Ko-fi : YouTube : Twitter

BBS Signature