PDA

Click to See Complete Forum and Search --> : methods of data storage



pepperman
11-08-2004, 07:57 PM
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.

SJT
11-10-2004, 06:15 AM
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.
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.

pepperman
11-10-2004, 02:58 PM
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.

k-mark
12-10-2004, 01:32 PM
is there a way to do this?

pepperman
12-14-2004, 05:55 PM
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

k-mark
12-15-2004, 10:26 AM
thanks for the reply. I'm going to look into the sharedobject route of things.

Keep me updated if you have any progress!

-Mark

brentW505
12-16-2004, 02:47 PM
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?

k-mark
12-16-2004, 04:29 PM
i'm pretty sure shard objects have a size limit of 100k

here is a tutorial for you:

http://www.flash-db.com/Tutorials/saving/savingData.php?page=3