2 Replies Latest reply on May 11, 2006 8:00 AM by Hoppie

    Password

    Hoppie
      The script below works just fine but I would like the Username & Password NOT be case sensitive. What should I change.


      on (release, keyPress "<Enter>") {
      if (user add pass eq "cf" add "123") {
      getURL("reps_only.html", "_self");
      } else if (user add pass eq "cf" add "456") {
      getURL("reps_only.html", "_self");
      } else {
      gotoAndPlay("failure", "tryAgain");
      }
      }
      on (release, keyPress "<Enter>") {
      user = "";
      pass = "";
      }
        • 1. Re: Password
          TimSymons Level 1
          I am not very familar with the older syntax. However, with the String class you have a method named toLowerCase(). It works like this.

          var myStr:String = "Tim Symons";
          trace(myStr.toLowerCase());

          This would produce: tim symons

          According to the Help Docs this was available in Flash 5. So you might be able to rewrite you code as:

          on (release, keyPress "<Enter>") {
          if ((user+pass).toLowerCase() == "cf123") {
          getURL("reps_only.html", "_self");
          } els if ((user+pass).toLowerCase() == "cf456") {
          getURL("reps_only.html", "_self");
          } else {
          gotoAndPlay("failure", "tryAgain");
          }
          }

          on (release, keyPress "<Enter>") {
          user= "";
          pass= "";
          }

          Tim

          • 2. Re: Password
            Hoppie Level 1
            Thanks this works great. So what this does is convert any upper case to lower case, I like it. Thanks again for responding so quickly.