Table of Contents

random( ) Global Function Flash 4; deprecated in Flash 5 in favor of Math.random( )

generate a random number
random(number)

Arguments

number

A positive integer.

Returns

A random integer between 0 and number - 1 (inclusive).

Description

The deprecated random( ) function was used in Flash 4 to generate random numbers. This function has been retired from the language and is available only for the sake of backward compatibility. In Flash 5 and later, use the preferred Math.random( ) method. Note that random( ) generated integers from 0 to number - 1, whereas Math.random( ) generates floats from 0.0 to .999.

See Also

Math.random( )


Table of Contents