Hi there,

I'm developing an application where I do some checking with another
application using LoadVars before I allow a client to connect. My callback
function then calls application.rejectConnection or
application.acceptConnection. These methods both take a Client object as a
parameter. This is ok when reject or accept are in application.onConnect
because it is passed the client object. But my callback function needs access
to the client object too.

I can store the client object in a global variable and everything works fine
but I'm not sure whether this global variable gets shared between all instances
of the application or just this instance (by instance I mean each time it is
run, not instance as in rtmp://server/application/instance). If the former,
then I'll have problems when clients connect concurrently. If that is the case,
does anyone know how my callback function can get access to the client object
in order to call application.accept/rejectConnection.

Here's a simplification of my code:

var currentClient = null;

application.onConnect = function(clientObj, param){

serverCall = new LoadVars();
serverCall.onData = afterCodeCheck;
serverCall.load("...");

}

function afterCodeCheck(result){

if(result == 1){
application.acceptConnection(currentClient);
}else{
application.rejectConnection(currentClient);
}
}

Hope that makes sense. Thanks very much

Andy