Everytime I try to modify my restrict characters I run into problems, so I
don't think I'm understanding it well. My understanding was that I need to use
a \ character before another character to escape it in AS3. However, since I'm
using an AS3 variable in a bind expression for mxml, perhaps this changes the
way I need to escape characters. Here's my current code:
My mxml code has:
restrict=" { AppController.RESTRICT_CHARS } "
and the AppController singleton has:
public static const RESTRICT_CHARS:String= "\&\"0-9
a-zA-Z'~!@#$%*()\\-_+=[]\\|;:<>./?{}^," ;
This code has a problem when I run it where I cannot enter a comma character.
Also, I found my trial an error that I needed two \\ to escape the minus sign
(not sure why... do I need two \\ when I escape other characters?). Also, I
found that I needed to place the \& at the start of the string (if in the
middle it has no effect). I must be doing something wrong. Any help much
appreciated.