Getting Started > Connecting to the server > Opening a connection to the server |
![]() ![]() ![]() |
Opening a connection to the server
Open a new file in the Flash authoring environment, and then add the client-side ActionScript commands to connect to the server.
To connect to Flash Communication Server:
1 |
In a new Flash movie, begin opening a connection by issuing the following command: |
|
|
2 |
Follow this command with a |
|
|
In this basic syntax for |
|
|
|
|
|
Note that in all syntax examples for |
|
If you want to connect to a virtual host other than the default virtual host, specify the virtual host's name in |
For example, the following code uses the new NetConnection
constructor to create a new connection object. Then, the object is connected to the server with the call to my_nc.connect
.
// Makes a new connection object my_nc = new NetConnection(); // Connects to the instance named appInstance // of the application named appName // located on the Flash Communication Server // that is running on the virtual host myServer.myDomain.com my_nc.connect("rtmp://myServer.myDomain.com/appName/appInstance");
![]() ![]() ![]() |