The
property restricts only user interaction; a script may put any text into the text
restrict
field. This property does not synchronize with the Embed Font Outlines check boxes in the
Property inspector.
Example
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";
my_txt.restrict = "^a-z";
The following code allows a user to enter the characters "0 1 2 3 4 5 6 7 8 9 - ^ \" in the instance
. You must use a double backslash to escape the characters
myText
the double quotation marks, and the second
not be treated as a special character.
myText.restrict = "0-9\\-\\^\\\\";
TextInput.text
Availability
Flash Player 6 (6.0 79.0).
Edition
Flash MX 2004.
Usage
textInputInstance.text
Description
Property; the text contents of a TextInput component. The default value is
Example
The following code places a string in the
Output panel:
myTextInput.text = "The Royal Nonesuch";
trace(myTextInput.text); // traces "The Royal Nonesuch"
tells the interpreter that the next character should
\
instance, and then traces that string to the
myTextInput
,
, and \. The first
-
^
\
(an empty string).
""
TextInput component
escapes
755
Need help?
Do you have a question about the FLASH MX 2004-USING COMPONENTS and is the answer not in the manual?
Questions and answers