EasyManua.ls Logo

MACROMEDIA FLASH 8-ACTIONSCRIPT 2.0 LANGUAGE - Max (Math.max Method); Min (Math.min Method)

MACROMEDIA FLASH 8-ACTIONSCRIPT 2.0 LANGUAGE
1378 pages
Print Icon
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
754 ActionScript classes
max (Math.max method)
public static max(x:Number, y:Number) : Number
Evaluates x and y and returns the larger value.
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
x:Number - A number or expression.
y:Number - A number or expression.
Returns
Number - A number.
Example
The following example displays
Thu Dec 30 00:00:00 GMT-0700 2004, which is the larger
of the evaluated expressions.
var date1:Date = new Date(2004, 11, 25);
var date2:Date = new Date(2004, 11, 30);
var maxDate:Number = Math.max(date1.getTime(), date2.getTime());
trace(new Date(maxDate).toString());
See also
min (Math.min method), Date
min (Math.min method)
public static min(x:Number, y:Number) : Number
Evaluates x and y and returns the smaller value.
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
x:Number - A number or expression.
y:Number - A number or expression.

Table of Contents

Related product manuals