onConnectAccept()
application.onConnect = function (clientObj, username) {}trace ("a client connected:" + username);
application.acceptConnection (clientObj);
};
application.onConnectAccept = {function (clientObj)}
trace ("connection accepted");
}
I also tried: this.acceptConnection (clientObj);
I have this script. When I connect, I get the first trace but I don't get the second track... then onConnectAccept() is not called? do not know how
Anyone got tips on this function does not work why?
V8 Flash swf, FMS2 server.
onConnectAccept:
Event handler; called only when the components are used (i.e., when the components.asc script is loaded in your script on the server side) when NetConnection.connect() is called client-side and a client connects to an instance of the application. Use onConnectAccept to handle the result of a connection accepted in an application that contains the components.
...
In other words; If you don't use of components, you can not use this function.
Tags: Adobe Media Server
Similar Questions
-
a little duped on client.call
Ive introduced a simple client-server application that seems to work for most. Only problem, is that the "client.call' in the application.onConnect does not call the function on the client.
It's in my main.asc:
---------------------------------------------------------------------------------
application.onConnect = function (client, name)
{
find available Identificateursuivant
var i = 0;
var tempObj = users_so.getProperty ("u" + i);
While (tempObj! = null)
{
i ++ ;
tempObj = users_so.getProperty ("u" + i);
}
Save the client object ID
client.ID = "u" + i;
Add the user to SO (this will trigger an onSync on clients)
users_so. SetProperty (client.id, name); name
users_so. SetProperty ("lastClient", name); name
accept the connection
application.acceptConnection (client); It works - onStatus is called with NetConnection.Connect.Success
Tell the customer what is their identity card
customer. Call ("setID", null, client.id); does not seem to do anything
}
----------------------------------------------------------------------------------------
and that is in my client:
----------------------------------------
my_nc. SetID = function (id)
{
myID = id;
statusInput.text += "online. Your id is "+ myID; is never executed
};
---------------------------------------
Even if the onStatus is called a 'success', the code client.call ("setID", null, client.id); does not call the customer setID function.
And another question: what is client.id = "u" + i; Suppose what to do? Who establishes the id in a copy of the client on the server, or is it supposed to actually define a variable named 'id' on the real client? If Yes, then what is client.call ("setID", null, client.id); for?OK after a few hours of perusing the macromedia documentation, I found the solution. Because I do not 'components' use to manage the connection, the code in onConnect should be divided into two blocks.
so now:
application.onConnect = function (client, name)
{
accept the connection - it's the ONLY thing we are doing here.
application.acceptConnection (client);
}application.onConnectAccept = function (newClient, name)
{
all the rest do here regarding the installer for the client
}
Maybe you are looking for
-
How can I get my iPod Touch on the way of recovery without loss of data?
Hello My iPod touch 4th generation shows a cable Apple USB pointing towards the iTunes logo. I have not jailbroken it or fallen to set the mode of recovery, and when I open iTunes it comes up with the message saying that it has detected an iPod in re
-
Scanning on a Laserjet M1212NF MFP
I spent a good hour 1/2 of trying to figure out to scan on this machine without a bit of luck. The answer is probably right in front of me, but I just can't figure out how to start a scan. Help...
-
new hp dv5 1004ax regeneration only boot on the second attempt, also we downloasd latest version of the bios can where our version is 11-11-2009 f38
-
XP Home to Windows 7 upgrade Peoblems I can't update my laptop to windows 7, that he will enter the upgrade options, then it will say cannot retrieve information about this disk of computers. What should I do I deleted all leave them and still get th
-
Why the timing setting has been removed from Photoshop CC2015
Why the timing setting has been removed from Photoshop CC2015