Number.valueOf()
375
Parameters
radix
Specifies the numeric base (from 2 to 36) to use for the number-to-string conversion. If
you do not specify the
radix
parameter, the default value is 10.
Returns
A string.
Description
Method; returns the string representation of the specified Number object (
myNumber
).
Example
The following example uses 2 and 8 for the
radix
parameter and returns a string that contains
the corresponding representation of the number 9:
var myNumber:Number = new Number(9);
trace(myNumber.toString(2)); // output: 1001
trace(myNumber.toString(8)); // output: 11
The following example results in a hexadecimal value.
var r:Number = new Number(250);
var g:Number = new Number(128);
var b:Number = new Number(114);
var rgb:String = "0x"+ r.toString(16)+g.toString(16)+b.toString(16);
trace(rgb);
// output: rgb:0xFA8072 (Hexadecimal equivalent of the color 'salmon')
Number.valueOf()
Availability
Flash Player 5.
Usage
myNumber
.valueOf()
: Number
Parameters
None.
Returns
Number.
Description
Method; returns the primitive value type of the specified Number object.
Example
The following example results in the primative value of the
numSocks
object.
var numSocks = new Number(2);
trace(numSocks.valueOf()); // output: 2
Содержание FLEX
Страница 1: ...Flex ActionScript Language Reference ...
Страница 8: ......
Страница 66: ...66 Chapter 2 Creating Custom Classes with ActionScript 2 0 ...
Страница 76: ......
Страница 133: ...break 133 See also for for in do while while switch case continue throw try catch finally ...
Страница 135: ...case 135 See also break default strict equality switch ...
Страница 146: ...146 Chapter 5 ActionScript Core Language Elements See also break continue while ...
Страница 229: ...while 229 i 3 The following result is written to the log file 0 3 6 9 12 15 18 See also do while continue for for in ...
Страница 808: ...808 Chapter 7 ActionScript for Flash ...
Страница 810: ...810 Appendix A Deprecated Flash 4 operators ...
Страница 815: ...Other keys 815 Num Lock 144 186 187 _ 189 191 192 219 220 221 222 Key Key code ...
Страница 816: ...816 Appendix B Keyboard Keys and Key Code Values ...
Страница 822: ...822 Index ...