14.2. Connecting to the FlashCom Server
You want to connect to a FlashCom server application.
NetConnection object and
method from it. To detect the connection status, add an
onStatus( ) method to the
NetConnection class enables
connect your Flash movies to a FlashCom server application. You first
need to create a
NetConnection object and then
connect( ) method from that instance.
connect( ) method requires the Universal
Resource Identifier (URI) to the FlashCom server application to which
you wish to connect.
// Create the
NetConnectionobject. myConnection = new NetConnection( ); // Call the
connect( )method to connect to an application named
myApplication, where // the FlashCom server is on the same machine as the
The URI must always be in one of two formats (the items in brackets are optional):
You should use the first URI format when the FlashCom server and the
.swf file are not on the same machine (as is the
case in most production environments). The second URI format is
acceptable when the FlashCom server and the