Unique SharedObjects for Unique Accounts - AS3

138 Views Asked by At

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!

1

There are 1 best solutions below

2
Marty On

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"
    }
]';