Saturday, July 16, 2011

You want to store information in memmory using flash sharedObject

Local shared Objecct are to Flash what cookies are to web browsers but more so. some developers because they allow you to store large amounts of data and store and retrieve.This is mainly using for saving "username" and "Passwords".

var example:SharedObject = SharedObject.getLocal( "example" );
The static getLocal( )in shared object are both created and opened for reading.
You want to add data to a SharedObject use the following code.
// Store a username value to the example shared object.
example.data.username = "myname";

You can store several datatypes to the shared object's data property, as follows.
example.data.exampleArray = new Array( "a", "b", "c" );
example.data.exampleDate = new Date();
example.data.exampleObject = { key1: "example", key2: -12, key3: null };
You want to save data in a Shared Object to the client computer.
var flushResult:String = example.flush( );

0 comments: