![]() ![]() ![]() | |
![]() | |
![]() | |
![]() |
Flash Player 6.0.79.
Flash MX 2004.
textAreaInstance
.restrict
Property; indicates the set of characters that a user may enter into the text field. The default value is undefined. If the value of the restrict property is null, a user can enter any character. If the value of the restrict
property is an empty string, no characters may be entered. If the value of the restrict
property is a string of characters, you can enter only characters in the string into the text field; the string is scanned from left to right. A range may be specified using the dash (-).
The restrict
property only restricts user interaction; a script may put any text into the text field. This property does not synchronize with the Embed Font Outlines check boxes in the Property inspector.
If the string begins with "^", all characters are initially accepted and succeeding characters in the string are excluded from the set of accepted characters. If the string does not begin with "^", no characters are initially accepted and succeeding characters in the string are included in the set of accepted characters.
In the following example, the first line of code limits the text field to uppercase letters, numbers, and spaces. The second line of code allows all characters except lowercase letters.
my_txt.restrict = "A-Z 0-9"; // limit control to uppercase letters, numbers, and spaces my_txt.restrict = "^a-z"; // allow all characters, except lowercase letters
![]() | |
![]() | |
![]() | |
![]() ![]() ![]() |