Search code examples
actionscript-3flex4restrictflashplayer-10

How to use restrict option with other languages


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?


Solution

  • 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