User Guide
Creating a development environment 13
Creating a development environment
This section explains what you need to know before you create Flash Media Server
applications.
Make sure the server is running To publish and test your applications, Flash Media Server
must be running. For more information, see “Starting the service” on page 19.
Specifying the server URI Use the Flash authoring environment on the same computer
that is running the Flash Media Server. If that isn’t the case, add your server name to all of the
connect commands documented here. For example, if your server is running at
myServer.myDomain.com, change a line like this:
new_nc.connect("rtmp:/doc_record/room_01");
to this:
new_nc.connect("rtmp://myServer.myDomain.com/doc_record/room_01");
Specifying publishing formats
Configure Flash to publish both SWF and HTML files. To
specify formats to be created during publishing, select File > Publish Settings in the authoring
environment.
Writing client-side ActionScript code Unless otherwise noted, your client-side
ActionScript code should be attached to a layer on the first keyframe of your FLA file, not to
individual objects. Client-side code in files published for Flash Player 7 or later is case-
sensitive.
Writing server-side ActionScript code For applications that use server-side ActionScript
code, place the code in a server-side script file. Name the file main.asc (or it can have a name
such as registered_app_name.asc) and use the Flash ActionScript Editor or the JavaScript editor
to write it. Server-side code is case-sensitive.
Loading components.asc To use media components in any application, you must load the
components.asc file, located in the scriptlib directory. To load this file, create a server-side
script file for your application, if you haven’t already, name it appropriately (such as main.asc),
and add the following code at the top:
load("components.asc");
NOTE
Be sure you use two slashes (//) after rtmp: in the revised code. The use of a single slash
is supported only when the SWF application is served from the same computer where
Flash Media Server is running.
TIP
You might find it sufficient to copy this file into any application directory that uses media
components, but be sure to name it appropriately.