More descriptions in Comments.
- Code: Select all
//For example obj.ITEM = [[1,9],[2,2],[3,3],[4,4]];
Connect.client.bigDB.load("DatabaseName", String(User.id), function(obj:DatabaseObject):void{
var itemArr:Array = obj.ITEM;
//I make some updates to the array, for example:
itemArr = [[1,1],[2,2],[3,3],[4,4]];
/* Updating the inventory variable.
User.item is an Array which I call the player's item array */
User.item = itemArr;
//This trace shows the correct updated array: [[1,1],[2,2],[3,3],[4,4]]
trace(User.item);
//This trace, after save it shows the old one: [[1,9],[2,2],[3,3],[4,4]]
obj.save(false,false,function():void{trace("Post Save", User.item);});
Can anyone help me on this? Let me know if you need more info to solve this.
So if now I call the "User.item" on other functions it still appears to be the old one. but my BigDB is the correctly updated.