Description
Method (global); continually calls a function or method at a specified time interval until the
method is called. This method allows a server-side script to run a generic
clearInterval
routine. The
setInterval
method to stop the routine.
Note: Standard JavaScript supports an additional usage for the setInterval method,
setInterval(stringToEvaluate, timeInterval), which is not supported by Server-Side Communication
ActionScript.
Example
The following example uses an anonymous function to send the message "interval called" to the
server log every second:
setInterval(function(){trace("interval called");}, 1000);
The following example also uses an anonymous function to send the message "interval called" to
the server log every second, but it passes the message to the function as a parameter:
setInterval(function(s){trace(s);}, 1000, "interval called");
The following example uses a named function,
to the server log:
function callback1(){
trace("interval called");
}
setInterval(callback1, 1000);
The following example also uses a named function,
called" to the server log, but it passes the message to the function as a parameter:
function callback2(s){
trace(s);}
setInterval(callback2, 1000, "interval called");
SharedObject (object)
Shared objects let you share data between multiple client movies in real time. Shared objects can
be persistent on the server and you can think of these objects as real-time data transfer devices.
You can also use the client-side ActionScript SharedObject object to create shared objects on the
client. For more information, see the SharedObject entry in the Client-Side Communication
ActionScript Dictionary. The following list describes common ways to use remote shared objects:
•
Storing and sharing data on a server
A shared object can store data on the server for other clients to retrieve. For example, you can
open a remote shared object, such as a phone list, that is persistent on the server. Whenever a
client makes a change to the shared object, the revised data is available to all clients that are
currently connected to the object or that connect to it later. If the object is also persistent
locally and a client changes the data while not connected to the server, the changes are copied
to the remote shared object the next time the client connects to the object.
•
Sharing data in real time
A shared object can share data among multiple clients in real time. For example, you can open
a remote shared object that stores real-time data (such as a list of users connected to a chat
room) that is visible to all clients connected to the object. When a user enters or leaves the chat
room, the object is updated and all clients that are connected to the object see the revised list of
chat room users.
method returns a unique ID that you can pass to the
callback1
, to send the message "interval called"
, to send the message "interval
callback2
Server-Side Communication ActionScript
clearInterval
41
Need help?
Do you have a question about the FLASH COMMUNICATION SERVER MX-SERVER-SIDE COMMUNICATION ACTIONSCRIPT DICTIONARY and is the answer not in the manual?