There's a few things I'd like to do, but let me explain some background first:
In Calculus, we've been playing this logic game, where a person thinks of a 4-digit number, using integers 0-9, numbers allowed to be repeated. Let's say for example the number is 6920. If the person's first guess is 2470, they'd only have one number right, and another in the wrong position, a right number in the right position is indicated by a circle, and right in the wrong position is indicated by a dash, so we draw a square with 4 quadrants and apply necessary circles or dashes:
____
|O| -|
|___|
So let's say their second guess was 6902, meaning that they got 2 numbers correct, and two in the wrong position, so we'd make our square again:
____
|O|O|
| -| - |
And they only have ten turns to guess correctly.
What I need to know how to do (using AS3) are these things:
1) How to make flash generate a random number between 0000, and 9999. I think I may have already gotten that down though.
Math.floor(Math.random() * (9999 - 0000)) + 0000;
2) Then, after the user puts a number in, check if it's only 4 characters between 0000 and 9999.
3) Compare user input number to random number generated.
4) Apply circles and dashes as applicable to boxes.
Thanks in advance!