0

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!

user1666767
  • 117
  • 3
  • 13

1 Answers1

0

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"
    }
]';
Marty
  • 39,033
  • 19
  • 93
  • 162
  • @user1666767 Ignore the last part. Does the JSON approach work for you? – Marty Jul 11 '13 at 00:31
  • I don't really get the problem. In AS3 if you have a Class defined that has an array of objects you should have no problem serializing or deserializing that object and maintaining all values in the array. – shaunhusain Jul 11 '13 at 00:43