摘自:http://www.darronschall.com/weblog/archives/000077.cfm
search_btn.onRelease = function() {
var filtered = "";
var current = "";
for (var i = 0; i < keywords_txt.text.length; i++) {
current = keywords_txt.text.charAt(i);
if (current >= "a" && current <= "z"
|| current >= "A" && current <= "Z"
|| current >= "0" && current <= "9"
|| current == " ") {
filtered += current;
}
}
trace(filtered);
}
As you can see, the revised code look