Forum BigDB Problem saving playerObject

Discussion and help relating to the PlayerIO database solution, BigDB.

Problem saving playerObject

Postby Drutten » August 21st, 2010, 2:10 pm

I'm just trying out to as simply as possible load a playerObject after I've connected with facebook (in handleConnect(client:Client)), input a var and then save it but i get the error: TypeError: Error #1006: Save is not a function.

Here's what I do:

client.bigDB.loadMyPlayerObject(function(obj:DatabaseObject):void{
obj.experience = 0;
obj.Save();
});

If i trace obj i get the following:
[playerio.DatabaseObject]
PlayerObjects["fb714236859"] = {
} (Version:1)

So loading seems to work.
Any ideas what I've done wrong?
Drutten
 
Posts: 9
Joined: August 9th, 2010, 7:47 am

Re: Problem saving playerObject

Postby SeriousWorm » August 21st, 2010, 2:59 pm

The method name is save(), not Save(). Case matters.
SeriousWorm
 
Posts: 9
Joined: August 5th, 2010, 1:02 pm

Re: Problem saving playerObject

Postby Drutten » August 21st, 2010, 3:09 pm

That's it! Thanks a bunch! I didn't bother looking that up since all examples (i've looked at) here said Save().
If anyone would like to correct that this is the page i'm referring to: http://playerio.com/documentation/bigdb/playerobject
Also this one says it's Save(): http://playerio.com/documentation/bigdb/example
Drutten
 
Posts: 9
Joined: August 9th, 2010, 7:47 am

Re: Problem saving playerObject

Postby Oliver » August 24th, 2010, 11:11 am

Hey Drutten,

Good catch! We've fixed the casing in the docs for next release.

- Oliver
User avatar
Oliver
.IO
 
Posts: 1159
Joined: January 12th, 2010, 8:29 am


Return to BigDB