![]() ![]() ![]() | |
![]() | |
![]() | |
![]() |
Flash Player 6.
myLocalSharedObject
.data
Read-only property; the collection of attributes assigned to the data
property of the object; these attributes can be shared and/or stored. Each attribute can be an object of any of the basic ActionScript or JavaScript typesArray, Number, Boolean, and so on. For example, the following lines assign values to various aspects of a shared object:
itemsArray = new Array(101,346,483); currentUserIsAdmin = true; currentUserName = "Ramona"; so.data.itemNumbers = itemsArray; so.data.adminPrivileges = currentUserIsAdmin; so.data.userName = currentUserName;
All attributes of a shared object's data
property are saved if the object is persistent.
Note: 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 like delete so.data.attributeName
; setting an attribute to null
or undefined
for a local shared object does not delete the attribute.
To create "private" values for a shared objectvalues that are available only to the client instance while the object is in use and are not stored with the object when it is closedcreate properties that are not named data
to store them, as shown in the following example.
so.favoriteColor = "blue"; so.favoriteNightClub = "The Bluenote Tavern"; so.favoriteSong = "My World is Blue";
The following example sets the current stream to the user's selection.
curStream = _root.so.data.msgList[selected].streamName;
![]() | |
![]() | |
![]() | |
![]() ![]() ![]() |