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

  • Scaricare
  • Aggiungi ai miei manuali
  • Stampa
  • Pagina
    / 155
  • Indice
  • SEGNALIBRI
  • Valutato. / 5. Basato su recensioni clienti
Vedere la pagina 26
ADOBE FLASH MEDIA INTERACTIVE SERVER
Server-Side ActionScript Language Reference
24
Example
For a complete client-side and server-side example, see Publish from server to server in Adobe Flash Media Server
Developer Guide.
application.redirectConnection()
application.redirectConnection(clientObj, url[, description[, errorObj]])
Rejects a connection and provides a redirect URL. You must write logic in the NetConnection.onStatus() handler
that detects redirection and passes the new connection URL to the
NetConnection.connect() method.
When this method is called,
NetConnection.onStatus() is invoked on the client and passed an information object
with the following values:
Availability
Flash Media Interactive Server 3 and Flash Media Development Server 3
Parameters
clientObj A Client object specifying a client to reject.
url A string specifying the new connection URL.
Note: If you omit this parameter,
rejectConnection() is called instead.
description A string that lets you provide more information when a connection is redirected.
errorObj An object of any type that is sent to the client, explaining the reason for rejection. The errorObj object
is available in client-side scripts as the
application property of the information object that is passed to the
NetConnection.onStatus() call when the connection is rejected.
Example
The following example is server-side code:
application.onConnect = function(clientObj, count){
var err = new Object();
err.message = "This is being rejected";
err.message2 = "This is the second message. with number description";
if (count == 1){
redirectURI = "rtmp://www.example.com/redirected/fromScript";
redirectDescription = "this is being rejected via Server Side Script.";
}
else if (count == 2){
redirectURI = "rtmp://www.example2.com/redirected/fromScript";
redirectDescription = "this is being rejected via Server Side Script.";
}
application.redirectConnection(clientObj, redirectURI, redirectDescription, err);
Property Value
info.code
"NetConnection.Connect.Rejected"
info.description
The value passed in the description parameter; if no value is passed in the parameter, the default
value is "Connection failed"
info.ex.code
302
info.ex.redirect
The new connection URL
info.level
"Error"
Vedere la pagina 26
1 2 ... 22 23 24 25 26 27 28 29 30 31 32 ... 154 155

Commenti su questo manuale

Nessun commento