Sqrt1_2 (Math.sqrt1_2 Property); Sqrt2 (Math.sqrt2 Property) - MACROMEDIA FLASH 8-ACTIONSCRIPT 2.0 LANGUAGE Reference

Actionscript 2.0 language reference
Table of Contents

Advertisement

this.newY = _ymouse;
var minY = Math.min(this.origY, this.newY);
var nextDepth:Number = canvas_mc.getNextHighestDepth();
var line_mc:MovieClip =
canvas_mc.createEmptyMovieClip("line"+nextDepth+"_mc", nextDepth);
line_mc.moveTo(this.origX, this.origY);
line_mc.lineStyle(2, 0x000000, 100);
line_mc.lineTo(this.newX, this.newY);
var hypLen:Number = Math.sqrt(Math.pow(line_mc._width,
2)+Math.pow(line_mc._height, 2));
line_mc.createTextField("length"+nextDepth+"_txt",
canvas_mc.getNextHighestDepth(), this.origX, this.origY-22, 100, 22);
line_mc['length'+nextDepth+'_txt'].text = Math.round(hypLen) +" pixels";
};
Mouse.addListener(mouseListener);

SQRT1_2 (Math.SQRT1_2 property)

public static SQRT1_2 : Number
A mathematical constant for the square root of one-half, with an approximate value of
0.7071067811865476.
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.
Example
This example traces the value of
trace(Math.SQRT1_2);
// Output: 0.707106781186548

SQRT2 (Math.SQRT2 property)

public static SQRT2 : Number
A mathematical constant for the square root of 2, with an approximate value of
1.4142135623730951.
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.
Example
This example traces the value of
trace(Math.SQRT2);
// Output: 1.4142135623731
760
ActionScript classes
Math.SQRT1_2.
Math.SQRT2.

Hide quick links:

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the FLASH 8-ACTIONSCRIPT 2.0 LANGUAGE and is the answer not in the manual?

This manual is also suitable for:

Flash 8

Table of Contents

Save PDF