Home > Flash Media Server > Connecting to Flash Media Server Application

Connecting to Flash Media Server Application

This article will guide you how we can connect to Adobe Flash Media Server Application using Adobe Flash 8 or Adobe Flash MX 2004 Professional. To connect to remote servers using Flash, NetConnection class is used. For more information on NetConnection Class you can go through Action Script NetConnection Class
Flash Media Server uses RTMP(Real Time Messaging Protocol) for communicating with the Client Flash Application.

 
//create a netConnection object
var nc = new NetConnection();
 
//keep an eye on the status events, we need to know when we have connected up
nc.onStatus = function(info) {
	if(info.code == "NetConnection.Connect.Success") {
		trace("Hurray Connected to Flash Media Server Application");
	}
}
 
//connecting to Flash Media Server
nc.connect("rtmp://127.0.0.1/audiotest/");

Your email:

 


Code Explanation:

  • Here i am creating new NetConnection() object
  • NetConnection.onStatus() function will give us the status of the connection to the remote server
  • NetConnection.Connect.Success indicates successfull connection to the Flash Media Server and i am printing a message here
  • Finally i am connecting to the audiotest application inside the Flash Media Server


Custom Search

Popular Articles:

Share and Enjoy:
  • Print
  • Digg
  • del.icio.us
  • Facebook
  • Google Bookmarks
  • DZone
  • email
  • IndianPad
  • LinkedIn
  • Live
  • MySpace
  • Netvibes
  • RSS
  • Technorati
  • Yahoo! Bookmarks
  • Yahoo! Buzz
  • Reddit
  • Add to favorites
  • PDF
  • Twitter
  1. No comments yet.
  1. No trackbacks yet.