EasyManua.ls Logo

MACROMEDIA FLASH 8-FLASH LITE 2.X ACTIONSCRIPT LANGUAGE - Sin (Math.sin Method)

MACROMEDIA FLASH 8-FLASH LITE 2.X ACTIONSCRIPT LANGUAGE
780 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...
426 ActionScript classes
Example
The following example returns a random number between two specified integers.
function randRange(min:Number, max:Number):Number {
var randomNum:Number = Math.round(Math.random() * (max-min+1) + (min-
.5));
return randomNum;
}
for (var i = 0; i<25; i++) {
trace(randRange(4, 11));
}
See also
ceil (Math.ceil method), floor (Math.floor method)
sin (Math.sin method)
public static sin(x:Number) : Number
Computes and returns the sine of the specified angle in radians. To calculate a radian, see the
description of the Math class entry.
Availability: ActionScript 1.0; Flash Lite 2.0 - 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 that represents an angle measured in radians.
Returns
Number - A number; the sine of the specified angle (between -1.0 and 1.0).

Table of Contents

Related product manuals