Be a Supporter!

Browse Sections


Newgrounds Wiki: getMedal

Page Contents

Usage

import com.newgrounds.API;
import com.newgrounds.Medal;

var medal:Medal = API.getMedal(medal_name:String);
This call gets a Medal instance using the medal's name.

Example

The following code demonstrates how to see if a medal named "My Medal" has been unlocked.
import com.newgrounds.API;
import com.newgrounds.Medal;

// get the medal var medal:Medal = API.getMedal("My Medal");

// let us know if the medal is unlocked or not if (medal.unlocked) { trace(medal.name+" is unlocked!"); } else { trace(medal.name+" is not unlocked."); }