Number()

Availability

Flash Lite 1.0.

Usage

Number(expression)

Operands

expression An expression to convert to a number.

Description

Function; converts the parameter expression to a number and returns a value as described in the following list:

Example

The following example converts the string in the myString variable to a number, stores the number in the myNumber variable, adds 5 to the number, and stores the result in the variable myResult. The final line shows the result when you call Number() on a Boolean value.

myString = "55";
myNumber = Number(myString);
myResult = myNumber + 5;

trace (myResult);                                // Output: 60

trace (Number(true));                                // Output: 1