Simple Login Page

  • dferraro40
  • Beginner
  • Beginner
  • No Avatar
  • Joined: Apr 22, 2006
  • Posts: 52
  • Loc: Massachusetts
  • Status: Offline

Post May 14th, 2006, 5:37 pm

I am no action script exspert so please bare with me. I am building a password protected flash movie. I want to make it so that only certain people can access a section of my site with a user name and password. I have one user right now called Dave and Password Dog. What i would like to do is if someone enters in a username and password OTHER than Dave\Dog i want a message to display and say "Wrong User Name or Password". This is what i have so far and it works fine.

Code: [ Download ] [ Select ]
if (username==null & password==null) {
        mess = "Plaes Enter User Name and Password"
        }

if(username == "Dave" & password== "Dog" ){
        mess = "Welcome " + username;
                 gotoAndPlay(2);
  1. if (username==null & password==null) {
  2.         mess = "Plaes Enter User Name and Password"
  3.         }
  4. if(username == "Dave" & password== "Dog" ){
  5.         mess = "Welcome " + username;
  6.                  gotoAndPlay(2);


I just want to add something so that if they put in wrong user name or password it with tell them. So if username and password dont equal Dave and Dog then mess = "Wrong User Name or Password";
[/code]
  • Anonymous
  • Bot
  • No Avatar
  • Joined: 25 Feb 2008
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post May 14th, 2006, 5:37 pm

  • cristake
  • Novice
  • Novice
  • No Avatar
  • Joined: May 23, 2006
  • Posts: 23
  • Status: Offline

Post May 24th, 2006, 11:11 am

use variables
thats all i know , sorry
knoob in actionscript
  • roarmeow
  • Professor
  • Professor
  • User avatar
  • Joined: Oct 12, 2004
  • Posts: 861
  • Loc: BKNY
  • Status: Offline

Post May 25th, 2006, 1:15 pm

first off, those "&"s should be doubled up (ie. &&) and you could have it all be like:

Code: [ Download ] [ Select ]
if((username=="Dave") && (password == "Dog")){
mess = "Welcome" + username;
gotoAndPlay(2);}
else{
if((username==null) && (password==null)){
mess = "Please Enter User Name and Password";}
else{
mess = "Wrong User Name or Password";}
}
  1. if((username=="Dave") && (password == "Dog")){
  2. mess = "Welcome" + username;
  3. gotoAndPlay(2);}
  4. else{
  5. if((username==null) && (password==null)){
  6. mess = "Please Enter User Name and Password";}
  7. else{
  8. mess = "Wrong User Name or Password";}
  9. }


or something like that... that's just off the top of my head

Post Information

  • Total Posts in this topic: 3 posts
  • Users browsing this forum: No registered users and 45 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
 

© 2010 Unmelted, LLC. Driven by phpBB © 2010 phpBB Group.