Question

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.

Was it helpful?

Solution

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);
        }  

OTHER TIPS

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.

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. :)

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.

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.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top