Copy link to clipboard
Copied
Is there a way to build, load, save a database with flash? I saw many examples that store one record, and one that made an SQL but it was in AIR and there was a thread about the same thing with it butthe answer then was no.
Copy link to clipboard
Copied
I made corrections and tried the code you showed, but I still do not see how you can store than one record of data to the local host using shared object. It seems ;like I would have to make a separate file for each student. Am I wrong?
Copy link to clipboard
Copied
You can store an array of objects... that is all you should need.
Copy link to clipboard
Copied
one file (so) for all your data is all you need.
use an identifier (a student id would be ideal because it's likely to be unique whereas names can be the same) to save and retrieve all data associate with each student:
again from message 18:
so.data[student_id]={name:studentname,schedule:notsurewhatkindofdatathisis,grade:whatevergrade, etc:..., etc:...};
if you don't understand how this last line works, ask.
Copy link to clipboard
Copied
Thank you both, It worked. Tried to mark it correct in discussion, but couldn't.
Copy link to clipboard
Copied
you're welcome.
Copy link to clipboard
Copied
Follow up question, I ran a program that place values in a shared object file, but when I turned off the computer and then turned it back on and ran the program to see the values they were gone. Does the file cease to exist once the computer is turned off? the program is as follows:
import flash.net.SharedObject;var so:SharedObject=SharedObject.getLocal("student-data","/");
//so.data[1]=;
//so.data[2]=;
//so.data[3]=;
for (var i:String in so.data)
{
trace(i +" " + so.data.sname " " so.data.grade);
}
Thank you.
Copy link to clipboard
Copied
Please disregard the follow up question, I realized that you do need to use the flush command to save to disk. Again, thank you.