1. Use of restrict property. The following example allows only numeric input
<mx:TextInput id="textInput" restrict="0-9\-" />
2. Use of unicodeRange style property inside CSS (stylesheet) while embedding fonts. The following example restricts all special symbols except period sign(.).
@font-face { src:url("../assets/myFont.ttf"); fontFamily: myFontFamily; flashType: true; unicodeRange: U 0041-U 005A, /* Upper-Case [A..Z] */ U 0061-U 007A, /* Lower-Case a-z */ U 0030-U 0039, /* Numbers [0..9] */ U 002E-U 002E; /* Period [.] */ }
3. Use of Flex built in validator components. Following example calls handleValid and makes it sure that user does not leave inputComponent blank.
<mx:Validator id="reqValid" required="true" source="{inputComponent}" property="text" valid="handleValid(event)" invalid="handleValid(event)"/>
0 Comments.