RTMP/E
addApp(appname:String) : Object
HTTP
http://www.example.com:1111/admin/addApp?auser=username&apswd=password&app|appname=applicationname
Adds a new application to the virtual host you are connected to by creating the required directory for the new application in the directory tree. Once the directory for the new application is created, you (or another administrator with file system access) can put any required server-side scripts in the directory. The client-side code uses the new application directory in the URI parameter of the NetConnection.connect call.
A virtual host may have multiple application directories. This application is created in the first application directory specified in the XML configuration file.
Availability
Flash Communication Server 1.0.
Parameters
app|appname
A String indicating the name of the application to be added.
auser
A String indicating the user name of the administrator.
apswd
A String indicating the password of the administrator.
Returns
RTMP/E
If the call succeeds, the server returns an Object with a level property of status and a code property of NetConnection.Call.Success.
If the call fails, the server returns an Object with a level property of error and a code property of NetConnection.Admin.CommandFailed or a more specific value, if available. Some objects might also have a description property that contains a string describing the cause of the failure.
HTTP
The call returns XML with the following structure:
<result> <level></level> <code></code> <timestamp></timestamp> </result>The XML elements contain the same information as the Object properties returned in an RTMP/E call. The XML may contain a description element if available.
Note: The timestamp response over HTTP is formatted differently on Windows (9/23/2007 6:16:40 PM) and Linux (Sun 23 Sep 2007 06:16:40 PM IST).
Example
The following example shows a call to add the ChatApp application to the connected virtual host:
nc_admin = new NetConnection(); nc_admin.connect("rtmp://localhost:1111/admin", "JLee", "x52z49ab"); nc_admin.call("addApp", new onAddApp(), "ChatApp");