| Package | com.desuade.utils |
| Class | public class Random |
| Inheritance | Random Object |
| Subclasses | RandomColor |
| Language Version : | ActionScript 3 |
| Since : | 18.04.2009 |
| Runtime Versions : | AIR 1.0, Flash Player 9.0.0 |
| Property | Defined By | ||
|---|---|---|---|
| max : Number
The Random object's maximum value for the random range. | Random | ||
| min : Number
The Random object's minimum value for the random range. | Random | ||
| precision : int
This is the amount of decimal places to keep when returning the value. | Random | ||
| Method | Defined By | ||
|---|---|---|---|
Random(min:Number, max:Number, precision:int = 0)
This creates a Random object than can be used over again for creating new random values from the same range. | Random | ||
fromRange(min:Number, max:Number, precision:int = 0):* [static]
This static function is used to return a random value from a given range. | Random | ||
toString():String
This returns a new random value within the range each time the Random object is read. | Random | ||
valueOf():Number
This returns a new random value within the range each time the Random object is read. | Random | ||
| max | property |
public var max:NumberThe Random object's maximum value for the random range.
| min | property |
public var min:NumberThe Random object's minimum value for the random range.
| precision | property |
public var precision:intThis is the amount of decimal places to keep when returning the value. For example, values such as alpha use a 0-1 scale, so a precision of 2 would be used 0.00
| Random | () | Constructor |
public function Random(min:Number, max:Number, precision:int = 0)This creates a Random object than can be used over again for creating new random values from the same range. Can be used with the Tween classes, as well as any other properties requiring a Number.
Parametersmin:Number — The first value in the range
| |
max:Number — The second value in the range, up to but not including
| |
precision:int (default = 0) — This determines how many decimal places the random value should be in
|
See also
| fromRange | () | method |
public static function fromRange(min:Number, max:Number, precision:int = 0):*This static function is used to return a random value from a given range.
Parameters
min:Number — The first value in the range
| |
max:Number — The second value in the range, up to but not including
| |
precision:int (default = 0) — This determines how many decimal places the random value should be in
|
* |
See also
| toString | () | method |
public function toString():StringThis returns a new random value within the range each time the Random object is read. Use var rns:String = String(my_random_object) to assign a constant string.
ReturnsString |
| valueOf | () | method |
public function valueOf():NumberThis returns a new random value within the range each time the Random object is read. Use var rn:Number = Number(my_random_object) to assign a constant number.
ReturnsNumber |