Browse Sections


Methods

These are the methods of Medal.

attachIcon

Return to Top ^
public function attachIcon(parent:DisplayObjectContainer):Sprite


Attaches the icon to the display list.

toString

Return to Top ^
public function toString():String




unlock

Return to Top ^
public function unlock():void


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

Return to Top ^
public var difficulty:String;


The difficulty of the medal.

icon

Return to Top ^
public var icon:BitmapData;


The medal icon.

id

Return to Top ^
public var id:uint;


The numeric ID of the medal. This ID is unqiue among all submissions.

name

Return to Top ^
public var name:String;


The name of the medal.

unlocked

Return to Top ^
public var unlocked:Boolean;


Specifies if this medal has been unlocked by the user.

value

Return to Top ^
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

Return to Top ^
public static const DEFAULT_ICON:BitmapData;


The default medal icon. This icon is used when an icon fails to load.

DIFFICULTY_BRUTAL

Return to Top ^
public static const DIFFICULTY_BRUTAL:String = "Brutal";


"Brutal" medals are worth 100 points.

DIFFICULTY_CHALLENGING

Return to Top ^
public static const DIFFICULTY_CHALLENGING:String = "Challenging";


"Challenging" medals are worth 25 points.

DIFFICULTY_DIFFICULT

Return to Top ^
public static const DIFFICULTY_DIFFICULT:String = "Difficult";


"Difficult" medals are worth 50 points.

DIFFICULTY_EASY

Return to Top ^
public static const DIFFICULTY_EASY:String = "Easy";


Easy difficulty medals are worth 5 points.

DIFFICULTY_MODERATE

Return to Top ^
public static const DIFFICULTY_MODERATE:String = "Moderate";


"Moderate" medals are worth 10 points.

ICON_HEIGHT

Return to Top ^
public static const ICON_HEIGHT:uint = 50;


The height of a medal icon.

ICON_WIDTH

Return to Top ^
public static const ICON_WIDTH:uint = 50;


The width of a medal icon.

Events

These are the events dispatched by Medal.

medalUnlocked

Return to Top ^
APIEvent.medalUnlocked


Dispatched when a medal is unlocked.