Hey all,
I've noticed that AS3 doesn't seem to contain a way of defining a minimum amount of characters required but does have a maximum.
Any way to do this with a textfield?
Printable View
Hey all,
I've noticed that AS3 doesn't seem to contain a way of defining a minimum amount of characters required but does have a maximum.
Any way to do this with a textfield?
You're talking about minimum characters in a textfield right? Well you can easily check the length of the text when you actually need to use the text with
If you want a textfield to always have a minimum number of characters inside it, that's a bit of an odd thing to want. There is an event that is triggered whenever a user presses a key inside a textfield but it triggers before the textfield is altered by the user's key. I think it's TextEvent.TEXT_INPUT. With that you can check if the textfield will still have the minimum length after it's altered. But again I don't see any reason to want this.PHP Code:var len:int = yourTextField.text.length;
Hey I'm sure this would work but how could I use it to check when the player pushes the submit button to send their name by a dispatched event that their's something written in the text field entered.
EDIT: Used it in a if statement and finally got there, thank you.