简体   繁体   中英

Unique SharedObjects for Unique Accounts - AS3

So, I'm writing a web application in Actionscript 3.0 which uses local shared objects as a sort of registration system.I'm having a problem, I know what's causing it but I don't know how to fix it if that makes sense.. Or I don't know where to start to fix it,

Like I said, I use shared objects to manage the registration/login system (so.data.username, so.data.password) sort of thing.Once you login you create more data, etc. Like unique profiles that sort of thing

So, the problem I want to fix: When I create a new account and login, the same data from the previous account is there, but now I can't login to the old account because the so.data.username has been replaced.You might think I'm an idiot, I know.I know it just changes the username over and over.. but I want to know what route I should take so I can create multiple accounts under the shared object and each account have their own unique data (Profiles, etc)

Thanks!

If you want to create multiple accounts, you could just store JSON against one of the data fields. Something that might end up looking like:

so.data.users = '[
    {
        "username": "Marty",
        "password": "4ec503be252d765ea37621a629afdaa6"
    },
    {
        "username": "Bob",
        "password": "248e844336797ec98478f85e7626de4a"
    }
]';

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM