啥都不说,直接Demo: inputNum){ Alert.show("文本框只能输入个" + inputNum + "字符"); input.text = text.substr(0,inputNum); } } ]]>