1. Open your source movie from the last tutorial. Click on Frame 1 of the
actions layer. On the action panel you will see the script and the
parameters for the script. Erase the value field.
2. With your cursor in the value box, click through the action toolbox
from objects=> core=> Math=> Method=> Floor and double click to move the
script to the value box. This will round whatever is in the brackets
down to the nearest whole number.
3. Click inside the brackets inside the value line. Find the random on
the left action toolbox by Objects=> Core=> Math=> Methods=> Random and
double click to move the script inside the bracket in the value line.
4. If we tested the script now, random numbers generated now will be
between 0 and 1, so when they are rounded down (floor) it will always be
0. We must add a multiplier.
5. While your cursor is still inside the brackets of the Math.floor()
but after the Math.random(), add your multiplier, in this case *100. Your
final script should appear as follows.
randomnumber = Math.floor(Math.random()*100);
6. Your script will now give you numbers from 0 to 99.
7. Try using the different multipliers or 5, 10, 17, 25 to get
different results.
The Next Tutorial will teach you how to round random numbers up.