
2
SERVER-SIDE ACTIONSCRIPT LANGUAGE REFERENCE FOR ADOBE MEDIA SERVER 5.0.1
Server-Side ActionScript Language Reference
Last updated 7/2/2013
Availability
Flash Communication Server 1
Parameters
intervalID An identifier that contains the value returned by a previous call to the setInterval() method.
Example
The following example creates a function named callback() and passes it to the setInterval() method, which is
called every 1000 milliseconds and outputs the message
"interval called." The setInterval() method returns a
number that is assigned to the intervalID variable. The identifier lets you cancel a specific setInterval() call. In the
last line of code, the
intervalID variable is passed to the clearInterval() method to cancel the setInterval() call.
function callback(){trace("interval called");}
var intervalID;
intervalID = setInterval(callback, 1000);
// sometime later
clearInterval(intervalID);
getGlobal()
getGlobal()
Provides access to the global object from the secure.asc file while the file is loading. Use the getGlobal() function to
create protected system calls.
Availability
Flash Media Server 2
Details
Adobe Media Server has two script execution modes: secure and normal. In secure mode, only the secure.asc file (if it
exists) is loaded and evaluated—no other application scripts are loaded. The
getGlobal() and protectObject()
functions are available only in secure mode. These functions are very powerful because they provide complete access
to the script execution environment and let you create system objects. Once the secure.asc file is loaded, the server
switches to normal script execution mode until the application is unloaded.
To prevent inadvertent access to the global object, always hold its reference in a temporary variable (declared by var);
do not hold its reference in a member variable or a global variable.
Example
The following code gets a reference to the global object:
var global = getGlobal();
load()
load(filename)
Loads a Server-Side ActionScript file (ASC) or JavaScript file (JS) into the main.asc file. Call this function to load
ActionScript libraries. The loaded file is compiled and executed after the main.asc file is successfully loaded, compiled,
and executed, but before
application.onAppStart() is called. The path of the specified file is resolved relative to
the main.asc file.
Comentários a estes Manuais