Skip navigation
CRAAZYGENIUS
Currently Being Moderated

LOGIN FUNCTION

Aug 31, 2012 9:52 PM

Will anyone please help me create a LOGIN FUNCTION ON MY FLASH QUIZ. So that the user's name is displayed within the game. THIS IS OFFLINE by the way. Also the user is a able to create a username and password.

 
Replies
  • kglad
    62,048 posts
    Jul 21, 2002
    Currently Being Moderated
    Sep 1, 2012 6:41 AM   in reply to CRAAZYGENIUS

    if it's offline, what's the purpose of the password?

     
    |
    Mark as:
  • kglad
    62,048 posts
    Jul 21, 2002
    Currently Being Moderated
    Sep 1, 2012 9:41 AM   in reply to CRAAZYGENIUS

    assign the login textfield's text to a variable.  that variable will exist even after you remove your textfield and can be shared throughout your app.

     

    you could also use the sharedobject so the user only needs to login once.  thereafter their login would be retrieved from the sharedobject.

     
    |
    Mark as:
  • kglad
    62,048 posts
    Jul 21, 2002
    Currently Being Moderated
    Sep 1, 2012 11:07 AM   in reply to CRAAZYGENIUS

    what's your login textfield's instance name?

     
    |
    Mark as:
  • kglad
    62,048 posts
    Jul 21, 2002
    Currently Being Moderated
    Sep 1, 2012 3:42 PM   in reply to CRAAZYGENIUS

    attached to the first keyframe that contains login_user, use:

     

    var so:SharedObject = SharedObject.getLocal("login");

    if(so.data.login){

    login_user._visible=false;

    // skip the login.  user has already stored their user name

    }

     

    // if you have your user click a button to login after enter their name in login_use, use the following in that button's onRelease code:

     

    so.data.login=login_use.text;

    so.flush();

     

    // whenever you want to use the login name from the scope of the sharedobject so, use:

     

    so.data.login

     

    // if you're outside that scope, you can always use:

     

    var so:SharedObject=SharedObject.getLocal("login");

    so.data.login

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points