Application.clients

Availability

Flash Communication Server MX 1.0.

Usage

application.clients

Description

Property (read-only); an object containing all the Flash clients or other Flash Media 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 can't 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

The following 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");
}

 

Send me an e-mail when comments are added to this page | Comment Report

Current page: http://livedocs.adobe.com/fms/2/docs/00000646.html