SharedObject Applications

The Basics
_global.root = this;
_global.cookie = SharedObject.getLocal("objectnamehere");
function KillIt(){
for (var i in cookie.data){
delete cookie.data[i];
}
cookie.flush();
}
As you can see, we've created (2) _global variables: a reference to the main timeline of this application's _root and a reference to the SharedObject we're creating (if it doesn't exist) or loading (if it does). We also defined a function that we will call at the end of the process that will destroy the SharedObject. Now, this approach will definitely come in handy if you decide to use movie clips for each of the form's pages.
With that out of the way we can add code to the actions layers of each of our page clips. Here we can make use of that organization chart, b/k/a "cheat sheet", we created earlier. We've already completed the layout of the pages and given instance names to all of the page's components (if using them) or our text fields. So now we can add code to the actions layer that will collect the user data entered on this "page" and store it in our SharedObject. We could code it like this:
cookie.data.var1 = var1.text;
cookie.data.var2 = var2.text;
cookie.data.var3 = var3.text;
cookie.data.var4 = var4.text;
etc,etc...
cookie.flush();
And that would definitely store the info. But, what if this page had (30) variables to collect? That's right, it would become tedious to either type line after line or copy/paste line after line. So how can we make it more efficient?
We'll see on the following page...
