This tutorial will teach you how to make text be saved and loaded.
Save and Load FunctionsOpen the main timeline actions. Create a function called "setCookie(c, n, v)" (c = Cookie, n = Name, v = Variable). Under that put "var so = SharedObject.getLocal(c);". Then under that put "so.data[n] = v;". Finally under that put "so.flush();".
So far it should look like this:function setCookie(c,n,v) {
var so = SharedObject.getLocal();
so.data[n] = v;
so.flush();
};
Now make another function called "getCookie(c,n)" (c = Cookie, n = Name). Under that assign "var so = SharedObject.getLocal();". Then under that put "return so.data[n];".
The functions should look like this:function setCookie(c,n,v) {
var so = SharedObject.getLocal(c);
so.data[n] = v;
so.flush();
};
function getCookie(c,n) {
var so = SharedObject.getLocal(c);
return so.data[n];
};
Make a input text field called "text". Make a save button and a load button.
In the save button actions put:on (release) {
_root.setCookie("vars","text",_root.text);
}
In the load button actions put:on (release) {
_root.text = _root.getCookie("vars","text");
}
If this is done right it will save the text you type and load the text that was type last time text was saved.
If you have any questions about this tutorial or any other flash related question email me at
sk8r831@yahoo.com and I'll get back to you as soon as possible.