Data (Sharedobject.data Property) - MACROMEDIA FLASH 8-ACTIONSCRIPT 2.0 LANGUAGE Reference

Actionscript 2.0 language reference
Table of Contents

Advertisement

for (var prop in my_so.data) {
trace("\t"+prop);
}
This ActionScript displays the following message in the Output panel:
before my_so.clear():
name
after my_so.clear():

data (SharedObject.data property)

public data : Object
The collection of attributes assigned to the
shared and/or stored. Each attribute can be an object of any basic ActionScript or JavaScript
type—Array, Number, Boolean, and so on. For example, the following lines assign values to
various aspects of a shared object:
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]);
}
All attributes of a shared object's
shared object contains the following information:
userName: Ramona
adminPrivileges: true
itemNumbers: 101,346,483
Do not assign values directly to the data property of a shared object, as in
so.data=someValue ; Flash ignores these assignments.
To delete attributes for local shared objects, use code such as
so.data.attributeName
does not delete the attribute.
1084
ActionScript classes
data
property are saved if the object is persistent, and the
data
; setting an attribute to
property of the object; these attributes can be
delete
or
null
undefined
for a local shared object

Hide quick links:

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the FLASH 8-ACTIONSCRIPT 2.0 LANGUAGE and is the answer not in the manual?

This manual is also suitable for:

Flash 8

Table of Contents

Save PDF