[1] The correct way to assign a value to the shared object should be:
1: Client1 =
"a";
2: Client2 =
"b";
3:
4: Temp =
New Object ();
5: Temp [client1] = client1;
6: Temp [client2] = client2;
7:
8: client_so.data.users = temp;
[2] To delete the properties of the local shared object, use such as delete So.data.attributeName; setting the properties of the local shared object to null or undefined not to delete the property, just initialize the value.
Delete Shared Object: Delete all DATA children, then delete sharedobject;
Myso = sharedobject.getlocal ("test");
Myso.Data.stickaround = "I'll be here for years to come!";
Myso.Data.myArray = New Array (1, 2, 3, 4);
Myso.flush ();
Delete myso;
// Reload The SO
Myso = sharedobject.getlocal ("test");
For (a in myso.data) {
Delete myso.data [a];
}
Myso.flush ();
// delete the so
Delete myso;
SharedObject.clear (); for local shared objects, purge y of the data and
DELETES The Shared Object from The Disk. The Reference To
MY_SO is Still Active, But
MY_SO
Data Properties Are deleted.
For remote shared objects, this method disconnects the object and purges all of the data; if the shared object is locally persistent, the method also deletes the shared object from the disk The reference to my_so is still active, but my_so data properties are deleted. .
[3]
So.data.itemnumBers = itemsArray;
So.data.adminprivileges = currentuserisadmin;
So.data.username = currentusername;
The above form can be written as
So.data ['ItemnumBers'] = itemsArray;
So.data ['adminPrivileges'] = currentuserisadmin
So.data ['Username'] = CurrentUserName;
It is equivalent.
[4]
To create a "private" value of the shared object (the object is only available when using and if the object is not stored with the object when the object is turned off), create a name that is not DATA to store them. As of the example below
Indicated.
SO.FAVORITECOLOR = "Blue";
So.favoritenightclub = "The bluenote tavern"; So.favoritesong = "My World is blue";
[5]
Establish a way to share objects:
VAR client_nc = new netConnection ();
Client_nc.connect ("RTMP: // LocalHost / VideoChat / Room1");
SO = SharedObject.getRemote ("RECORDS", Client_nc.URL); // Data Not Writing Disk
So.connect (client_nc);
SO = SharedObject.getRemote ("Records", Client_nc.URL, TRUE);
// Data data is written to the server-side application folder
/ / The file name of the statement remote shared will be Records.fso
[6]
1: So.data.user = {ID: 1, SEX: B, NAME: Liu21st}
2 :
/ / Can be used when accessing
3:
// So.data.user.name
Data attribute assignment null or undefined can initialize field segment
So.data.userid = NULL;
But there is no deletion of this field, if you want to delete:
Delete So.data.userId;
We can also use similar to
So.data.year.month.dayofmonth = SomeValue; mode to assign
// Note that this assignment is not a field Year.Month.dayofmonth
//, which is given to three fields Year, Month, dayofmonth initialize the same value.