Application Development Tips and Tricks > Application design and development > Designing for portability across servers

 

Designing for portability across servers

It is important to consider your development configuration and your production configuration when you are developing applications.

Name application elements using all lowercase text. Macromedia recommends you use all lowercase letters and no spaces when naming directories and files used with Flash Communication Server and its applications. This practice helps to ensure that, during development, your applications will work if you move files to different computers on different platforms.

Using a relative path or an absolute path to connect to the server. In your SWF file's NetConnection.connect statement, you can use either a relative path or an absolute path to connect to the registered application directory in the Flash Communication Server directory. The use of a single slash followed by the application name indicates a relative path and lets you move the files to a different server without changing the code. The use of a double slash indicates an absolute path.

If your SWF file is on the same computer that is running the Flash Communication Server, you can use rtmp:/appName/instanceName as a shortcut version of rtmp://server.domain.com/appName/instanceName. If you are authoring your application on a development server and don't use a relative path in your SWF files, moving all of your SWF files over to a production server could create some extra work, because each Uniform Resource Identifier (URI) in the NetConnection.connect statement in your SWF files will have to be edited to connect to the production server rather than the development server.

If a relative path is used, then the Macromedia Flash Player will assume that the machine hosting the SWF is the Macromedia Flash Communication Server, and that the directory containing the SWF is the right application directory. As long as the application has the same name on both the development and production servers, then no editing of URIs is required.

If the SWF never resides on the same machine as the Macromedia Flash Communication Server, then an absolute path is required and will have to be edited if files are moved at production time.