- Package: com.newgrounds
- Class: Medal
Methods
These are the methods of Medal.attachIcon
public function attachIcon(parent:DisplayObjectContainer):SpriteAttaches the icon to the display list.
- Parameters
- parent:DisplayObjectContainer
The parent object to attach the icon to.
- parent:DisplayObjectContainer
- Returns
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.
Properties
These are the properties of Medal.difficulty
public var difficulty:String;The difficulty of the medal.
icon
public var icon:BitmapData;The medal icon.
id
public var id:uint;The numeric ID of the medal. This ID is unqiue among all submissions.
name
public var name:String;The name of the medal.
unlocked
public var unlocked:Boolean;Specifies if this medal has been unlocked by the user.
value
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.
Constants
These are the constants of Medal.DEFAULT_ICON
public static const DEFAULT_ICON:BitmapData;The default medal icon. This icon is used when an icon fails to load.
DIFFICULTY_BRUTAL
public static const DIFFICULTY_BRUTAL:String = "Brutal";"Brutal" medals are worth 100 points.
DIFFICULTY_CHALLENGING
public static const DIFFICULTY_CHALLENGING:String = "Challenging";"Challenging" medals are worth 25 points.
DIFFICULTY_DIFFICULT
public static const DIFFICULTY_DIFFICULT:String = "Difficult";"Difficult" medals are worth 50 points.
DIFFICULTY_EASY
public static const DIFFICULTY_EASY:String = "Easy";Easy difficulty medals are worth 5 points.
DIFFICULTY_MODERATE
public static const DIFFICULTY_MODERATE:String = "Moderate";"Moderate" medals are worth 10 points.
ICON_HEIGHT
public static const ICON_HEIGHT:uint = 50;The height of a medal icon.
ICON_WIDTH
public static const ICON_WIDTH:uint = 50;The width of a medal icon.
Events
These are the events dispatched by Medal.medalUnlocked
APIEvent.medalUnlockedDispatched when a medal is unlocked.