MACROMEDIA FLASH MEDIA SERVER 2 Reference

Type
Reference
Server Management ActionScript
Language Reference
Trademarks
1 Step RoboPDF, ActiveEdit, ActiveTest, Authorware, Blue Sky Software, Blue Sky, Breeze, Breezo, Captivate, Central,
ColdFusion, Contribute, Database Explorer, Director, Dreamweaver, Fireworks, Flash, FlashCast, FlashHelp, Flash Lite,
FlashPaper, Flex, Flex Builder, Fontographer, FreeHand, Generator, HomeSite, JRun, MacRecorder, Macromedia, MXML,
RoboEngine, RoboHelp, RoboInfo, RoboPDF, Roundtrip, Roundtrip HTML, Shockwave, SoundEdit, Studio MX, UltraDev,
and WebHelp are either registered trademarks or trademarks of Macromedia, Inc. and may be registered in the United States or
in other jurisdictions including internationally. Other product names, logos, designs, titles, words, or phrases mentioned within
this publication may be trademarks, service marks, or trade names of Macromedia, Inc. or other entities and may be registered in
certain jurisdictions including internationally.
Third-Party Information
This guide contains links to third-party websites that are not under the control of Macromedia, and Macromedia is not
responsible for the content on any linked site. If you access a third-party website mentioned in this guide, then you do so at your
own risk. Macromedia provides these links only as a convenience, and the inclusion of the link does not imply that Macromedia
endorses or accepts any responsibility for the content on those third-party sites.
Sorensonâ„¢ Sparkâ„¢ video compression and decompression technology licensed from
Sorenson Media, Inc.
Copyright © 2002-2005 Macromedia, Inc. All rights reserved. This manual may not be copied, photocopied, reproduced,
translated, or converted to any electronic or machine-readable form in whole or in part without written approval from
Macromedia, Inc. Notwithstanding the foregoing, the owner or authorized user of a valid copy of the software with which
this manual was provided may print out one copy of this manual from an electronic version of this manual for the sole
purpose of such owner or authorized user learning to use such software, provided that no part of this manual may be
printed out, reproduced, distributed, resold, or transmitted for any other purposes, including, without limitation,
commercial purposes, such as selling copies of this documentation or providing paid-for support services.
Acknowledgments
Project Management: Suzanne Smith
Writing: Jody Bleyle
Managing Editor: Rosana Francescato
Editing: Geta Carlson
Production Manager: Adam Barnett
Media Design and Production: Aaron Begley, Paul Benkman, John Francis, Mario Reynoso
Special thanks to Erick Vera and the Flash Media Server engineering and QA teams.
First Edition: October 2005
Macromedia, Inc.
601 Townsend St.
San Francisco, CA 94103
3
Contents
Server Management ActionScript Language Reference . . . . . . . . 5
Using the Server Management ActionScript API . . . . . . . . . . . . . . . . . . . 5
Establishing the connection to the server . . . . . . . . . . . . . . . . . . . . . . . . . . 5
A simple application example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
Information objects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .9
Method summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .9
addAdmin() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
addApp() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
addVHostAlias() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
approveDebugSession(). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
changePswd() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
gc(). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
getActiveInstances() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
getAdaptors() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
getAdminContext(). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
getAdmins() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
getApps() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
getAppStats() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
getConfig() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
getConfig2() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .27
getGroupMembers() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30
getGroupStats() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31
getGroups() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32
getInstanceStats() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33
getIOStats() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35
getLicenseInfo() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .37
getLiveStreams() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39
getLiveStreamStats() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40
getMsgCacheStats() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41
getNetStreams(). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42
getNetStreamStats() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42
getRecordedStreams() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44
getRecordedStreamStats() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45
getScriptStats() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46
4
getServerStats() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47
getServices() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48
getSharedObjects() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49
getSharedObjectStats(). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50
getUsers() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51
getUserStats() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52
getVHosts(). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53
getVHostStats(). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54
ping() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56
reloadApp() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56
removeAdmin() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57
removeApp(). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58
removeVHostAlias() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59
restartVHost(). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60
setConfig() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62
setConfig2() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65
startServer() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 68
startVHost() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 69
stopServer() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 70
stopVHost() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .71
unloadApp() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 72
5
Server Management ActionScript
Language Reference
Macromedia Flash Media Server includes a set of advanced methods, the Server Management
ActionScript application programming interface (API), that lets you extend the management
console or make your own administration and monitoring tools by creating Macromedia
Flash applications.
This document describes the Server Management ActionScript API. For information about
ActionScript, see the ActionScript 2.0 Language Reference. For information about Flash Media
Server, see the Client-Side ActionScript Language Reference for Flash Media Server 2, the
Server-Side ActionScript Language Reference, and Managing Flash Media Server.
Using the Server Management
ActionScript API
To use the Server Management ActionScript API, you need to have Flash and Flash Media
Server installed, and you need to have administrative access to Flash Media Server. You should
be fluent in ActionScript and in creating Flash applications.
Establishing the connection to the server
Flash Media Server communicates on port 1935 (the default port). However, to use the Server
Management ActionScript API, you must connect to Flash Media Server through the
administration server on port 1111.
You establish a connection using the
NetConnection.connect() method, passing in three
parameters: the URI of the host administration server, an administrator user name, and an
administrator password.
NOTE
This document assumes that you have not changed the default port number for the
administration server; if you have, use your valid port number instead of port 1111.
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");
A simple application example 7
A simple application example
This section contains the code for a simple Flash application that calls the getAppStats
method. You can copy and paste this code into Flash to see how a simple call works.
In Flash, create an application with the following elements:
â–  An input field named Application Name with a border
â–  A button that calls the doGetAppStats() method (shown in the code sample that
follows)
â–  A multiline, dynamic text field called outputBox that has a border
â–  A scroll component next to the text field
This simple interface lets you test the Server Management ActionScript API.
Next, in the Actions panel, enter the sample ActionScript code that follows. Be sure to replace
admin_name and admin_pass with your valid administrator name and password.
/** Establishes the connection to Flash Media Server **/
nc = new NetConnection();
nc.connect("rtmp://localhost:1111/admin","admin_name","admin_pass");
/** Makes the API call, for example, "GetAppStats" **/
function doGetAppStats() {
function onGetAppStats()
{
this.onResult = function(info)
{
if (info.code != "NetConnection.Call.Success")
outputBox.text = "Call failed: " + info.description;
else {
outputBox.text = "Info for "+appName.text+ " returned:" + ¬
newline;
printObj(info, outputBox);
}
}
}
nc.call("getAppStats", new onGetAppStats(), appName.text);
}
// This function proceeds through an object, printing all values to the
// destination, including recursively printing objects within objects.
// The tabLevel parameter is used for cosmetic purposes.
function printObj(obj, destination, tabLevel)
NOTE
The continuation character (¬) indicates that the code continues to the next line; this
character should not appear in code.
8 Server Management ActionScript Language Reference
{
if (arguments.length < 2) {
trace("ERROR! you need to supply a text object to output to");
return;
}
if (arguments.length < 3)
tabLevel = 0;
for (var prop in obj) {
for (var i = 0; i < tabLevel; i++) // insert requested # of tab
characters
destination.text += "\t";
destination.text += prop + " = " + obj[prop] + newline;
if (typeof (obj[prop]) == "object") { // recursively call printObj
printObj(obj[prop], destination, tabLevel+1 );
}
}
}
// Alerts you if there are errors connecting to the server.nc.onStatus =
function(info) {
if (info.code == "NetConnection.Connect.Success") {
trace("Connected! The call should work")
} else {
// Use nc.isConnected to test condition of server
if (! nc.isConnected)
trace("NO netConnection to server. Call will not work");
}
}
Method summary 9
Information objects
All Server Management ActionScript API methods return data in an information object with
the following properties:
level, code, timestamp, data, description, and details. All
information objects have
level, code, and timestamp properties. Some methods have the
data property, which contains return data (often in an object or array), and the description
and
details properties, which typically provide information about errors.
In addition to the information objects that are documented in the Client-Side ActionScript
Language Reference for Flash Media Server 2, the NetConnection class has information objects
that are specific to the Server Management ActionScript API. The following table lists the
code and level properties, as well as the meaning of commonly returned information
objects.
Method summary
The Server Management ActionScript API contains the following three types of methods:
â–  Queries let you monitor Flash Media Server, its applications, and specific instances of its
applications.
â–  Administrative commands let you perform administrative tasks for Flash Media Server,
such as adding administrative users and starting and stopping the server, virtual hosts, and
applications.
â–  Configuration commands: the getConfig2() command lets you view server
configuration keys, and the
setConfig2() command lets you set values for the keys.
Code Level Meaning
NetConnection.Call.Success Status
The call is successful.
This information object includes a
data
property, which returns detailed information
in an object or array.
NetConnection.Admin.CommandFailed Error
The method called is nonexistent.*
NetConnection.Call.Failed Error
A general failure has occurred.*
NetConnection.Call.BadValue Error
The value of a parameter is invalid.*
* This information object contains description and detail properties, which are strings that
provide a more specific reason for the failure.
10 Server Management ActionScript Language Reference
Some methods are available only to server administrators, as indicated by an asterisk (*) in the
description of each method; virtual host administrators cannot use these methods. In some
cases, virtual administrators can use a method with restrictions; these restrictions are described
in the dictionary entry for the method.
Queries for monitoring the server
The following table lists the methods you can use to monitor the server.
NOTE
Parameters in square brackets ([]) are optional; all other parameters are required. If you
don’t specify an optional parameter, a default value might be used, depending on the
method. For example, if you don’t specify a virtual host in the
scope parameter, it is
assumed that you want to perform the command on the virtual host to which you
connected when you logged on to Flash Media Server.
Method Description
approveDebugSession() Approves a pending debug session’s request to connect to a
selected application.
getActiveInstances() Returns an array of strings that contains the names of all running
application instances on the connected virtual host.
getAdaptors() Returns an array of adaptor names.
getAdminContext() Returns the administrative context for the administrator
(administrator type, name of adaptor, and name of the virtual
host).
getAdmins() Returns all the administrators on the Flash Media Server.
getApps() Returns an array of strings that contains the names of all the
applications that are installed.
getAppStats() Returns aggregate information of all instances for an application.
getGroupMembers() Returns a list of the group members for a particular group.
getGroupStats() Returns statistics for a particular group connection.
getGroups() Returns a list of the group connections for a particular application
instance.
getInstanceStats() Returns detailed information about a single running instance of
an application.
getIOStats() Returns the I/O information: bytes in, bytes out, and so on.*
getLicenseInfo() Returns license key information.
getLiveStreams() Returns a list of all live streams currently publishing to a particular
application.
Method summary 11
getLiveStreamStats() Returns detailed information about a live stream.
getMsgCacheStats() Returns server TCMessage cache statistics.
getNetStreams() Returns a list of all network streams that are currently connected
to the application.
getNetStreamStats() Returns detailed information about a specific network stream.
getRecordedStreamStats() Returns detailed information about a recorded stream.
getRecordedStreams() Returns an Array containing the name of all the recorded streams
currently playing from a particular instance of an application.
getScriptStats() Gets the performance data for a script running on the specified
instance of an application.
getServerStats() Retrieves the server status and statistics about the operation of
the server, including the length of time the server has been
running and I/O and message cache statistics.*
getServices() Returns an array containing the names of all the services
currently connected to Flash Media Server.
getSharedObjects() Returns a list of all persistent and nonpersistent shared objects
that are currently in use by the specified instance of an
application.
getSharedObjectStats() Returns detailed information about a shared object.
getUsers() Returns a list of all users who are currently connected to the
specified instance of an application.
getUserStats() Returns detailed information about a specified user.
getVHosts() Returns an array of vhosts defined for the specified adaptor.
getVHostStats() Returns statistics for a vhost.
ping() Returns a status string indicating the condition of the server.
* Only server administrators can use this method.
Method Description
12 Server Management ActionScript Language Reference
Commands for managing the server
The following table lists the methods you can use to manage the server.
Commands for configuring the server
The following table lists the methods you can use to configure the server.
Entries in this document are listed alphabetically.
Method Brief description
addAdmin() Adds an administrator to the system.*
* Only server administrators can use this command.
addApp() Adds a new application.
addVHostAlias() Adds an alias to a virtual host.
changePswd() Changes the password for an administrator in the system.
gc() Forces garbage collection of server resources.*
reloadApp() Unloads an instance of an application if it is loaded, and then reloads the
instance.
removeAdmin() Removes an administrator from the system.*
removeApp() Removes an application or an instance of an application.
removeVHostAlias() Removes an alias from a virtual host.
restartVHost() Restarts a virtual host.
startServer() Starts or restarts Flash Media Server.*
startVHost() Starts the specified virtual host if it stops. Enables a new virtual host if
the virtual host directories have been created in the file system.*
stopServer() Shuts down the Flash Media Server.*
stopVHost() Stops a virtual host.
unloadApp() Unloads all instances of an application or one instance of an application.
Disconnects all users.
Method Description
getConfig2() Returns configuration information for the specified configuration key.
setConfig2() Sets a value for a specified configuration key.
addAdmin() 13
addAdmin()
Availability
â–  Flash Player 6.
â–  Flash Communication Server MX 1.0.
Usage
addAdmin(admin_name, password [,scope])
Parameters
admin_name A string that contains the user name of the administrator being added.
password Password of that administrator. The password is encoded before it is written to
the Server.xml configuration file.
scope Optional; string that specifies whether the administrator is a server administrator or a
virtual host administrator, and for which virtual host. To add a server administrator, specify
server.
To add a virtual host administrator to the virtual host to which you’re connected, omit this
parameter. To add a virtual host administrator to a different virtual host, specify the virtual
host as
adaptor_name/virtual_host_name.
Returns
If the call succeeds, the server sends a reply information object with a level property of
status and a code property of NetConnection.Call.Success. The Server.xml
configuration file is updated with the new administrator.
If the call fails, the server sends a reply information 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.
If the specified administrator already exists in the system, this command fails.
Description
Adds an administrator to the system. You can add a server administrator or a virtual host
administrator, depending on the parameters you specify.
You must be a server administrator to add an administrator to the system.
14 Server Management ActionScript Language Reference
Example
The following three examples show how you can specify parameters in a call to the addAdmin
command:
/* Adds a server administrator named "GLee" with password "boat4907" */
nc.call("addAdmin", new onAddAdmin(), "GLee", "boat4907", "server");
/* Adds a virtual host administrator named "ChrisM" with password "tree2981"
*/
nc.call("addAdmin", new onAddAdmin(), "ChrisM", "tree2981");
/* Adds a virtual host administrator "DHong" with password "wate3235" */
/* for vhost tree.oak.com */
nc.call("addAdmin", new onAddAdmin(), "DHong", "wate3235", "_defaultRoot_/¬
tree.oak.com");
addApp()
Availability
â–  Flash Player 6.
â–  Flash Communication Server MX 1.0.
Usage
addApp(app_name)
Parameters
app_name A string that contains the name of the application to be added.
Returns
If the call succeeds, the server sends a reply information object with a level property of
status and a code property of NetConnection.Call.Success.
If the call fails, the server sends a reply information object with a level property of error
and a
code property of NetConnection.Call.BadValue 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.
Description
Adds a new application to the virtual host 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.
addVHostAlias() 15
Example
The following example shows a call to add the ChatApp application to the connected virtual
host:
nc = new NetConnection();
nc.connect("rtmp://localhost:1111/admin", "JLee", "x52z49ab");
nc.call("addApp", new onAddApp(), "ChatApp");
addVHostAlias()
Availability
â–  Flash Player 6.
â–  Flash Media Server 2.
Usage
addVHostAlias(VHostName, AliasName, PersistValue)
Parameters
VHostName A string indicating the virtual host to which to add an alias.
AliasName A string indicating the alias name to add to the specified vhost.
PersistValue A Boolean value indicating whether the alias change will be written to the
configuration file to last beyond the vhost's next restart (true), or whether this alias will be lost
on vhost restart (false).
Returns
If the call succeeds, the server sends a reply information object with a level property of
status, and a code property of NetConnection.Call.Success.
Description
Adds an alias to a virtual host. Aliases are alternative names for vhosts that are used as targets
by incoming Flash Media Server connections. When you remove an alias, that name is no
longer available for incoming connections.
Before this API was available, alias names had to be added to the configuration files manually.
See also
removeVHostAlias()
16 Server Management ActionScript Language Reference
approveDebugSession()
Availability
â–  Flash Player 6.
â–  Flash Media Server 2.
Usage
approveDebugSession(appInst, PIN)
Parameters
appInst A string indicating the application and instance name that has a pending debug
connection to approve.
PIN A number indicating the debug session Personal Identification Number. Each debug
connection issues a debug number when queueing to connect to an application. This same
number is included on this API. When this API is processed, the PIN numbers are matched
and the corresponding connection is allowed to connect. This is a security measure to prevent
unauthorized users from using the debug connection.
Keep in mind that 0 is not a valid
PIN value. To maintain security, PIN numbers should not
be able to be easily guessed. PIN numbers must be non-zero and must be within the range of
+/- (2^31 - 1) that is between positive or negative 2147483648. If there is a pending
connection with a given PIN, and another connection arrives with the same PIN while the
original is still waiting, the second connection with the same PIN will be rejected as a security
measure.
Returns
If the call succeeds, the server sends a reply information object with a level property of
status, a code property of NetConnection.Call.Success.
Description
Approves a pending debug session’s request to connect to a selected application. Once
approved and permitted, the debug session may connect to its application through the
Services.onDebugConnect gateway and act as a regular client.
Connecting to an application with a debug session allows you to view the streams and shared
objects for an application through the management console.
Example
The following is an example of a Debug connection:
nc.connect("rtmp://serverName/appName%3F%5Ffcs%5Fdebugreq%5F%3D1234");
// The original string is _fcs_debugreq_=1234.
changePswd() 17
The following is an example of a Debug approval request:
nc_admin.call("approveDebugSession", null, appName/instName", 1234);
changePswd()
Availability
â–  Flash Player 6.
â–  Flash Communication Server MX 1.0.
Usage
changePswd(admin_name, password [, scope])
Parameters
admin_name A string that contains the name of the administrator whose password is being
changed.
password A string that contains that administrator’s new password.
scope Optional; a string that specifies whether the administrator is a server administrator or
virtual host administrator, and for which virtual host.
To change the password for the specified administrator on the virtual host to which you’re
connected, omit this parameter. To change the password for the specified administrator on a
different virtual host, specify
adaptor_name/virtual_hostname.
To change a server administrator’s password, specify
server.
Returns
If the call succeeds, the server sends a reply information object with a level property of
status and a code property of NetConnection.Call.Success.
If the call fails, the server sends a reply information 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.
If the specified administrator does not exist, this command fails.
Description
Changes the password for the specified administrator. The password is encoded before it is
written to the Server.xml configuration file.
Virtual host administrators can change only their own password.
18 Server Management ActionScript Language Reference
Example
/* Change password for server administrator named "ASilva" to "cbx5978y" */
nc.call("changePswd", new onChangePswd(), "ASilva", "cbx5978y", "server");
/* Change password for virtual host administrator named "JLee" to "kbat3786"
*/
nc.call("changePswd", new onChangePswd(), "JLee", "kbat3786");
/* Change password for virtual host administrator "JLee" to "kbat3786" on */
/* virtual host "tree.oak.com" */
nc.call("changePswd", new onChangePswd(), "JLee", "kbat3786",
"_defaultRoot_/¬ tree.oak.com");
gc()
Availability
â–  Flash Player 6.
â–  Flash Communication Server MX 1.0.
Usage
gc()
Parameters
None.
Returns
If the call succeeds, the server sends a reply information object with a level property of
status and a code property of NetConnection.Call.Success.
If the call fails, the server sends a reply information 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.
Description
Forces collection and elimination of all server resources that are no longer used, such as closed
streams, instances of applications, and nonpersistent shared objects. This operation is
performed within about one second of the call.
You must be a server administrator to perform this operation.
getAdaptors() 19
getActiveInstances()
Availability
â–  Flash Player 6.
â–  Flash Communication Server MX 1.0.
Usage
getActiveInstances([processID])
Parameters
processID A number; the process identifier of a Flash Media Server core process. This
parameter is optional.
Returns
If the call succeeds, the server sends a reply information object with a level property of
status, a code property of NetConnection.Call.Success, and a data property that is an
array of strings containing the names of all running instances of an application on the server
or on a specified process.
If the call fails, the server sends a reply information object with a
level property of error
and a
code property of NetConnection.Call.Failed 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.
Description
Returns an array of strings that contains the names of all running application instances on the
entire server (if no
processID parameter is passed), or on the process specified by the
processID parameter.
getAdaptors()
Availability
â–  Flash Player 6.
â–  Flash Communication Server MX 1.0.
Usage
getAdaptors()
Parameters
None.
20 Server Management ActionScript Language Reference
Returns
If the call succeeds, the server sends a reply information object with a level property of
status, a code property of NetConnection.Call.Success, and a data property that is an
array of strings containing the names of all the adaptors.
Description
Returns an array of adaptors that are defined. You must be a server administrator to perform
this command.
getAdminContext()
Availability
â–  Flash Player 6.
â–  Flash Communication Server MX 1.0.
Usage
getAdminContext([adminName][, adaptorName][, vhostName])
Parameters
adminName The name of an administrator.
adaptorName An alternate adaptor, other than _defaultRoot_, on which to find
administrators. If not specified,
_defaultRoot_ is used
vhostName An alternate vhost, other than _defaultVHost_, on which to find vhost
administrators. If not specified, server level admin is used.
Returns
If the call succeeds, the server sends a reply information object with a level property of
status, a code property of NetConnection.Call.Success, and a data property that is an
object. The
data object has the following properties:
Property Description
admin_type
String; the type of administrator, either server or vhost.
adaptor
String; name of the adaptor for which the user is an administrator.
vhost
String; name of the virtual host for which the user is an administrator.
connected
String; this property is deprecated and always returns true.
  • Page 1 1
  • Page 2 2
  • Page 3 3
  • Page 4 4
  • Page 5 5
  • Page 6 6
  • Page 7 7
  • Page 8 8
  • Page 9 9
  • Page 10 10
  • Page 11 11
  • Page 12 12
  • Page 13 13
  • Page 14 14
  • Page 15 15
  • Page 16 16
  • Page 17 17
  • Page 18 18
  • Page 19 19
  • Page 20 20
  • Page 21 21
  • Page 22 22
  • Page 23 23
  • Page 24 24
  • Page 25 25
  • Page 26 26
  • Page 27 27
  • Page 28 28
  • Page 29 29
  • Page 30 30
  • Page 31 31
  • Page 32 32
  • Page 33 33
  • Page 34 34
  • Page 35 35
  • Page 36 36
  • Page 37 37
  • Page 38 38
  • Page 39 39
  • Page 40 40
  • Page 41 41
  • Page 42 42
  • Page 43 43
  • Page 44 44
  • Page 45 45
  • Page 46 46
  • Page 47 47
  • Page 48 48
  • Page 49 49
  • Page 50 50
  • Page 51 51
  • Page 52 52
  • Page 53 53
  • Page 54 54
  • Page 55 55
  • Page 56 56
  • Page 57 57
  • Page 58 58
  • Page 59 59
  • Page 60 60
  • Page 61 61
  • Page 62 62
  • Page 63 63
  • Page 64 64
  • Page 65 65
  • Page 66 66
  • Page 67 67
  • Page 68 68
  • Page 69 69
  • Page 70 70
  • Page 71 71
  • Page 72 72
  • Page 73 73
  • Page 74 74

MACROMEDIA FLASH MEDIA SERVER 2 Reference

Type
Reference

Ask a question and I''ll find the answer in the document

Finding information in a document is now easier with AI