NetConnection class
69
Parameters
targetURI
The Uniform Resource Identifier (URI) of the application on the Flash Media
Server that runs when the connection is made. For
targetURI
, use the following general
format (items in brackets are optional):
protocol
:[
//host
][
:port
]/
appname
/[
instanceName
]
For
protocol
, specify either
rtmp
,
rtmpt
, or
rtmps
. If
rtmp
is specified, Flash Player will
create a persistent socket connection with Flash Media Server. If
rtmpt
is specified, Flash
Player will create an HTTP “tunneling” connection to the server. If
rtmps
is specified, Flash
Player will create a secure connection to the server. For more information on RTMP, RTMPT,
and RTMPS, see the description section below.
You can omit the
host
parameter if the SWF file is served from the same host where Flash
Media Server is installed.
If the
instanceName
parameter is omitted, Flash Player connects to the application’s default
instance (
_definst_
).
By default, RTMP connections use port 1935, and RTMPT connections use port 80.
For example, the following URIs are formatted correctly:
■
rtmp://www.myCompany.com/myMainDirectory/groupChatApp/HelpDesk
■
rtmpt:/sharedWhiteboardApp/June2002
■
rtmp::1234/chatApp/room_name
p1 ... pN
Optional parameters of any type to be passed to the application specified in
targetURI
. If the application is unable to process the parameters in the order in which they
are received,
NetConnection.onStatus
is invoked with the
code
property set to
NetConnection.Connect.Rejected
.
Returns
A Boolean value of
true
if you passed in a valid URI; otherwise,
false
. (To determine if the
connection was successfully completed, use
NetConnection.onStatus
.)
Description
Method; connects to an application on the Flash Media Server. This method can also be used
to communicate with an application server. For information, see
http://
www.macromedia.com/go/flashmediaserver_desdev_en
.