MACROMEDIA FLASH 8-FLASH LITE 2.X ACTIONSCRIPT LANGUAGE Reference page 588

Flash lite 2.x actionscript language reference
Hide thumbs Also See for FLASH 8-FLASH LITE 2.X ACTIONSCRIPT LANGUAGE:
Table of Contents

Advertisement

Note: For Flash Lite, if the shared object listener has not been invoked, the
could contain undefined values. For details, see the description of the
method.
var items_array:Array = new Array(101, 346, 483);
var currentUserIsAdmin:Boolean = true;
var currentUserName:String = "Ramona";
var my_so:SharedObject = SharedObject.getLocal("superfoo");
my_so.data.itemNumbers = items_array;
my_so.data.adminPrivileges = currentUserIsAdmin;
my_so.data.userName = currentUserName;
for (var prop in my_so.data) {
trace(prop+": "+my_so.data[prop]);
}
soResult = "";
for (var prop in my_so.data) {
soResult += prop+": "+my_so.data[prop] +"\n";
}
result.text = soResult;
All attributes of a shared object's
shared object contains the following information:
userName: Ramona
adminPrivileges: true
itemNumbers: 101,346,483
Note: Do not assign values directly to the
so.data = someValue
To delete attributes for local shared objects, use code such as
so.data.attributeName
does not delete the attribute.
To create private values for a shared object—values that are available only to the client
instance while the object is in use and are not stored with the object when it is closed—create
properties that are not named
var my_so:SharedObject = SharedObject.getLocal("superfoo");
my_so.favoriteColor = "blue";
my_so.favoriteNightClub = "The Bluenote Tavern";
my_so.favoriteSong = "My World is Blue";
for (var prop in my_so) {
trace(prop+": "+my_so[prop]);
}
588
ActionScript classes
property are saved if the object is persistent and the
data
data
). Flash ignores these assignments.
; setting an attribute to
to store them, as shown in the following example:
data
property of a shared object (for example,
delete
or
null
undefined
property
data
addListener()
for a local shared object

Advertisement

Table of Contents
loading

Table of Contents