Skip to main content
Participating Frequently
June 9, 2010
Question

Good practice with the client class

  • June 9, 2010
  • 1 reply
  • 296 views

Have any of you know tell me if I can have some kind of problem in the long run to dynamically insert new attributes in the client class in method onConnect?

1 - My client/flex

var nc:NetConnection = new NetConnection();

// Each connected client would dif values in the attributes of the object user.

var user:Object = new Object();

user.idProfile = 3780248778;
user.name = "Barnado fonseca";
user.email = "bbbbb@bbbbb.com.br"
user.avatar = "/mages/avatars/832483827489.jpg";
user.age = 33;
user.isGold = true;

nc.connect("rtmp://server/app/instance", user);


2 - Now I have the main.asc

application.onConnect(client, user)
{

   client.user = user; // If I do that here for each connected client must have some sort of problem with time?

   application.acceptConnection(client);

}


Cheers,

    This topic has been closed for replies.

    1 reply

    Petro_O__Bochan
    Inspiring
    June 9, 2010

    These r just dynamic object properties which r easily handled by Spidermonkey. But if u r really concerned with the memory stuff I'd suggest going with the server-side components and use var clocal = this.getClientLocalStorage(client); and/or var cglobal = this.getClientGlobalStorage(client); instead of setting props on a global object in the app instance scope.