User Guide
6 Server Management ActionScript Language Reference
When the administration server host to which you want to connect is a virtual host (one of
several services on the same machine), make sure to specify the virtual host’s domain name, or
IP Address, as part of the URI—for example,
rtmp://www.myVhost.com/admin:1111. That
way, when you connect to the host machine, you connect to an instance of the server running
on your specified virtual host.
Only valid administrators, as defined in the Users.xml configuration file, can connect to the
server. You must specify two administrative parameters, the user name and the password for a
valid administrator, to the
NetConnection.connect method.
The following example shows the call that lets the administrator
MHill with password
635xjh27 connect to the server on localhost:
nc = new NetConnection();
nc.connect("rtmp://localhost:1111/admin", "MHill", "635xjh27");
To prevent unauthorized users from accessing the administration server, you should use a
firewall and limit access to the administration server port (port 1111). For more information
about security for Flash Media Server, see the security white papers at www.macromedia.com/
go/flashmediaserver_security_en.
Syntax example
To make a Server Management ActionScript API call, you’ll want to include a callback
handler and any required parameters in your code.
In the following example, the
getAppStats method is called to retrieve the performance data
of a running application; the callback handler
new receiveAppStats captures the result of
the call; and the value
ChatApp is a required parameter that specifies the name of the
application:
nc = new NetConnection();
nc.connect("rtmp://localhost:1111/admin", "MHill", "635xjh27");
// Call getAppStats
nc.call("getAppStats", new receiveAppStats(), "ChatApp");