I have this game that has a number of textfields with input and restrictions. These affect things such as the player size and his speed and things like that. For the restrictions, this is what I have:
input.restrict = "0-9\\-\\.";
So the player can include negative numbers and decimals. However, I want the player to be able to add, subtract, multiply and divide as well. And I’m not sure how to add this to the restrictions. If I did something like this:
input.restrict = "0-9\\-\\.\\+";
And I try to type something like “2+3” into the input field, I get NaN.
My question is, is there anyway to actually add operators to the restrictions field?