In the last article about Flash on the Pocket PC platform I covered the basics of creating flash interfaces that will work and look good on the "small screen", covering the aspects of the platform that need to be considered when developing an interface or application. With this article I'll be talking about the tools used to create more advanced applications. These things aren't necessarily Pocket PC-specific, but they do work a little differently in some cases.
Shared objects
Shared objects are used in many Flash applications. Flash isn't allowed much interaction with the client's computer; there's no built-in method for creating text files, though existing ones can be read. The primary option for storing user data is to store it remotely but if the client isn't connected to the Internet that option isn't always available. If that's the case, then store the data in the only local vehicle available for client storage data: shared objects.
Shared objects are small files that Flash stores on the client computer. The shared object is specific to the application that created it. They're also not easy to find, usually residing within a hidden subfolder on the client computer.
In terms of a Pocket PC device, the shared object exists only until the next soft reset. Therefore, you can't rely on it always being there. In fact, the application you'll be looking at only uses a shared object to store data temporarily while a network connection is not available.
Creating the shared object is pretty straightforward:
1 var MyBlog = SharedObject.getLocal("blogobject");
2 MyBlog.data.Blog = new Array();
Line 1 only executes if the shared object doesn't exist. Line 2 assigns the shared object a value. You can put anything you want in your shared object; I use an array since I want to put several pieces of data in the same container. I'll address actually putting data into the shared object array later.






