A Flash Developer Resource Site

Results 1 to 8 of 8

Thread: methods of data storage

Hybrid View

  1. #1
    Junior Member
    Join Date
    Oct 2004
    Location
    Edmonton, Canada
    Posts
    14

    methods of data storage

    Hey,
    I'm making a fairly user interactive .fla that tracks:
    1. each time the user logs on
    2. results of how well they perform in the .fla
    3. probably a couple more user options that I think of later in development

    Any good ideas, ref books, info sites, etc... that might give me some ideas about where/how I can store the data? The only thing that comes to mind is .txt files or saving to somewhere in the hard drive. Once I figure out where/how to store the data for each user, the data will need to be displayed in graph form to visually display the user's performance over several days/months. Just fishin' for ideas from any gurus out there.

  2. #2
    Senior Member SJT's Avatar
    Join Date
    Mar 2000
    Location
    London, UK
    Posts
    2,563
    I think what you're looking for is the SharedObject, you can create a local shared object which acts just like a cookie.

    Assigning values to a sharedObject is just the same as how you'd assign values to a variable.
    code:
    var items_array:Array = new Array(101, 346, 483);
    var currentUserIsAdmin:Boolean = true;
    var currentUserName:String = "Ramona";

    var my_so:SharedObject = SharedObject.getLocal("superfoo");
    my_so.data.itemNumbers = items_array;
    my_so.data.adminPrivileges = currentUserIsAdmin;
    my_so.data.userName = currentUserName;



    These values are then written to disk.
    Sam



  3. #3
    Junior Member
    Join Date
    Oct 2004
    Location
    Edmonton, Canada
    Posts
    14
    SJT,
    I shoulda been clearer. My application will be stand alone and I think I need something more like a .txt file to store the data in a directory within a single folder that has encapsulates everything, including the .fla.

    Students will
    1. enter their name
    2. choose one of four options
    3. navigate through a game by choosing "yes" or "no" options (with the use of r and l arrow keys).

    I've got simple variables that capture all of this data currently, and then display it at the finish, but that data is lost once I run the .fla a second time.

    I need a way to store data for each of the points above (likely in a .txt file that I can later import into Excel or a graphing program to display their results).

    How do I initialize an array (maybe I don't need an array?) in Flash and send the final data to write to the .txt file? Is there a function in Flash that can give a time/date identity, rather than have the user enter the time/date themselves?
    I've attached my file in case it helps.
    Attached Files Attached Files

  4. #4
    Junior Member
    Join Date
    Mar 2004
    Posts
    13
    is there a way to do this?

  5. #5
    Junior Member
    Join Date
    Oct 2004
    Location
    Edmonton, Canada
    Posts
    14
    K-Mark,

    What I've found so far is Flash is really web-based and as such there are really only 2 ways to approach my issue (which I haven't solved yet, but am in the process of working on)
    1. Use the SharedObject like a cookie and save data that way or...
    2. Set up a server and then get your Flash project write data back to a server using LoadVars command (then your server does all the tough stuff that Flash isn't so good at doing)

    .txt files won't work well with Flash unless the .txt files are handled by the server.

    Hope this doesn't discourage you too much (like I said, I'm still pluggin' away at it).

    pepperman

  6. #6
    Junior Member
    Join Date
    Mar 2004
    Posts
    13
    thanks for the reply. I'm going to look into the sharedobject route of things.

    Keep me updated if you have any progress!

    -Mark

  7. #7
    Senior Member
    Join Date
    Jun 2003
    Location
    La Mirada California
    Posts
    396
    hey... i was just wondering the same thing... im creating software that i need to be able to store users info in... would the shared object be a good way?... i guess thats the only way i could do it...

    shared objects jus creates a file in the directory of the swf?...

    know a good tutorial on shared objects anyone?

    oh... and would shared objects work good with something that would need to store maybe up to hundreds of user info?
    Last edited by brentW505; 12-16-2004 at 02:51 PM.

  8. #8
    Junior Member
    Join Date
    Mar 2004
    Posts
    13
    i'm pretty sure shard objects have a size limit of 100k

    here is a tutorial for you:

    http://www.flash-db.com/Tutorials/sa...ata.php?page=3

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