44
Using Media Classes
Also, if you want to use the
call()
method on the Client object that is connecting, make sure
you call
application.acceptConnection()
and know that the client is connected before
issuing any additional commands. The following code sets up this sequence of actions:
application.onConnect = function(clientObj,name,passwd)
{
// First accept the connection
application.acceptConnection(clientObj);
// After client is registered with the application instance
// you can use "call" method
clientObj.call("onWelcome", "You are now connected!!!");
return;
// After you call acceptConnection() or
// rejectConnection() within onConnect, return value is ignored.
}
TIP
If you’re using components, see
“Handling events in a component-based application”
on page 46
.
Summary of Contents for FLASH MEDIA SERVER 2-DEVELOPING MEDIA
Page 1: ...Developing Media Applications ...
Page 6: ...6 ...
Page 10: ...10 About This Manual ...
Page 36: ...36 Flash Media Server Architecture ...
Page 80: ...80 Debugging and Monitoring Applications ...
Page 106: ...106 Application Development Tips and Tricks ...
Page 114: ...114 ...