How t layout flash for a persistent online game

Hey everyone, don’t worry this isn’t another ‘how do i make a online game??!!?’ question. It’s more of a theoretical one :wink:

I’ve been racking my brains for this one for a few weeks now, having already rebuilt the client once I thought I should probably look for some help :slight_smile:

Essentially, I am creating an online game, the server and client can communicate fine, thats not the problem I have. My problem is that I’m unsure how I should create the UI over the game to make things run smoothly, let me give you an example.

The client has logged in, they are sent to frame 2.
The server sends all the clients information such as money, health etc.
The client then decides to go to a shop (on a new frame). The server sends information about stock levels prices etc.
The client then buys a weapon. again prices & money are sent yada yada.

now, given that example, I have all my different pages on different frames, but the socket handler is in a frameset that spreads over the entire client timeline so that it can access all the functions on the different frames.
My only worry is, that if a packet is recieved late and the client is on a different frame then an error will occur, as the handler will not be able to find the function, and I want to avoid that as best I can. This will also end up having synching issues between client and server with different values being represented for things.

so, in short, how would be best to layout the frames and pages in my game to avoid sync errors? perhaps there is some way I can code it? I dont really have any idea.

I should note that the sockets main code is coded within its own class, a new instance is created when the client starts and it uses callback style functions (‘onData’, ‘onError’, etc) that are handled on the main timeline in the socket handler.

I hope this is clear enough, and I really hope I can get some help on this!

EDIT
Completely forgot to mention… But it is a persistent game, so a player may be wandering around when they are attacked by another player. I need to take this into account aswel