<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Geek.blog &#187; NetConnection</title>
	<atom:link href="http://blog.728media.com/tag/netconnection/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.728media.com</link>
	<description>Advanced Flash and Actionscript 3 by Andrew Christensen</description>
	<lastBuildDate>Wed, 12 Aug 2009 04:30:01 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Connecting to a Flash Media Server using RTMP</title>
		<link>http://blog.728media.com/2008/08/03/connecting-to-a-flash-media-server-using-rtmp/</link>
		<comments>http://blog.728media.com/2008/08/03/connecting-to-a-flash-media-server-using-rtmp/#comments</comments>
		<pubDate>Mon, 04 Aug 2008 04:06:49 +0000</pubDate>
		<dc:creator>Andrew Christensen</dc:creator>
				<category><![CDATA[AS3]]></category>
		<category><![CDATA[actionscript]]></category>
		<category><![CDATA[adobe]]></category>
		<category><![CDATA[flash]]></category>
		<category><![CDATA[flash media server]]></category>
		<category><![CDATA[flash video]]></category>
		<category><![CDATA[flash video streaming]]></category>
		<category><![CDATA[NetConnection]]></category>
		<category><![CDATA[NetStream]]></category>
		<category><![CDATA[rtmp]]></category>
		<category><![CDATA[stream]]></category>
		<category><![CDATA[streaming]]></category>
		<category><![CDATA[Video]]></category>

		<guid isPermaLink="false">http://blog.728media.com/?p=70</guid>
		<description><![CDATA[RTMP is the protocol used by Adobe&#8217;s Flash Media Server to stream content into flash. Most of the help documentation doesn&#8217;t touch much on this method of connection and is limited to sources not easily available to users. This article should be used by those with an understanding of video playback using actionscript 3. If that [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://blog.728media.com/wp-content/uploads/2008/08/fms.bmp"><img class="alignnone size-full wp-image-76" title="fms" src="http://blog.728media.com/wp-content/uploads/2008/08/fms.bmp" alt="" /></a></p>
<p><a href="http://en.wikipedia.org/wiki/Real_Time_Messaging_Protocol">RTMP</a> is the protocol used by <a href="http://www.adobe.com/products/flashmediaserver/">Adobe&#8217;s Flash Media Server</a> to stream content into flash. Most of the help documentation doesn&#8217;t touch much on this method of connection and is limited to sources not easily available to users.<br />
<span id="more-70"></span></p>
<p><strong>This article should be used by those with an understanding of video playback using actionscript 3. If that isn&#8217;t you, please read </strong><a href="http://theflashblog.com/?p=233"><strong>this article</strong></a><strong> before continuing.</strong></p>
<p><strong>1.)</strong> In order to use the RTMP protocol, you will need to install and run a version of Adobe Flash Media Server. Adobe has released a free <a href="http://www.adobe.com/go/tryflashmediaserver">developer version</a> the limits you to 10 connections. That will be MORE than enough to do some basic development. Please make sure you are running or have access to a Flash Media Server before continuing to the next step.</p>
<p style="padding-left: 30px;"><strong>1.) (B)</strong> If you are having trouble installing or setting up an app, please read <a href="http://www.adobe.com/devnet/flashmediaserver/articles/beginner_live_fms3.html">this article.</a></p>
<p><strong>2.)</strong> Now that you have access to a Flash Media Server, we will start with some basic code that should look familiar if you have worked with actionscript and video before. For this step, you will need to know the URI for the server. If you installed Flash Media server on the machine you are running on, you can use &#8220;localhost&#8221; for the URI. We will be using the &#8220;vod&#8221; app that comes pre-installed on the server for this example.</p>
<pre lang="ACTIONSCRIPT">var nc:NetConnection = new NetConnection();
nc.connect("rtmp://YOUR_SERVER_URI/vod/");</pre>
<p>If we were loading an flv file without streaming, you would have passed null to the connect() method instead.</p>
<p><strong>3.)</strong> The only thing left is to load the stream, instead of loading an FLV video from a URL. This is actually much easier than you think. Instead of passing a URLRequest to the NetStream.play() method, you would instead pass the name of the stream you wish to play from within your app (this is the name of the FLV file on the server, but without the .FLV extension). To playback an HD streaming file, you will need to format your stream name slightly different: &#8220;mp4:NAME_OF_STREAM.mp4&#8243;</p>
<ul>
<li><strong>Please note that you can not setup your NetStream until after the NetConnection has successfully connected. You will know this from the NetStatus event: NetConnection.Connect.Success that is dispatched.</strong></li>
</ul>
<pre lang="ACTIONSCRIPT">var ns:NetStream = new NetStream(nc);
ns.play("NAME_OF_STREAM");
// ns.play("mp4:NAME_OF_STREAM.mp4");  // this will stream an HD movie instead.</pre>
<p><strong>4.)</strong> That&#8217;s it! I hope this article has helped. Please comment below with any questions and I would be glad to help answer them.</p>
<p>For a more informative tutorial, check out <a href="http://www.peachpit.com/articles/article.aspx?p=665127&amp;seqNum=7">this one</a> from <a href="http://www.peachpit.com">Peachpit</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.728media.com/2008/08/03/connecting-to-a-flash-media-server-using-rtmp/feed/</wfw:commentRss>
		<slash:comments>44</slash:comments>
		</item>
	</channel>
</rss>
