random( ) Global Function

ActionScript for Flash MX: The Definitive Guide, 2nd Edition
By Colin Moock
Chapter 18.  ActionScript Language Reference
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( )



    ActionScript for Flash MX. The Definitive Guide
    ActionScript for Flash MX: The Definitive Guide, Second Edition
    ISBN: 059600396X
    EAN: 2147483647
    Year: 2002
    Pages: 780
    Authors: Colin Moock

    flylib.com © 2008-2017.
    If you may any questions please contact us: flylib@qtcs.net