var inputNum:Number = Number(myInputText.text); if(isNaN(inputNum)){ // user input invalid number! }else{ // do math as usual, ex: inputNum * 2; }