• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

Appendix: IV Appendixes: Quick Reference... > ActionScript Connect and Connect UI ...

ActionScript Connect and Connect UI Components

When you do not plan to use the SimpleConnect UI component, use these scripts in Listings E.1 and E.2 on the client and on the server to make your connection work with other UI components.

Listing E.1. Flash ActionScript

// instantiate the NetConnection Object
nc = new NetConnection();
// create an onStatus Handler for nc
nc.onStatus = function(info) {
      trace(“LEVEL: “+info.level+”  CODE: “+info.code);
      if (info.code == “NetConnection.Connect.Success”) {
            // ** place your code here to execute when the server accepts **
      }
};

// make a connection request (invoke the application.onConnect)
// pass two additional parameters to the onConnect method (userName, Password)
nc.connect(“rtmp://myApplication/myInstance”, “Tracey Davis”, “Bert”);

// Connect any UI Components to the connection
peopleList_mc.connect(nc);
connectionLight_mc.connect(nc);
chat_mc.connect(mc);


					  


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


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