• 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.7K

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 22, 2015 Aug 22, 2015

Copy link to clipboard

Copied

are you creating an air app, projector or web-based app?

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 22, 2015 Aug 22, 2015

Copy link to clipboard

Copied

First I want to build a web based app.

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 22, 2015 Aug 22, 2015

Copy link to clipboard

Copied

you'll need to create the database using your web host controls and you'll need server-side code (eg, php) to connect your swf to your database.

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 22, 2015 Aug 22, 2015

Copy link to clipboard

Copied

Thank you.  I'm not quite ready for that how would I do it so the data would be stored locally, such as a projector app.

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 22, 2015 Aug 22, 2015

Copy link to clipboard

Copied

it's more difficult with a projector, but easier with air.

before you go too far though, maybe you can get by with a sharedobject to store data.

what kind of data do you need to store?

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 22, 2015 Aug 22, 2015

Copy link to clipboard

Copied

I was planning to store names, ID numbers, schedules and grades, ie. student info for approx. 150.

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 22, 2015 Aug 22, 2015

Copy link to clipboard

Copied

if you want a database of different users of your app, you'll need to use a web-based database and that's more complicated.

there's no easy solution for what you want.

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 22, 2015 Aug 22, 2015

Copy link to clipboard

Copied

Okay, 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
Enthusiast ,
Aug 22, 2015 Aug 22, 2015

Copy link to clipboard

Copied

For only 150 users, I think a SharedObject should still be OK, no?

>>it's more difficult with a projector, but easier with air.

WTF is a 'projector'? Ha!

I can target Flash Player or AIR. I remember projector from my Director days, and all that was was an .exe. Which is what AIR is. So I'm not aware of any difference...

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 23, 2015 Aug 23, 2015

Copy link to clipboard

Copied

he can't use a local sharedobject and a remote one requires a flash media server and that's not going to be easy.

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 23, 2015 Aug 23, 2015

Copy link to clipboard

Copied

>> I'm not quite ready for that how would I do it so the data would be stored locally, such as a projector app.

I saw that, and it sounded he could build an .exe instead of .swf.

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 23, 2015 Aug 23, 2015

Copy link to clipboard

Copied

what would he do with the exe?

host it on his own server and have his students connect to his home server?

have the students download the exe and run it on their own computers and use a remote sharedobject? 

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 23, 2015 Aug 23, 2015

Copy link to clipboard

Copied

I just commented on what he said. I don't know what he'd do with the exe. But nowhere do I see that he said he was an actual teacher, and maybe he has a central machine available... who knows. I'm always making kiosks where one machine is used by many people, so I guess that comment got me thinking he could do this on one machine. Yeah, if on the web and used by a bunch of students (~150) then a server with the DB on it will be needed.

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 23, 2015 Aug 23, 2015

Copy link to clipboard

Copied

i never considered he might have one computer used by all the students like a kiosk situation.  (but that seems pretty unlikely.)

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 23, 2015 Aug 23, 2015

Copy link to clipboard

Copied

Actually, I was a teacher.  I just retired.  I had the idea of making a program that would have all the pertinent data on a student available to view such as grades, discipline, other grad requirements, that would be on my computer able to access data from a server or directly from my system.  not really for students to have access to.   

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 24, 2015 Aug 24, 2015

Copy link to clipboard

Copied

if all the data will be entered from your computer, you can use a sharedobject and that's easy to use.

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 24, 2015 Aug 24, 2015

Copy link to clipboard

Copied

I followed the shared object example in the Adobe Action Script Reference Site and it didn't work and know none of my programs will compile.  Any Ideas would be helpful.  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 Expert ,
Aug 24, 2015 Aug 24, 2015

Copy link to clipboard

Copied

to use a local sharedobject, use:

var so:SharedObject=SharedObject.getLocal('student-data','/');

// and that's all that needed to create and retrieve a sharedobject.

// to save data for a student, you can use:

so.data[student_id]={name:studentname,schedule:notsurewhatkindofdatathisis,grade:whatevergrade};

// if you want to retrieve the grade of a student:

trace(so.data[id][grade]);

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 24, 2015 Aug 24, 2015

Copy link to clipboard

Copied

Do you need to use flush().  It was mentioned in the example.

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 25, 2015 Aug 25, 2015

Copy link to clipboard

Copied

Yes, everytime you set the data property, use flush() to actually save it.

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 25, 2015 Aug 25, 2015

Copy link to clipboard

Copied

you actually don't need to use flush, but it's sometimes helpful and i don't see any downside (unless you're using it frequently, eg in a loop).

the data will be written when the swf session ends even without calling flush.  but if there's a crash, it's possible the data would not be written to your harddrive unless flush is used.

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 25, 2015 Aug 25, 2015

Copy link to clipboard

Copied

In my experience it's best to just use it everytime you change the data property. There's no downside to calling flush() except, like kglad said, in a loop...

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 25, 2015 Aug 25, 2015

Copy link to clipboard

Copied

Does this in any way effect the  read only permissions of the folder, which I cannot change,  because I ran the program below and now I am getting an error message " The parameter is incorrect", which I have not seen before, but now none of the programs I have will compile.  The program is as follows:

import flash.events.MouseEvent;

import flash.net.SharedObject;var playerName:String;

var mySO:SharedObject=SharedObject.getLocal("myName");

yourNameIs.text = "";confirmButton.addEventListener(MouseEvent.MOUSE_UP,buttonPressed);function buttonPressed(e:MouseEvent):void

{

 playerName=playerInput.text;

 trace(playerName);

 yourNameIs.text="Your Name is "+playerName;

 

 mySO.data.playerName=playerInput.text;

 mySO.flush();

 trace("Local Data Name: " +mySO.data.playerName);

}

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 25, 2015 Aug 25, 2015

Copy link to clipboard

Copied

use:

import flash.events.MouseEvent;

import flash.net.SharedObject;

var playerName:String;

var mySO:SharedObject=SharedObject.getLocal("myName","/");

yourNameIs.text = "";

confirmButton.addEventListener(MouseEvent.MOUSE_UP,buttonPressed);

function buttonPressed(e:MouseEvent):void

{

playerName=playerInput.text;

trace(playerName);

yourNameIs.text="Your Name is "+playerName;

mySO.data.playerName=playerInput.text;

mySO.flush();

trace("Local Data Name: " +mySO.data.playerName);

}

p.s. format your code so it's legible.

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