Flash Media Server |
|||
| Server-Side ActionScript Language Reference > Server-Side ActionScript Language Reference > Using server-side ActionScript | |||
To use server-side ActionScript with a Flash Media Server application, you write the code, add the script file to the appropriate server directory, and run the SWF file that connects to the server. To understand the architecture of Flash Media Server and its applications, see Developing Media Applications.
Create the server-side ActionScript file and name it main.asc. All ActionScript code that is embedded in the script file and not in a function body executes once when the application is loaded but before the application.onAppStart event handler is called.
|
NOTE |
|
You can name your server-side ActionScript 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 on server-side script files, see Developing Media Applications. |
|
NOTE |
|
For large-scale applications, you may need to use multiple server-side script files. You can use the Flash Media Server archive compiler utility to deploy those files as a package from a single location. For more information, see "Archiving and compiling server-side script files" in Developing Media Applications. |
|
NOTE |
|
Server-side scripts also have a secure loading phase, during which critical code can be loaded before the main application loading phase. Server-side scripts also let you create protected objects; these are objects whose methods and data cannot be inspected or manipulated. These two features allow you to implement system calls that protect critical data and functions. For more information, see "Implementing secure system objects" in Developing Media Applications. |
The default location of the /applications directory is in the Macromedia Flash Media Server product installation directory.
|
NOTE |
|
If you did not accept the default installation settings and you aren't sure where the |
NetConnection.connect() method in the client-side ActionScript.The SWF file must contain ActionScript code that passes appName to the connect method of the NetConnection class, as shown in the following example:
nc = new NetConnection();
nc.connect("rtmp://flashcomsvr.mydomain.com/myFlashComAppName");
|
NOTE |
|
You can use the management console to check if the application loaded successfully. |
RSS feed | Send me an e-mail when comments are added to this page | Comment Report
Current page: http://livedocs.adobe.com/fms/2/docs/00000631.html
Comments
No screen name said on Aug 31, 2006 at 12:19 PM :