text: Q:
  
  space-bar increments string value
  
  how to handle space-bar in taking input from user in a string.my code is
  btnSearch.addEventListener(MouseEvent.CLICK, getData);
  function getData(event:MouseEvent)
  {
     var input:String = textfieldName.text; 
     if((input != null)&&(input.length != 0)&&(input != "")) 
     { 
         func(input); 
     } 
  }
  
  when user hits backspace, func is called and input string length increased as many times as the spacebar is clicked.
  
  A:
  
  what you have to di first is to validate the input, e.g. you can trim all white space (you could also do it on the textfield e.g. by applying the allowed characters to the restrict property
  textfieldName.restrict = "0-9";//this will restrict to only integer values
  
  to strip in your getData handler you could do as follows:
  //trim begin
  while(input && input.charAt(0) == " ")
  {
      input = input.substr(1);
  }
  
  placed after you read the input value from textfield.
  best regards
  
  