Flash can save data

Source: Internet
Author: User
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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.