4 Replies Latest reply on Oct 16, 2007 11:39 AM by kglad

    Username & Password Protection

    lukeduke7 Level 1
      I have a script I have found and slightly modified to help me achieve a user name and password protection for a flash file. I understand there is no way to ensure protection of flash files. Fortunetly for me I am looking to add protection to filter out people in a company browsing around the server or other instances.

      My question is: How can I add another username and password to the script below?

      I have played with it a little and could add a username and password behind the ones listed, but ofcourse all that enables is another username and password option. I would want to use employees "employee number" and their password to enter the flash material. Basically right now I have only one username that matches its particular password. I want to add other users that match thier specific passwords.

      I'm sure there are better ways to go about this and am open to them. I don't know much other scripting but can pick up on it. I would like to hopefully do it in flash, considering there won't be many people haveing "access". Maybe .xml could be set up and go from there. I have little experience with xml but have researched and done a few tutorials with it in flash.

      Any help or ideas are greatly appreciated.

      Thanks
      Luke
        • 1. Re: Username & Password Protection
          lukeduke7 Level 1
          I have also tried setting up an Interval in hopes that when enter is pressed it would go to function webCheck, look at the password, perform its action, and then clear the interval. I did this because I used the same exact code with a different username and password setting, but it would work. I set up a different interval for that set of code and it worked.... sort of. It would only accept the second username and password i listed in the script, in essance, I was back to where I started.

          Maybe none of that makes sense. Thought I'ld give it a shot.
          • 2. Re: Username & Password Protection
            kglad Adobe Community Professional & MVP
            if you're going to have more than a few usernames/passwords and/or the usernames/passwords will need to be updated periodically, you should probably use an xml file to store the usernames/passwords.

            you will loop through all usernames to look for a match with the entered username. if there's a match you will then check the corresponding password to see if that matches the entered password. if both those match you should load the swf that you want to protect.
            • 3. Re: Username & Password Protection
              lukeduke7 Level 1
              Thanks kglad for the reply.

              I thought .xml would probably be the best way to go and in the long run be the easiest to update and keep track of info. However, my knowledge is pretty limited at this point. I know I could probably put together the xml info. To have Flash loop through all usernames to look for a match with the entered username and then if there's a match, have it check the corresponding password to see if that matches the entered password is exactly what I want it to do, but don't know how.

              So, for now, I am probably over my head. Although I have been there plenty of times before.
              Thanks again for the reply.

              Luke
              • 4. Re: Username & Password Protection
                kglad Adobe Community Professional & MVP
                you're welcome.

                this will get you started: