• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint

NetConnection

The first step in any Flash communication app is to connect to the server through the NetConnection object. Once connected, you can do all kinds of wild things (such as publish or play media streams plus send and receive messages to other connected users to name the two biggies). It always begins with a connection, however, and everything that follows is tied to that connection. Luckily it’s pretty easy to confirm your connection gets established properly before preceding.

Basic Connecting

You can connect to an FCS app with just two lines of code; however, it’s really best to set up a callback because it’s an asynchronous operation. That is, you need to wait for the connection to complete before proceeding (and, confirm it was successful). Listing 8.1 is a nice starter skeleton on which to build.


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


  
  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint