0

How can I use restrict option of the TextField class with other languages?

For example for english is simple

var tf:TextField = new TextField();
tf.restrict = "A-Z a-z 0-9 ? . , ; ";

How can I use it to enable to add just basic punctuation characters for example for hebrew or for so cyrilic languages taht use UTF-8 encoding?

is it possible?

Vlad
  • 2,739
  • 7
  • 49
  • 100

2 Answers2

2

You can use the \u escape sequence to construct restrict strings. The following code includes only the characters from ASCII 32 (space) to ASCII 126 (tilde).

 my_txt.restrict = "\u0020-\u007E";

source

J. Holmes
  • 18,466
  • 5
  • 47
  • 52
  • I tried this but still when I change the system locale to some cyrilic lang for example, I cannot write those charaters. It still need to be en_US in order to work. – Vlad Nov 06 '11 at 15:37
0

as an example: Wikipedia "Cyrillic' U+0400 – U+04FF (256 characters) or just "Basic Cyrillic" U+0410 - U+044F. That can save a few minutes :)

user2836288
  • 98
  • 2
  • 9