
ADOBE FLASH MEDIA INTERACTIVE SERVER
Server-Side ActionScript Language Reference
74
Example
The following example defines a function for the
onStatus() handler that outputs messages to indicate whether the
connection was successful:
nc = new NetConnection();
nc.onStatus = function(info){
if (info.code == "NetConnection.Connect.Success") {
_root.gotoAndStop(2);
} else {
if (! nc.isConnected){
_root.gotoAndStop(1);
}
}
};
NetConnection.uri
nc.uri
Read-only; a string indicating the URI parameter of the NetConnection.connect() method. This property is set
to
null before a call to NetConnection.connect() or after a call to NetConnection.close().
Availability
Flash Communication Server 1
NetStream class
Opens a one-way streaming connection between Flash Media Interactive Server and a remote Flash Media Inter-
active Server through a NetConnection object. A NetStream object is a channel inside a NetConnection object; call
NetStream.publish() to publish data over this channel. Unlike a client-side NetStream object, a server-side
NetStream object can only publish data; it cannot subscribe to a publishing stream or play a recorded stream.
Use the NetStream class to scale live broadcasting applications to support more clients. Flash Media Interactive
Server can support only a certain number of subscribing clients. To increase that number, you can use the NetStream
class to move traffic to remote servers while still maintaining only one client-to-server connection.
Code Level Meaning
NetConnection.Call.Failed error The NetConnection.call() method was not able to invoke the server-
side method or command.
NetConnection.Connect.AppShutdown error The application has been shut down (for example, if the application is out of
memory resources and must shut down to prevent the server from crashing)
or the server has shut down.
NetConnection.Connect.Closed status The connection was closed successfully.
NetConnection.Connect.Failed error The connection attempt failed.
NetConnection.Connect.Rejected error The client does not have permission to connect to the application, or the
application name specified during the connection attempt was not found
on the server. This information object also has an application property
that contains the value returned by
application.rejectConnection().
NetConnection.Connect.Success status The connection attempt succeeded.
Commenti su questo manuale