| Package | wk.example.die |
| Class | public class Die |
| Inheritance | Die flash.display.MovieClip |
| Language Version : | ActionScript 3.0 |
A dice has a value (1, 2, 3, 4, 5, or 6; Error: 0), which immediatedly is displayed whenever it changes.
| Property | Defined By | ||
|---|---|---|---|
| value : uint The current value of the dice: 1, 2, 3, 4, 5, or 6; Error: 0. | Die | ||
| Method | Defined 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 | ||
| Constant | Defined By | ||
|---|---|---|---|
| NUMBER_OF_ROLLS : uint = 20 [static] | Die | ||
| value | property |
value:uintThe current value of the dice: 1, 2, 3, 4, 5, or 6; Error: 0.
public function get value():uint public function set value(value:uint):void| Die | () | Constructor |
public function Die(p_value:uint = 1)Creates a new dice.
Parametersp_value:uint (default = 1) — The initial value.
|
| 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():StringConverts a WK_Dice object into a string.
ReturnsString — Returns the classe name, the object name and the value
(1, 2, 3, 4,
5, or 6; Error: 0) of the
current dice.
|
| NUMBER_OF_ROLLS | Constant |
public static const NUMBER_OF_ROLLS:uint = 20