36
Server-Side ActionScript Language Reference
Example
The following example is the client-side code you can use for an application:
nc = new NetConnection();
nc.connect("rtmp:/test","jlopes");
nc.onStatus = function(info) {
trace(info.code);
};
nc.doSomething = function(){
trace("doSomething called!");
}
The following example is the server-side code you can include in the main.asc file:
// When using components, always load components.asc.
load( "components.asc" );
application.onConnect = function(client, username){
trace("onConnect called");
gFrameworkFC.getClientGlobals(client).username = username;
if (username == "hacker") {
application.rejectConnection(client);
}
else {
application.acceptConnection(client);
}
}
application.onConnectAccept = function(client, username){
trace("Connection accepted for "+username);
client.call("doSomething",null);
}
application.onConnectReject = function(client, username){
trace("Connection rejected for "+username);
}
See also
Application.acceptConnection()
,
Application.onConnect
,
Application.onConnectAccept
,
Application.rejectConnection()
Содержание FLASH MEDIA SERVER 2-SERVER-SIDE ACTIONSCRIPT...
Страница 1: ...Server Side ActionScript Language Reference...
Страница 4: ...4 Contents...
Страница 228: ...228 Server Side ActionScript Language Reference...
Страница 234: ...234 Server Side Information Objects...