Random Number Generator Code

Published :
Author :
Adam Khoury
Learn how create a one line code snippet that will create a random number for our script programming needs. Using a random number is handy for many things, especially rndomizing the display of movieclips so your pages always look fresh, new, and exciting. We use the Math.random function wrapped in the Math.floor function to get a rounded number. Then we multiply that number by the number we would like to be our random number maximum value. The instructional video gives great code insight and a little looping trick. The source package has a button operated feature to create the number that way to see it randomize.