Flex TextInput dynamically infer input content

Source: Internet
Author: User

Flex TextInput dynamically infer input content

<?

XML version= "1.0" encoding= "Utf-8"? ><s:application xmlns:fx= "http://ns.adobe.com/mxml/2009" xmlns:s= "library ://ns.adobe.com/flex/spark "xmlns:mx=" library://ns.adobe.com/flex/mx "minwidth=" 955 "minHeight=" "&GT;&LT;FX": script><! [Cdata[import spark.events.textoperationevent;[ bindable]private var errorstr:string = "";p rotected function Numinput_changehandler (event:textoperationevent): void{ var exp:regexp=/[\d,,]/g;var inputtext:string = numinput.text+ ";" if (inputtext== ") {return;} if (Inputtext.match (/[. ,]$/)) {Inputtext = inputtext.substring (0,inputtext.length-1);} var temp:string = Inputtext.replace (exp, '), var Isright:boolean = true;if (temp== ") {var Arr:array = Inputtext.split (/[, ,]/); for (var i:int =0;i<arr.length;i++) {var onenum:string = arr[i];if (Onenum==null | | (onenum+ ") = =") {isright = false;}}} Else{isright = false;} if (isright) {numinput.setstyle (' bordercolor ', ' black '); alarmlabel.visible = false;} Else{numinput.setstyle (' bordercolor ', ' 0xFF0000 '); alarmlabel.visible= true;}]] ></fx:script><fx:declarations></fx:declarations><s:hgroup width= "100%" height= "30" Horizontalalign= "left" paddingleft= "5" paddingright= "5" verticalalign= "Middle" ><s:label width= "text=" Number: " Textalign= "right"/><s:textinput id= "Numinput" width= "$" change= "Numinput_changehandler (event)" ErrorString = "{errorstr}"/><s:spacer width= "/><s:label id=" Alarmlabel "visible=" false "color=" 0xFF0000 "text=" Simply agree to enter the numbers "," separated "/></s:hgroup></s:application>


Flex TextInput dynamically infer input content

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.