Macromedia flash media server 2-client-side actionscript language reference for flash media server 2 ユーザーズマニュアル

ページ / 156
66
Client-Side ActionScript Language Reference
Description
Constructor; creates an object that can be used to connect Flash Player to the Flash Media 
Server or to an application server. After creating the NetConnection object, use 
 to make the actual connection. 
For information on using Flash with an application server, se
Example
The following 
doConnect()
 function uses the NetConnection constructor to create a new 
connection and connect to the server: 
function doConnect() {
// Make a new connection object.
var my_nc:NetConnection = new NetConnection();
/* Get the name of the server from user input
and assign it to a variable named myURL. */
var myURL_str:String = serverName;
// Connect to the service.
my_nc.connect("rtmp://" + myURL_str + "/someApp/someInstance");
}
See also
NetConnection.call()
Availability
Flash Player 6.
Flash Communication Server MX 1.0.
Usage
call(remoteMethodresultObject | null [, p1,...,pN])
Parameters
remoteMethod
  A parameter in the form 
[/objectPath/]method
; if you are calling a 
method on a NetConnection object, you can omit 
objectPath
. For example, the parameter 
/
someObj/doSomething
 means the server must call the 
someObj.doSomething
 method of the 
application passed to 
 in its 
targetURI
 parameter, passing the 
specified 
p1,...,pN
 parameters.