I made a sudoku Flash-based application. I’ve got most of the features that I’d like to implement working, but I’m having problems with one part of it. There are four difficulty levels, and will be 10 puzzles per level. Right now, the answers are hard-coded in, but eventually I’d like to put in some database connectivity. Anyway, since there are different puzzles there are a varying amount of user-input fields. Some puzzles will have 45, some 32, etc.
I have a listener event that detects when a user types anything in a field and changes the text size based on the value they input. If they input only one value (1 - 9) the text size changes to 36, if they enter more than one value (it’d be greater than 9), the text size is set to 16.
Right now it only works on one of the boxes. The boxes all have different names, from user_01 - user_46 (in this example). Is there any way to get this function to work on all the boxes without writing a seperate function for each of them?
myFormat = new TextFormat();
myFormat.size = 16;
myFormatTwo = new TextFormat();
myFormatTwo.size = 36;
user_01.onChanged = function ()
{
if (user_01.text > 9)
{
user_01.setTextFormat(myFormat);
}
else
{
user_01.setTextFormat(myFormatTwo);
}
}
Thanks in advance!!