User Guide

354 Chapter 6: ActionScript Core Classes
Math.max()
Availability
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.
Usage
Math.max(x:Number , y:Number) : Number
Parameters
x
A number or expression.
y A number or expression.
Returns
A number.
Description
Method; evaluates x and y and returns the larger value.
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
Math.min()
Math.min()
Availability
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.
Usage
Math.min(x:Number , y:Number) : Number
Parameters
x
A number or expression.
y A number or expression.
Returns
A number.