Google has just announced it's making an offline version of its Gmail e-mail service available today. The new feature will be initially available to users of its Googles Apps online suite of productivity applications, which includes Gmail.
Over the next few weeks, Google said it will make the feature available to consumers and others who use the stand-alone version of Gmail.
Ever wanted to save some information about a user like his level number, or last high score, or any other information. Well ActionScript provides a simple way to achieve this. Local data is used to save data into the user's machine such as score,level number,..etc. Below is the simplest example of saving local data on to a users computer.
Here is a simple counter that counts how many times did you visit this article on FreshNova!
Read on to see the source code. The source code is well documented so I believe it is not too hard to understand.
Source Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
//the counter variable var count:int; //making a local shared object var myLocalData:SharedObject = SharedObject.getLocal("mygamedata"); //adding the info in the shared object to myData var myData:String=""+myLocalData.data.storedInfo; //if there is no stored data before in the shared object it //will return undefined if(myData=="undefined") //store one because this is the 1st visit myLocalData.data.storedInfo=1; //if this is not the 1st visit increment the value of the //shared object by 1 else ++myLocalData.data.storedInfo; //assign the value of the shared object into count count=myLocalData.data.storedInfo; counter.text=""+count;//write the vaalue of count
You will find the source file in the attachments below. Enjoy it!!
Hi, thank you for the tips, they are great. ActionScript is a good tool to save some information about a user, which is often important to me. You just gave me a great idea. Thanks for the post, it's really helpful.
I usually look for some information on similar topics at http://www.torrentbasket.com/ torrent SE but your website is really a good source of information.
Comments
I usually look for some information on similar topics at http://www.torrentbasket.com/ torrent SE but your website is really a good source of information.