âš ī¸ Warning âš ī¸ Deprecated Code! This video tutorial contains outdated code.
💡 If you wish to update it, any AI assistant will update the code for you in seconds.

Random Number Generator Code

Published : November 14, 2014   •   Last Edited : November 24, 2025   •   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.