Abs (Math.abs Method) - MACROMEDIA FLASHLITE2 ACTIONSCRIPT-LANGUAGE Reference

Actionscript language reference
Table of Contents

Advertisement

Modifiers
Signature
static
sin(x:Number) :
static
sqrt(x:Number) :
static
tan(x: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 Lite 2.0 - 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);
trace(num); // output: -12
trace(numAbsolute); // output: 12
Number
Number
Number
method),
method),
isPropertyEnumerable
method),
method),
unwatch (Object.unwatch
watch (Object.watch method)
Math.abs()
parameter (called
x
Description
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.
hasOwnProperty
isPrototypeOf (Object.isPrototypeOf
method),
toString
method),
returns the absolute value of a number and
in this example):
num
valueOf
.
x
Math
413

Advertisement

Table of Contents
loading

This manual is also suitable for:

Flash lite 2

Table of Contents