5 Replies Latest reply on Mar 15, 2010 4:54 PM by kglad

    Can't strip whitespace or returns


      Hello. I am an illustrator and animator. I have few ActionScript skills. But I have built a multimedia career by stealing chunks of AS2 code and reworking them to suit my purpose.

      I have searched long and hard here for a solution to my current problem. I have found code here that seems to address it, but I cannot make it work.

      I simply have some textAreas that I wish to validate. The user may input text that could include extra spaces, returns, and odd capitalization. It would be easiest for me to simply strip out the capitals, spaces and returns. I found some simple code that changed the caps to lowercase:

      Actionscript Code:
      on (release) {
          if (_root.myTextAreaInstance.text.toLowerCase() == "sample") {
              setProperty(_root.yes, _visible, true);
          } else {
              setProperty(_root.no, _visible, true);


      Awesome. But I can't strip spaces or returns.


      If anyone can offer a simple solution, I would appreciate it very much.