Modifiers
Signature
static
random() : Number
static
round(x:Number) :
Number
static
sin(x:Number) :
Number
static
sqrt(x:Number) :
Number
static
tan(x:Number) :
Number
Methods inherited from class Object
addProperty (Object.addProperty
(Object.hasOwnProperty
(Object.isPropertyEnumerable
method),
registerClass (Object.registerClass
(Object.toString
(Object.valueOf
method),
abs (Math.abs method)
public static abs(x:Number) : Number
Computes and returns an absolute value for the number specified by the parameter
Availability: ActionScript 1.0; Flash Player 5 - In Flash Player 4, the methods and properties
of the Math class are emulated using approximations and might not be as accurate as the non-
emulated math functions that Flash Player 5 supports.
Parameters
- A number.
x:Number
Returns
- A number.
Number
Example
The following example shows how
does not affect the value of the
var num:Number = -12;
var numAbsolute:Number = Math.abs(num);
Description
Returns a pseudo-random number n, where 0 <= n < 1.
Rounds the value of the parameter x up or down to
the nearest integer and returns the value.
Computes and returns the sine of the specified angle
in radians.
Computes and returns the square root of the specified
number.
Computes and returns the tangent of the specified
angle.
method),
method),
isPropertyEnumerable
method),
method),
unwatch (Object.unwatch
watch (Object.watch method)
Math.abs()
parameter (called
x
hasOwnProperty
isPrototypeOf (Object.isPrototypeOf
method),
toString
method),
returns the absolute value of a number and
in this example):
num
valueOf
.
x
Math
745
Need help?
Do you have a question about the FLASH 8-ACTIONSCRIPT 2.0 LANGUAGE and is the answer not in the manual?