Server-Side Communication ActionScript > Using server-side ActionScript |
![]() |
Overview of Server-Side Communication ActionScript
Server-Side Communication ActionScript is a scripting language on the server that lets you develop efficient and flexible client-server Macromedia Flash Communication Server MX 1.5 applications. For example, you can use server-side ActionScript to control login procedures, control events in connected Macromedia Flash movies, determine what users see in their Flash movies, and communicate with other servers. You can also use server-side scripting to allow and disallow users access to various server-side application resources and to allow users to update and share information.
Server-side ActionScript is based on the ECMA-262 specification (ECMAScript 1.5) derived from JavaScript and lets you access the core JavaScript server object model. (For more information, see the Netscape DevEdge website.) Server-side ActionScript provides global methods and objects and exposes a rich object model for developing communication applications. You can also create your own objects, properties, and methods. This dictionary provides detailed information about the objects and their properties, methods, and events.
Client-Side Communication ActionScript is based on the ECMA-262 specification, but there are some differences in its implementation. Server-side ActionScript, however, does not deviate from the ECMA-262 specification. For information about the relationship between server-side ActionScript and client-side ActionScript, see Developing Communication Applications Help.
Using server-side ActionScript
To use server-side ActionScript with a Flash Communication Server application, you write the code, copy the script into the appropriate server directory, and run the SWF file that connects to the server. To understand Flash Communication Server applications, see Developing Communication Applications Help.
Create the server-side ActionScript file and name it main.asc. All ActionScript code that is embedded in the script file and not inside a function body executes once when the application is loaded but before the application.onAppStart
event handler is called.
Note: You can also name your server-side script file app_name, where app_name is the name of your application's directory, and save it with a file extension of .asc or .js. Also, any double-byte characters (including characters of all Asian languages) in the server-side ActionScript file must be UTF-8-encoded. For more information, see "Writing double-byte language applications" in Developing Communication Applications Help.
To install and test the server-side ActionScript file, do the following:
1 |
Locate the Macromedia Flash Communication Server /applications directory. |
The default location of the /applications directory is under the Macromedia Flash Communication Server MX product installation directory. |
|
Note: If you did not accept the default installation settings and you aren't sure where the application directory is located, the location is specified in the |
|
2 |
Your server-side script file must be named main.asc, main.js, registered_app_name.asc, or registered_app_name.js. |
3 |
Create a subdirectory in the /applications directory called appName, where appName is a name you choose as the filename of your Flash Communication Server application. You must pass this name as a parameter to the |
4 |
Place the main.asc file in the appName directory or in a subdirectory called scripts in the appName directory. |
5 |
Open the Flash application (the SWF) in a browser or in the stand-alone Flash Player. |
The SWF must contain ActionScript code that passes appName to the |
|
|
|
Note: You can use the Communication App inspector or the Administration Console to check if the application loaded successfully. |
![]() |