I am trying to set a numeric code range (versus entering string characters) for the restrict property of a text field. The documentation states that this can be achieved via the unicode escape sequence, such as "\u0030-\u0039". But I cannot get this to work.
Even trying single character such as
<mx:TextInput id="tt" width="100%" restrict="\u0030"/>
is failing. As I understand it, this should only allow the number 0 to be entered, but it does not work. Instead, I am able to enter 0, 3, and u, so the \u seems to be ignored.
Am I missing something simple?
Try using the initialize event to set it from AS code.
<mx:TextInput id=”tt” initialize=”tt.restrict=’\u0030’” /
Holy moly - it works! ... but why? Is this bug in the SDK?
How in the world did you figure this out ?
EDIT: Oh, I missed the "employee" tag
MXML is XML is just text. The compiler has to guess what type to convert the stuff between the “”’s. It guesses right most of the time, but things like this fool it. In AS, there is no guessing.