MACROMEDIA FLASH MEDIA SERVER 2-SERVER MANAGEMENT ACTIONSCRIPT LANGUAGE Manuale Utente Pagina 41

  • Scaricare
  • Aggiungi ai miei manuali
  • Stampa
  • Pagina
    / 155
  • Indice
  • SEGNALIBRI
  • Valutato. / 5. Basato su recensioni clienti
Vedere la pagina 40
ADOBE FLASH MEDIA INTERACTIVE SERVER
Server-Side ActionScript Language Reference
38
Read-only; A string containing the URL of the web page in which the client SWF file is embedded. If the SWF file
isnt embedded in a web page, the value is the location of the SWF file. The following code shows the two examples:
// trace.swf file is embedded in trace.html.
client.pageUrl: http://www.example.com/trace.html
// trace.swf is not embedded in an html file.
client.pageUrl: http://www.example.com/trace.swf
The value can be an HTTP address or a local file address (for example, file:///C:/Flash Media Server applica-
tions/example.html).
Availability
Flash Media Server 2
Example
The following example uses the
Client.pageURI property to verify whether a new client is located at a particular
URI. The result determines which block of code runs.
application.onConnect = function(newClient){
if (newClient.pageUrl == "http://www.example.com/index.html"){
return true;
} else {
return false;
}
};
Client.ping()
clientObject.ping()
Sends a “ping” message to the client and waits for a response. If the client responds, the method returns true;
otherwise,
false. Use this method to determine whether the client connection is still active.
Availability
Flash Communication Server 1
Example
The following
onConnect() function pings the connecting client and traces the results of the method:
application.onConnect(newClient) {
if (newClient.ping()){
trace("ping successful");
}
else {
trace("ping failed");
}
}
See also
Client.getStats()
Client.protocol
clientObject.protocol
Vedere la pagina 40
1 2 ... 36 37 38 39 40 41 42 43 44 45 46 ... 154 155

Commenti su questo manuale

Nessun commento