MACROMEDIA FLASH COMMUNICATION SERVER MX-SERVER-SIDE COMMUNICATION ACTIONSCRIPT DICTIONARY Manual do Utilizador Página 14

  • Descarregar
  • Adicionar aos meus manuais
  • Imprimir
  • Página
    / 80
  • Índice
  • MARCADORES
  • Avaliado. / 5. Com base em avaliações de clientes
Vista de página 13
14
The following example clears all MP3 files from the application instances /disco subdirectory:
function onApplicationStop(){
application.clearStreams("mp3:/disco/*");
}
Application.clients
Availability
Flash Communication Server MX.
Usage
application.clients
Description
Property (read-only); an object containing all the Flash clients or other Flash Communication
Servers currently connected to the application. The object is a custom object like an array, but
with only one property,
length. Each element in the object is a reference to a Client object
instance, and you can use the
length property to determine the number of users connected to the
application. You can use the array access operator (
[]) with the application.clients property
to access elements in the object.
The object used for the
clients property is not an array, but it acts the same except for one
difference: you cant use the following syntax to iterate through the object:
for(var i in application.clients) {
// insert code here
}
Instead, use the following code to loop through each element in a clients object:
for (var i = 0; i < application.clients.length; i++) {
// insert code here
}
Example
This example uses a for loop to iterate through each member of the application.clients array
and calls the method
serverUpdate on each client:
for (i = 0; i < application.clients.length; i++){
application.clients[i].call("serverUpdate");
}
Application.disconnect
Availability
Flash Communication Server MX.
Usage
application.disconnect(clientObj)
Parameters
clientObj The client to disconnect. The object must be a Client object from the
application.clients array.
Returns
A Boolean value of true if the disconnect was successful; otherwise, false.
Vista de página 13
1 2 ... 9 10 11 12 13 14 15 16 17 18 19 ... 79 80

Comentários a estes Manuais

Sem comentários