MACROMEDIA FLASH COMMUNICATION SERVER MX-SERVER-SIDE COMMUNICATION ACTIONSCRIPT DICTIONARY Bedienungsanleitung Seite 21

  • Herunterladen
  • Zu meinen Handbüchern hinzufügen
  • Drucken
  • Seite
    / 80
  • Inhaltsverzeichnis
  • LESEZEICHEN
  • Bewertet. / 5. Basierend auf Kundenbewertungen
Seitenansicht 20
Server-Side Communication ActionScript 21
Application.onConnectAccept
Availability
Flash Communication Server MX (with communication components only)
Usage
application.onConnectAccept = function (clientObj [,p1, ..., pN]){
//insert code here to indicate result of an accepted connection
};
Parameters
clientObj The client connecting to the application.
p1...pN Optional parameters passed to the application.onConnectAccept method. These
parameters are passed from the client-side NetConnection.connect method when a client
connects to the application.
Returns
Nothing.
Description
Event handler; invoked only when the communication components are used (that is, when the
components.asc script is loaded into your server-side application script).
application.onConnectAccept is invoked on the server side when NetConnection.connect is
called from the client side and a client successfully connects to an application instance.
When you use components, your last line (in order of execution) of the onConnect method
should be either
application.acceptConnection or application.rejectConnection. Any logic that
follows the explicit acceptConnection or rejectConnection statement needs to go into
application.onConnectAccept and application.onConnectReject statements, or it will be ignored.
This requirement exists only when you use components.
Example
The first example is the client-side code you would use for an application:
nc = new NetConnection();
//try either username
nc.connect("rtmp:/test","jlopes");
//nc.connect("rtmp:/test","hacker");
nc.onStatus = function(info) {trace(info.code);}
nc.doSomething = function(){
trace("doSomething called!");
}
Seitenansicht 20
1 2 ... 16 17 18 19 20 21 22 23 24 25 26 ... 79 80

Kommentare zu diesen Handbüchern

Keine Kommentare