getw3help.com
 Subscribe
Enter your email address:
 Web Development
 HTML
 Javascript
 PHP
 Graphics & Multimedia
 Flash / AS
 Fireworks
 Illustrator
 Archives
 May 2008
 June 2008
 July 2008
 September 2008
 October 2008
 November 2008
 December 2008
 May 2009
 Share Us
RSS Feed  

Add to Google Reader or Homepage
Subscribe in NewsGator Online
Add to My AOL
 Latest Tutorials and Resources
Shared Objects in Flash AS 3.0
Nov 26, 2008 - By Makubex
3 comments
In this tutorial, let us see how to use Shared Objects in Actionscript 3.0
Flash CS3, AS 3.0



Shared Objects are used to store information on the user machine. For example, you can store your website template settings. The data will be stored till the user clears his/her temporary memory of the machine.

In this example let us store a string in the user machine and we will retrieve it using shared objects.

In the below example after saving a data, refresh the page and click on retrieve button to get the saved data.

Demo:



Download Source Files

Concept:

1. Declaring Shared Object,

var myso:SharedObject;


2. Creating shared object on the client local machine..

myso = SharedObject.getLocal("myApp");

"myApp" is like unique ID, it has to be different for each flash applications you develope. We will access the values using this ID.

3. Storing data to shared object..

myso.data.val = "Data to be Stored";


"val" is the variable name.

4. Delete Shared Object..

delete myso.data.val;


5. Closing shared object..

myso.close();

After the Shared Object has been used, its wise to close it.

- End of Tutorial

Labels: ,

Read more!

 Recent Tutorials
 Google Analytics for Flash
 Merry Christmas from getW3Help.com
 Shared Objects in Flash AS 3.0
 Smooth Drag and Drop using Tweener Class AS3
 Complex RollOver button using AS 3
 Google Chrome available for Download
 Window Component
 Auto Mouse Hide in Flash
 Skinning of Flash Player User Interface
 Searching Dynamic Flash Content on the Web is made...
 Recent Comments
 Links
1. Webmaster Directory
2. Mini Pixel Icons
3. Photoshop Resources
4.
5.

6.
7.
8.
9.
10.

Your link here

Contact Us | Privacy Policy