MACROMEDIA FLASH MX 2004 - ACTIONSCRIPT Reference Manual page 699

Actionscript reference guide
Hide thumbs Also See for FLASH MX 2004 - ACTIONSCRIPT:
Table of Contents

Advertisement

TextField.replaceText()
Availability
Flash Player 7.
Usage
my_txt.replaceText(beginIndex, endIndex, text)
Description
Method; replaces a range of characters, specified by the
the specified text field with the contents of the
TextField.restrict
Availability
Flash Player 6.
Usage
my_txt.restrict
Description
Property; indicates the set of characters that a user may enter into the text field. If the value of the
property is
restrict
an empty string, you can't enter any character. If the value of the
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 (-). This 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.
Example
The following example allows only uppercase characters, spaces, and numbers to be entered into
a text field:
my_txt.restrict = "A-Z 0-9";
The following example includes all characters, but excludes lowercase letters:
my_txt.restrict = "^a-z";
You can use a backslash to enter a ^ or - verbatim. The accepted backslash sequences are \-, \^ or
\\. The backslash must be an actual character in the string, so when specified in ActionScript, a
double backslash must be used. For example, the following code includes only the dash (-) and
caret (^):
my_txt.restrict = "\\-\\^";
, you can enter any character. If the value of the
null
and
beginIndex
parameter.
text
restrict
parameters, in
endIndex
property is
restrict
property is a string of
TextField.restrict
699

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the FLASH MX 2004 - ACTIONSCRIPT and is the answer not in the manual?

Questions and answers

Subscribe to Our Youtube Channel

Table of Contents