Dynamically changing fill colour in Flash 8

I have drawn a rectangular box with lineTo and filled it with orange colour using beginFill. I want the colour to change as user inputs values, like red for 2, green for 3, etc. upto say 10. Also, I want the previous colour to clear off for the new colour to come in. Thank you.