Packagewk.example.die
Classpublic class Die
InheritanceDie Inheritance flash.display.MovieClip

Language Version : ActionScript 3.0

This MovieClip displays a dice (German: Würfel).

A dice has a value (1, 2, 3, 4, 5, or 6; Error: 0), which immediatedly is displayed whenever it changes.



Public Properties
 PropertyDefined By
  value : uint
The current value of the dice: 1, 2, 3, 4, 5, or 6; Error: 0.
Die
Public Methods
 MethodDefined By
  
Die(p_value:uint = 1)
Creates a new dice.
Die
  
rollTheDie():void
Computes a random number NUMBER_OF_ROOLS times and displays each new value for a fraction of a second.
Die
  
toString():String
[override] Converts a WK_Dice object into a string.
Die
Public Constants
 ConstantDefined By
  NUMBER_OF_ROLLS : uint = 20
[static]
Die
Property Detail
valueproperty
value:uint

The current value of the dice: 1, 2, 3, 4, 5, or 6; Error: 0.


Implementation
    public function get value():uint
    public function set value(value:uint):void
Constructor Detail
Die()Constructor
public function Die(p_value:uint = 1)

Creates a new dice.

Parameters
p_value:uint (default = 1) — The initial value.
Method Detail
rollTheDie()method
public function rollTheDie():void

Computes a random number NUMBER_OF_ROOLS times and displays each new value for a fraction of a second.

toString()method 
override public function toString():String

Converts a WK_Dice object into a string.

Returns
String — Returns the classe name, the object name and the value (1, 2, 3, 4, 5, or 6; Error: 0) of the current dice.
Constant Detail
NUMBER_OF_ROLLSConstant
public static const NUMBER_OF_ROLLS:uint = 20