A Flash Developer Resource Site

Results 1 to 5 of 5

Thread: Please Help! Shared Objects as user passwords

  1. #1

    Please Help! Shared Objects as user passwords

    hey guys...i am totally stumped on this one...here goes:

    flash site that has a login screen...i used Shared Objects to allow the user to save their password when they visit the site (like cookies)...this all works fine...however, to save you all from an exhaustive explanaition of why i did this, there is a log-in page for EVERY individual page on the site (there's roughly 20 in all).

    this way, when the user clicks Log In, it takes them to the specific page they are requesting, instead of just defaulting to the home page (god i hope that made sense).

    so here's the issue:
    for some reason the user info is only being saved on a page-by-page basis...meaning, that if the user clicks to the photos page, logs in and then closes their window...then later, clicks to some other page, their info is not retrieved on this new page...

    i understand that i am using different flash files for each log in page, but its the same script referencing the same shared object (which from what i see creates a .txt file), so it seems like it should work

    here is the code:

    first frame:
    Code:
    stop();
    user_so = SharedObject.getLocal("user");
    if(user_so.data.tname != undefined) {
        gotoAndStop(20);
    }
    on frame 20 (labeled save data):
    Code:
    name_txt.text = user_so.data.tname;
    on the save data button:
    Code:
    on(release) {
        user_so.data.tname = name_txt.text;
        gotoAndStop(20);
    }
    finally, on the last frame which takes them into the site:
    Code:
    stop();
    password = inputName;
    if (password == "flashkit") {
        inputStatus = "Thank You for Logging In!";
        _root.contentLoader.unloadMovie();
        _root.stageContainer.ease(405, 845, "pages/06_01.swf");
        _root.subnavLoader.attachMovie("subNav6", "subNav6_mc", 1);
        _root.subnavLoader.gotoAndStop(2);
    } else {
        inputStatus = "Please Try Again";
    }
    the tutorial i followed is found here:
    http://www.kirupa.com/developer/acti...ed_objects.htm

    basically i just can't figure out how to allow the user to save this password once, and then flash pulls from this data no matter which page they are accessing the site from

    so sorry for long post i am just at a total loss right now...thanks so much for your time!

  2. #2
    Senior Member
    Join Date
    Apr 2006
    Posts
    1,059
    Shared objects are URL dependant
    you would have to use PHP sessions I believe
    [edit] I think, If someone knows otherwise im sure ill be corrected :P

  3. #3
    well that would explain why it doesn't carry through to the othe rpages...any idea or know of a tutorial on how to do that? thanks for the help

  4. #4
    Senior Member
    Join Date
    Apr 2006
    Posts
    1,059

  5. #5
    thanks j, will check those out

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center