MACROMEDIA FLEX-FLEX ACTIONSCRIPT LANGUAGE Reference page 355

Actionscript language reference
Table of Contents

Advertisement

Description
Method; evaluates
Example
The following example displays
the evaluated expressions.
var date1:Date = new Date(2004, 11, 25);
var date2:Date = new Date(2004, 11, 30);
var minDate:Number = Math.min(date1.getTime(), date2.getTime());
trace(new Date(minDate).toString());
See Also
Math.max()
Math.PI
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.PI:Number
Parameters
None.
Returns
Nothing.
Description
Constant; a mathematical constant for the ratio of the circumference of a circle to its diameter,
expressed as pi, with a value of 3.141592653589793.
Example
The following example draws a circle using the mathematical constant pi and the Drawing API.
drawCircle(this, 100, 100, 50);
//
function drawCircle(mc:MovieClip, x:Number, y:Number, r:Number):Void {
mc.lineStyle(2, 0xFF0000, 100);
mc.moveTo(x+r, y);
mc.curveTo(r+x, Math.tan(Math.PI/8)*r+y, Math.sin(Math.PI/4)*r+x,
Math.sin(Math.PI/4)*r+y);
mc.curveTo(Math.tan(Math.PI/8)*r+x, r+y, x, r+y);
mc.curveTo(-Math.tan(Math.PI/8)*r+x, r+y, -Math.sin(Math.PI/4)*r+x,
Math.sin(Math.PI/4)*r+y);
mc.curveTo(-r+x, Math.tan(Math.PI/8)*r+y, -r+x, y);
mc.curveTo(-r+x, -Math.tan(Math.PI/8)*r+y, -Math.sin(Math.PI/4)*r+x, -
Math.sin(Math.PI/4)*r+y);
and
and returns the smaller value.
x
y
Sat Dec 25 00:00:00 GMT-0700 2004
, which is the smaller of
Math.PI
355

Advertisement

Table of Contents
loading

This manual is also suitable for:

Flex

Table of Contents