- Package: com.newgrounds
- Class: Medal
The Medal class describes a medal for a game.
These are the methods of Medal.
public function attachIcon(parent:DisplayObjectContainer):Sprite
Attaches the icon to the display list.
Unlocks this medal. If the user is logged-in and playing on Newgrounds, then the medal will be unlocked on their Newgrounds account. Otherwise, the medal is unlocked locally on their computer. The API will fire a MEDAL_UNLOCKED event.
These are the properties of Medal.
public var difficulty:String;
The difficulty of the medal.
public var icon:BitmapData;
The medal icon.
public var id:uint;
The numeric ID of the medal. This ID is unqiue among all submissions.
public var name:String;
The name of the medal.
public var unlocked:Boolean;
Specifies if this medal has been unlocked by the user.
public var value:uint;
The number of points that this medal is worth. Medals may be worth either 5, 10, 25, 50, or 100 points.
These are the constants of Medal.
public static const DEFAULT_ICON:BitmapData;
The default medal icon. This icon is used when an icon fails to load.
public static const DIFFICULTY_BRUTAL:String = "Brutal";
"Brutal" medals are worth 100 points.
public static const DIFFICULTY_CHALLENGING:String = "Challenging";
"Challenging" medals are worth 25 points.
public static const DIFFICULTY_DIFFICULT:String = "Difficult";
"Difficult" medals are worth 50 points.
public static const DIFFICULTY_EASY:String = "Easy";
Easy difficulty medals are worth 5 points.
public static const DIFFICULTY_MODERATE:String = "Moderate";
"Moderate" medals are worth 10 points.
public static const ICON_HEIGHT:uint = 50;
The height of a medal icon.
public static const ICON_WIDTH:uint = 50;
The width of a medal icon.
These are the events dispatched by Medal.
Dispatched when a medal is unlocked.