Login system and mapping classes

Added by Tom Glenn 964 days ago

I know this really isn't the right place to ask this, so I was wondering if someone could point me in the right direction.

I am new to Actionscript (I am a C# and C++ developer normally), so sorry if this is a stupid question.

I have a multi-user 2D chat using Union. It is all on one frame, but I would like the user to have to choose a username before they enter the chat (Or select enter as a guest, which would just call them "Guest <ClientID>" as it does at the moment.

I was under the impression that this would require another frame before the actual chat room frame. But how then would I connect to Union, set the username, then keep the connection across frames (So that their username doesn't reset)?

Another question I have, is that at the moment each client is visually represented by a "ball" MovieClip. I would very much like to encapsulate common functionality inside this ball movieclip (It's currently linkaged under the name "ball" so I can instantiate it with new ball()) such as movement code etc. I would like to achieve something like so:

var targetX:Number = Number(client.getAttribute(null, "TargetX"));
var targetY:Number = Number(client.getAttribute(null, "TargetY"));
clientBall.moveToTarget(targetX, targetY);

Even better than that would be if I were able to extend the Client class and encapsulate the movieclip that represents each client, etc etc.

Like I say, I am very new to ActionScript (Last time I used it was Flash 8!), so I apologize if these questions sound rediculous.

Thanks in advance!