03.05.2013 Views

FLASH® LITE™ 2.x - Adobe Help and Support

FLASH® LITE™ 2.x - Adobe Help and Support

FLASH® LITE™ 2.x - Adobe Help and Support

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

var hypLen:Number = Math.sqrt(Math.pow(line_mc._width,<br />

2)+Math.pow(line_mc._height, 2));<br />

line_mc.createTextField("length"+nextDepth+"_txt",<br />

canvas_mc.getNextHighestDepth(), this.origX, this.origY-22, 100, 22);<br />

line_mc['length'+nextDepth+'_txt'].text = Math.round(hypLen) +" pixels";<br />

};<br />

Mouse.addListener(mouseListener);<br />

SQRT1_2 (Math.SQRT1_2 property)<br />

public static SQRT1_2 : Number<br />

A mathematical constant for the square root of one-half, with an approximate value of<br />

0.7071067811865476.<br />

Example<br />

This example traces the value of Math.SQRT1_2.<br />

trace(Math.SQRT1_2);<br />

// Output: 0.707106781186548<br />

SQRT2 (Math.SQRT2 property)<br />

public static SQRT2 : Number<br />

A mathematical constant for the square root of 2, with an approximate value of<br />

1.4142135623730951.<br />

Example<br />

This example traces the value of Math.SQRT2.<br />

trace(Math.SQRT2);<br />

// Output: 1.4142135623731<br />

tan (Math.tan method)<br />

public static tan(x:Number) : Number<br />

Computes <strong>and</strong> returns the tangent of the specified angle. To calculate a radian, use the<br />

information outlined in the introduction to the Math class.<br />

Parameters<br />

x:Number - A number that represents an angle measured in radians.<br />

Returns<br />

Number - A number; tangent of parameter x.<br />

392 ActionScript classes

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!