4 Replies Latest reply on Apr 20, 2006 10:17 AM by PepperKev

    Help with a password field

    PepperKev Level 1
      I have a Flash site I'm working on that has a private login area. The login is not meant to be high security, we just want to limit access to current and potential clients who we give a password to. Here is the site in progress.

      What I need help with is the client login window. The login field is in a pop-up when you mouse over the word "client login." The temp password is forumdemo. When you use the button after typing in the password, everything is fine. But when you use the enter key, it initiates the "incorrect' action every time, even if the password is correct.

      This is driving me crazy because when I originally built the login box as an entirely separate movie, the enter key worked fine. If you want to see it working, just click on the "client login" words rather than using the pop-up box.

      The code is the same in both. The only difference is that the password field, button and other elements are now a Movie Clip.

      Anybody have any thoughts? The scripts are below; developed with the help of people on this forum (thanks!).

      Ignore everything else - the content is not finalized. The final site will be our company website, with work samples and the like, and the main page will include a working demonstration of what we can do with Flash 8 and green screen video. We haven't finished that stuff yet.
        • 1. Re: Help with a password field
          blemmo Level 1
          This could be a path error. Try tracing the value of _root.password.text in the enter key event and see if that shows the input. I guess that the path is not _root.password, because you write of a MovieClip that contains the textfield. If the button with the key press code is in the same MC as the textfield, you could use this._parent.password instead, or add the name of the MC, like _root.loginMC.password.

          hth,
          blemmo
          • 2. Re: Help with a password field
            PepperKev Level 1
            I tried. it didn't quite do it.

            I don't know how to trace the value of things, I'm still lurnin', but what I did do, is replace the _root.password.text with all of the following
            _parent.password.text
            _parent.loginPopup.password.text
            _root.loginPopup.password.text
            _root.loginPopup.password

            I'm sorry to say none of them fixed the problem, and I think my problem is that I don't know what you mean by tracing the value. Well, I know what you mean, but I don't know how to do it. I'll dig into the documentation, but if you or anyone has an easy answer, I'll take it!

            Thanks, I appreciate your help and all the help I've gotten on this forum building that site.
            • 3. Re: Help with a password field
              blemmo Level 1
              Look up the trace() method, this is a good way to debug scripts. There's also the debugger you could use, but this needs some time to understand, and a simple trace should help here.
              Use it like this:
              if (Key.isDown(Key.ENTER)) {
              trace(_root.password.text);
              // other stuff
              }
              If the output is "undefined", the var doesn't exist (probably), which means that the path may be wrong.
              If there's no output at all, check the Publish Settings if "omit trace actions" is checked. It should be unchecked to get results.
              • 4. Re: Help with a password field
                PepperKev Level 1
                thanks for your help, I got it working. It was the Path issue, you were bang on. I changed the path to simply (password.text) and that did it, and the trace function helped me narrow it down.

                Now I have a new problem. The text field won't accept input if you're using a Safari browser. It seems fine everywhere else. And this didn't happen before I fixed the Enter key. Anybody ever heard of that?

                I've moved it from the above location, in case anyone is interested. It's now here and the password is corporate. The password area is not developed yet, so don't mind the mess.

                Thanks!