Forum BigDB Loading Problem

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

Loading Problem

Postby samsonadze » September 17th, 2012, 3:12 pm

When i want to load/update my playerobject score and im typing
stage.addEventListener(Event.ENTER_FRAME,aa);

function aa(ev:Event):void
{
client.bigDB.loadMyPlayerObject(alio,lol);

function alio(obj:DatabaseObject):void
{
obj.score = 2; //Modify object
obj.save(); //Save changes
}

function lol(e:PlayerIOError):void
{
trace(e);
}
}

There's error - TypeError: Error #1009: Cannot access a property or method of a null object reference.
at FlyandSmash_fla::gmoverscrn_58/aa()
C#
samsonadze
 
Posts: 122
Joined: August 29th, 2012, 2:39 pm

Re: Loading Problem

Postby samsonadze » September 17th, 2012, 3:18 pm

But if i will remove Event Listener it does nothing, no errors, no result :(
C#
samsonadze
 
Posts: 122
Joined: August 29th, 2012, 2:39 pm

Re: Loading Problem

Postby dreamora » September 17th, 2012, 3:22 pm

potentially you simply have no player ojbect because you never saved it before.
upon first login it will not be saved, its just temporal till you logout again
dreamora
 
Posts: 225
Joined: March 2nd, 2012, 9:58 am

Re: Loading Problem

Postby samsonadze » September 19th, 2012, 10:11 am

I can see that i have playerobject created, there 's user's name and score. but that i can modify when user is logging in, But how i can change it when i will collect score ... ?
C#
samsonadze
 
Posts: 122
Joined: August 29th, 2012, 2:39 pm

Re: Loading Problem

Postby dreamora » September 19th, 2012, 1:00 pm

Assuming you are having a safe game design, score updates happen on the server.
In that case you can just access it through player.PlayerObject, modify it there and save it

From the client side you are under normal settings only capable of accessing and potentially modifying your own player object, if at all
dreamora
 
Posts: 225
Joined: March 2nd, 2012, 9:58 am


Return to BigDB