摘自:http://www.darronschall.com/weblog/archives/000077.cfm
search_btn.onRelease = function() { var filtered = ""; // save the filtered string var current = ""; // current character in keyword // loop over the keyword text string for (var i = 0; i < keywords_txt.text.length; i++) { // only allow 0-9, a-z, A-Z and space.. // filter out everything else current = keywords_txt.text.charAt(i); if (current >= "a" && current <= "z" || current >= "A" && current <= "Z" || current >= "0" && current <= "9" || current == " ") { // add character to filtered text filtered += current; } } // display results to output window trace(filtered); }
As you can see, the revised code look
回复Comments
作者:
{commentrecontent}