0

What packages and/or classes do I want to look into when I'm trying to make a Flash program that will run on multiple desktop and mobile platforms and I want to use persistent data?

Edit:

I am working on a program that will allow people to study certain texts following a daily study program. The text is different every day, and I want every person to be studying the same thing. I intend to export this to Projectors for Mac/Windows and I would like to allow people to use it on mobile devices as well. Preferably, the program should not require internet connectivity.

Community
  • 1
  • 1
Moshe
  • 57,511
  • 78
  • 272
  • 425

5 Answers5

1

i ran into this issue just a few weeks ago myself. i found an old "as3preferenceslib" class online, cleaned it up, fixed a few of the errors, and now it works great. here's my SO thread: AIR 2 - Data Persistence?

i remember there being a few problems with the code, but the one i remember is in the setValue() function of Preferences.as:

else if (value is int)
        {
        prefItm.value = s_int;
        bytes.writeByte(value);  //change this to bytes.writeInt(value);
        }  
Community
  • 1
  • 1
Chunky Chunk
  • 16,553
  • 15
  • 84
  • 162
  • i was going to email it to you, but you're website is a string. i'm planning on posting my library to my site when i update it sometime in the new year, but in the meantime i can send it to you by email. it's not documented yet, but i can send you a simple example of it's use, plus it's pretty simple to follow. – Chunky Chunk Dec 03 '10 at 13:55
0

If you want desktop applications with Flash than you have to use AIR which provides classes like File and FileStream for interacting with the filesystem as well as a lot more for interacting with the OS.

jondro
  • 619
  • 3
  • 9
  • AIR on mobile devices (Android and iPhone) offers the same or similar classes to store data. Flash on web pages obviously won't work on the iPhone, but on Android you should be able to use SharedObject in browser. – martineno Nov 24 '10 at 22:23
  • I'd like to keep this as offline as possible. – Moshe Nov 24 '10 at 22:26
0

Additionally, if you want the data to be synchronized between all of your various application instances (ie, so changes on the desktop client will show up your phone as well) then you're going to need to set up a back-end that can write to a database, and use web services to update the data in your application.

A simple approach would be a MySQL/PHP stack, using something like AMFPHP to handle communications between Flash and the back end. Any time you make a change in one client, then, you push that change up to the server and it gets saved. You app, then, can check with the server every time it starts to see if there is new data.

Does that make sense? It's a pretty broad answer, but it's a pretty broad question. If you're familiar with back-end technology and I'm misunderstanding your question please leave a comment to that effect and I'll see if I can't help you out. :)

Myk
  • 6,205
  • 4
  • 26
  • 33
  • Interesting. How are you getting the test data? If you can't rely on an internet connection I assume you're going to be embedding hard-coded XML or something? – Myk Nov 24 '10 at 22:42
  • Then I guess you could use Flash's Date() class and map it to hard-coded values in the XML? It's not perfect, for instance if someone's computer's clock is off that could screw up your timing - but if you're not going to allow synchronization via the internet then really there's nothing you can do about that, right? – Myk Nov 26 '10 at 17:42
0

Ok so you're essentially asking for the holy grail app development platform. And you need it to be easy and synchronized across platforms without an internet connection. Short answer, you're not going to get this done within any time frame that can be described as "short" or even "reasonable". Flash isn't supported on Iphone. Despite the core code being reusable you would have to design and implement separate UIs for desktop and mobile anyway. In order for the app to work without an internet connection you're going to need to program all the study guides into it in advance and hope no one has their devices calendar set up incorrectly.

You're best bet is to make it a webpage and to require a web connection and a browser. That way you make one back end, even one UI if you dont have the time, and its all synchronized and up to date. And you can modify it with updates immediately pushed to the user.

Otherwise you're going to have to cut scope or hire some devs/testers.

greggreg
  • 11,945
  • 6
  • 37
  • 52
0

Adobe AIR 2.5 is supported on desktops, Android and iOS (maybe others as well). Unlike web page, AIR applications are installed and need not to rely on internet connection. But sometimes, when connection is available, you can update texts and store them in files. You aren't even forced to use Flex to do everything. If you have Sprite-based content in ActionScript, you can adapt it to AIR's WindowedApplication by putting it into rawChildren and have it scaled with the app.

alxx
  • 9,897
  • 4
  • 26
  • 41