• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Is there a way to build, load, save a database with flash?

Community Beginner ,
Aug 22, 2015 Aug 22, 2015

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.

TOPICS
ActionScript

Views

1.9K

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Aug 27, 2015 Aug 27, 2015

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? 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Enthusiast ,
Aug 27, 2015 Aug 27, 2015

Copy link to clipboard

Copied

You can store an array of objects... that is all you should need.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Aug 27, 2015 Aug 27, 2015

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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Aug 27, 2015 Aug 27, 2015

Copy link to clipboard

Copied

Thank you both,  It worked.  Tried to mark it correct in discussion, but couldn't.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Aug 27, 2015 Aug 27, 2015

Copy link to clipboard

Copied

you're welcome.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Aug 28, 2015 Aug 28, 2015

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. 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Aug 28, 2015 Aug 28, 2015

Copy link to clipboard

Copied

LATEST

Please disregard the follow up question,  I realized that you do need to use the flush command to save to disk.  Again, thank you.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines