7 Replies Latest reply on Nov 21, 2009 7:37 AM by kglad

    Password?!

    Schabloah

      How do i do a password thingy. SO its a little text box and you need to write the right word to go to next page?!

      I use AS 2.

        • 1. Re: Password?!
          kglad Adobe Community Professional & MVP

          textfields have a password property that you can enable.


          where you store and, how you check the password depends on your need for security.  it the password doesn't need to be secure, the easiest thing to do is to store the correct password in the swf and check it against the user's input:

           

          passwordTF.password = true;

          var notsosecretpassword:String = "zxc924u";

           

          submitbutton.onRelease=function(){

          if(passwordTF.text==notsosecretpassword){

          // do whatever.

          } else {

          // do whatever else

          }

          }

          1 person found this helpful
          • 2. Re: Password?!
            Schabloah Level 1

            So i make a dynamisk text... and put the code in the frame?!

            • 3. Re: Password?!
              kglad Adobe Community Professional & MVP

              you don't have to do that.  it's just the easiest and least secure way to use a password in flash.

              • 4. Re: Password?!
                Schabloah Level 1

                DOnt work... maybe its better if i explain more what i want to do:


                You write something in a text box and press enter. Is it the right word you´ll go to next frame...if its wrong?Then  Nothing happens..
                • 5. Re: Password?!
                  kglad Adobe Community Professional & MVP

                  if the code i gave doesn't work for you it's because of something you're doing wrong.  for example, did you code for the enter key to execute the code i gave?

                  • 6. Re: Password?!
                    Schabloah Level 1

                    What am i do

                    ing wrong? I:

                    1.Make a dynamik text box.

                    2.past the code into the frame.

                    What is wrong? Plz help!

                    • 7. Re: Password?!
                      kglad Adobe Community Professional & MVP

                      3.  create a submit button

                      4.  assign it an instance name that matches the name used in the code

                      5.  replace the comments with actions

                      6.  test by entering text and clicking the submit button