Flash/AIR - Can I download online images and save locally... silently?
I'm relatively new to Flash, AS3 and AIR, but very soon I'll be building a Kiosk application, and am curren开发者_开发技巧tly in the planning process. The app itself will require some data from an online database to be downloaded and stored locally, so that the kiosk can be safely disconnected from the internet while running, and reconnected later to update its data.
I'm currently trying to figure out the best way to do this. I figured that the data's easily enough loaded from a server-side PHP script and saved to a local SQLite database for offline usage, but I haven't been able to find any solid method of downloading and saving images. At least, not without using a save dialog.So, what suggestions would people have for downloading images and saving them locally to use later with no need for user interaction?
AIR application can save and load files to/from local filesystem. Use File class to save what you have downloaded. Keep the list of <url, filename>
records in local SQLite database or in XML files, whatever is best for you. You can search XML easily with XML selectors, if your list is not very big, this may be enough. Store images in File.applicationStorageDirectory. When they are needed, check the list first, if image is not there, load from internet.
精彩评论