
13
SERVER-SIDE ACTIONSCRIPT LANGUAGE REFERENCE FOR ADOBE MEDIA SERVER 5.0.1
Server-Side ActionScript Language Reference
Last updated 7/2/2013
Do not use the index value of the clients array to identify users between calls, because the array is compacted when
users disconnect and the slots are reused by other Client objects.
Availability
Flash Communication Server 1
Example
The following example uses a for loop to iterate through each element in the application.clients array and calls
the
serverUpdate() method on each client:
for (i = 0; i < application.clients.length; i++){
application.clients[i].call("serverUpdate");
}
application.config
application.config
Provides access to properties of the ApplicationObject element in the Application.xml configuration file. To access
properties that you set in the configuration file, use the
application.config property. For example, to set the value
of the
password element, use the code application.config.password.
Availability
Flash Media Server 2
Example
Use this sample section from an Application.xml file for this example:
<Application>
<ScriptEngine>
<ApplicationObject>
<config>
<user_name>jdoe</user_name>
<dept_name>engineering</dept_name>
</config>
</ApplicationObject>
</ScriptEngine>
</Application>
Note: You must use the <ScriptEngine> tag as <JSEngine> tag is deprecated.
The following lines of code access the user_name and dept_name properties:
trace("I am " + application.config.user_name + " and I work in the " +
application.config.dept_name + " department.");
trace("I am " + application.config["user_name"] + " and I work in the " +
application.config["dept_name"] + " department.");
The following code is sent to the application log file and the Administration Console:
I am jdoe and I work in the engineering department.
application.denyPeerLookup()
application.denyPeerLookup(tag:ByteArray)
Comentários a estes Manuais