Random Numbers: Math.Random()
If your movie does not work properly, check the following:
Download the movie
- In the action window click the blue check mark to check the syntax.
- If there are any syntax errors, double click the error in the complier error window to highlight the line with the error in the action window.
- Fix all syntax errors.
- Make sure that all names match both in spelling and case: rolldice is NOT the same as rollDice.
- Make sure that the button is named btnRoll and that you used the same name in the code to add the event listener.
- Make sure that the dice are named die1 and die2.
- If the movie works, but the two die always have the same number, make sure that you did not skip the line where n is given a new value.
- Check the Die movie clip to make sure that each frame shows the right number of dots and has the square background.