ActionScript 3 Sharedobject class data lost - actionscript-3

I used a shared object class to save some view data. When I move the SWF file, all the shared object data is lost.
The questions are:
Is this expected behavior of sharedobject class?
Is there any other way to save data that stays with the local or SWF.

SharedObject Data is stored on the local machine, in a specialised sandbox. If you move SWF to another machine or launch it in another OS (i.e. in a virtual machine) of course you will not have the same SharedObject data available. This also applies to launching SWF from a browser (SO data is still saved locally. Acess the same site from another machine and it will be gone).

Related

Store data onto local disk without prompting the user

I have a flash application which runs on web. I need to store images and audio files onto the clients local disk(don't want to store on web) without prompting the client. I have already tried with shared object. But since shared object space is limited to 100 KB per domain I am searching for alternatives.
If someone has better solutions please let me know.
Thanks.
You can't do this with the Flash Player by itself. SharedObject and FileReference/save() are intentionally designed to allow the user to have authority over local storage. It would be a security concern if users did not.
Using an AIR application, though, you can do this using File and FileStream, or EncryptedLocalStore.
I had the same problem with creating log files and writing to them
The only solution for me was to create a localhost WebService (used WCF), so i could use URLRequest to the localhost and pass data to service - which then updated file or created it.
But in your way, if you want to store things from the user to your disk, maybe you could also somehow play with the Web services. Just need to try.
Visual studio has almost complete Web service template - just edit for your purposes.

How to store cross-application config?

I want to store basic information for a action script flex app. Normally I would just have a simple application.ini file where this config resides. Is there an inherent way that I can store this kind of information so that when I close an application and open it again, it knows what I changed a variable to? Ideally, without having any config files lying around? Perhaps it can store it in registry or another way?
Ideally, without having any config files lying around?
Shared object will help you to store some information. I don't know how big is your data, but SharedObject is great for storing flags and states.
The SharedObject class is used to read and store limited amounts of data on a user's computer or on a server. Shared objects offer real-time data sharing between multiple client SWF files and objects that are persistent on the local computer or remote server. Local shared objects are similar to browser cookies and remote shared objects are similar to real-time data transfer devices.

How to hide air application assets

I created an air application that include some data like videos, mp3s, pngs, ect... I look for a way to hide or password protect my data folders after the application is installed. So the user can't see my assets (videos, mp3s, etc...) is it possible with both pc and mac ? thank you for your answer
I would try to put binary data to SQLite database or load data from external server. You may also change some bytes within the files (so they become unreadable), and fix them once they are loaded to the application.
Additionally on Mac your assets will be stored within application.app package and most of users won't find them (only those who will dig into the package).

About shared objects

Can we use or access shared object stored in another system?
I'm storing some data in shared object in one system can i access that shared object data from another system?
I think Shared objects are stored in local machine. Can we give the path to (specified system ie server)where the shared objects will store, and can we access that object through same path?
Short answer, no. getLocal will only access the local filesystem, while getRemote is only for connecting to a flash media server (or equivalent).
Try setting the second argument of SharedObject.getLocal() method to the path where the shared object is stored. flash.net.SharedObject.getLocal()

How does one properly cache/update data-driven iPhone apps that use remote databases?

My app is highly data driven, and needs to be frequently updated. Currently the MySQL database is dumped to an xml file via PHP, and when the app loads it downloads this file. Then it loads all the values in to NSMutableArray's inside of a data manager class which can be accessed anywhere in the app.
Here is the issue, the XML file produced is about 400kb, and this apparently takes several minutes to download on the EDGE network, and even for some people on 3G. So basically I'm looking for options on how to correctly cache or optimize my app's download process.
My current thought is something along the lines of caching the entire XML file on to the iPhone's hard disk, and then just serving that data up as the user navigates the app, and loading the new XML file in the background. The problem with this is that the user is now always going to see the data from the previous run, also it seems wasteful to download the entire XML file every time if only one field was changed.
TLDR: My iPhone app's download of data is slow, how would one properly minimize this effect?
I've had to deal with something like this in an app I developed over the summer.
I what did to solve it was to do an initial download of all the data from the server and place that in a database on the client along with a revision number.
Then each time the user connects again it sends the revision number to the server, if the revision number is smaller than the server revision number it sends across the new data (and only the new data) from the server, if its the same then it does nothing.
It's fairly simple and it seems to work pretty well for me.
This method does have the drawback that your server has to do a little more processing than normal but it's practically nothing and is much better than wasted bandwidth.
My suggestion would be to cache the data to a SQLite database on the iPhone. When the application starts, you sync the SQLite database with your remote database...while letting the user know that you are loading incremental data in the background.
By doing that, you get the following:
Users can use the app immediately with stale data.
You're letting the user know new data is coming.
You're storing the data in a more appropriate format.
And once the most recent data is loaded...the user gets to see it.