MACROMEDIA FLASH 8-COMPONENTS LANGUAGE Reference page 1234

Components language reference
Table of Contents

Advertisement

Because you must enter this expression within double quotation marks, you must not only
provide the expression for the restrict interpreter, but you must also escape the Actions panel's
built-in interpreter for double quotation marks. To send the value
to the restrict
0-9\-\^\\
interpreter, you must enter the following code:
myText.restrict = "0-9\\-\\^\\\\";
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
The following example provides three different uses of the
property. The first usage
restrict
restricts input to uppercase characters A through Z, spaces, and numbers. The second usage
allows any characters except the lowercase characters a through z. The third usage allows only
numbers, -, ^, and \.
You must first drag a TextInput component to the Stage and give it an instance name of
; then add the code to Frame 1, using only one of the following
statements at
my_ti
restrict
a time.
/**
Requires:
- TextInput instance on Stage (instance name: my_ti)
*/
var my_ti:mx.controls.TextInput;
// Example 1: Allow only uppercase A-Z, spaces, and digits 0-9.
my_ti.restrict = "A-Z 0-9";
// Example 2: Allow everything EXCEPT lowercase a-z.
my_ti.restrict = "^a-z";
// Example 3: Allow only digits 0-9, dash (-), ^, and \
my_ti.restrict = "0-9\\-\\^\\\\";
1230
TextInput component

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Flash 8

Table of Contents