The data actually has a lot of beginners this doesn't understand Lfash also has a very important function of local storage! We call it so, please look at this SWF file first. Please close it after you read it, it can record the number of times you open:
http://www.flash8.net/bbs/UploadFile/2005-5/200557223742925.swf
In fact, it's very simple, in Flash Player can store information
The stored address is in the C:\Documents and Settings\ username \application Data\Macromedia\Flash Player\ This folder
Statement interpretation
Create a local shared object named So, named Player\ in the C:\Documents and Settings\ username \application Data\Macromedia\Flash Jxxx After we ran this SWF, can go to C disk to see, is a suffix of data D file
so = sharedobject.getlocal ("jxxx");
Initialize the variable nums in so data, clearly know it is not defined, but we have to do so, or in the future each run this SWF start nums are 1
if (so.data.nums = = undefined) {
So.data.nums = 1;
This.num = So.data.nums;
Then only run once, and its value is not undefined, then realize the future every time to open the + +, because the future open it is defined
} else {
so.data.nums++;
This.num = So.data.nums;
}
Click here to download the source file