

<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	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/"
		>
<channel>
	<title>Comments on: How to Play Flash Video Files (FLV) Sequentially</title>
	<atom:link href="http://www.quip.net/blog/2007/flash/actionscript-20/how-to-play-video-files-sequentially/feed" rel="self" type="application/rss+xml" />
	<link>http://www.quip.net/blog/2007/flash/actionscript-20/how-to-play-video-files-sequentially</link>
	<description>Luck is the residue of good design.</description>
	<lastBuildDate>Tue, 20 Mar 2012 15:33:23 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
	<item>
		<title>By: Raymond Monday</title>
		<link>http://www.quip.net/blog/2007/flash/actionscript-20/how-to-play-video-files-sequentially#comment-477231</link>
		<dc:creator>Raymond Monday</dc:creator>
		<pubDate>Fri, 20 Aug 2010 15:39:58 +0000</pubDate>
		<guid isPermaLink="false">http://www.quip.net/blog/2007/flash/actionscript-20/how-to-play-video-files-sequentially#comment-477231</guid>
		<description>Hi David,

The sequential flv playpack component code works perfectly, but the loop code you gave after is going right over my head. I have no idea where to put it in the AS3 code block or how to modify it to my project. I&#039;d just want a simple 1-2-3-4-back to flv 1 forever. :-)
Whatever I try, I get errors every time. Any help appreciated.
Thanks</description>
		<content:encoded><![CDATA[<p>Hi David,</p>
<p>The sequential flv playpack component code works perfectly, but the loop code you gave after is going right over my head. I have no idea where to put it in the AS3 code block or how to modify it to my project. I&#8217;d just want a simple 1-2-3-4-back to flv 1 forever. <img src='http://www.quip.net/blog/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /><br />
Whatever I try, I get errors every time. Any help appreciated.<br />
Thanks</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Eli</title>
		<link>http://www.quip.net/blog/2007/flash/actionscript-20/how-to-play-video-files-sequentially#comment-416543</link>
		<dc:creator>Eli</dc:creator>
		<pubDate>Fri, 02 Oct 2009 21:08:03 +0000</pubDate>
		<guid isPermaLink="false">http://www.quip.net/blog/2007/flash/actionscript-20/how-to-play-video-files-sequentially#comment-416543</guid>
		<description>Please Help me!!

I have this array working but I also need to have buttons to go to the 4 flv&#039;s I have in my array. The videos fall out of sequence once I do that. What I want to do is have 4 flv&#039;s play in sequence and if a user wants to whatch one out of that sequence they can and it will go to the next one and also at the last one go back to the first. make sense? 

//array
var videos:Array = new Array(&quot;flv/ownbank.flv&quot;, &quot;flv/obligations.flv&quot;, &quot;flv/rewards.flv&quot; , &quot;flv/helen.flv&quot;);
var currentVideo:Number = 0;
var duration:Number = 0;
var ready:Boolean = true;
var nc:NetConnection = new NetConnection();
nc.connect(null);
var stream_ns:NetStream = new NetStream(nc);
video_container.my_video.attachVideo (stream_ns);
stream_ns.setBufferTime(10);
video_container.my_video.smoothing = true;
stream_ns.play(videos[currentVideo]);

stream_ns.onMetaData = function(evt:Object):Void {
  duration = evt.duration;
  ready = true;
};

stream_ns.onStatus = function(evt:Object):Void {
  if (ready &amp;&amp; this.time &gt; 0 &amp;&amp; this.time &gt;= (duration - 0.5)) {
    ready = false;
    currentVideo++;
    if (currentVideo &gt;= videos.length) {
      currentVideo = 0;
    }
    stream_ns.play(videos[currentVideo]);
  }
}</description>
		<content:encoded><![CDATA[<p>Please Help me!!</p>
<p>I have this array working but I also need to have buttons to go to the 4 flv&#8217;s I have in my array. The videos fall out of sequence once I do that. What I want to do is have 4 flv&#8217;s play in sequence and if a user wants to whatch one out of that sequence they can and it will go to the next one and also at the last one go back to the first. make sense? </p>
<p>//array<br />
var videos:Array = new Array(&#8220;flv/ownbank.flv&#8221;, &#8220;flv/obligations.flv&#8221;, &#8220;flv/rewards.flv&#8221; , &#8220;flv/helen.flv&#8221;);<br />
var currentVideo:Number = 0;<br />
var duration:Number = 0;<br />
var ready:Boolean = true;<br />
var nc:NetConnection = new NetConnection();<br />
nc.connect(null);<br />
var stream_ns:NetStream = new NetStream(nc);<br />
video_container.my_video.attachVideo (stream_ns);<br />
stream_ns.setBufferTime(10);<br />
video_container.my_video.smoothing = true;<br />
stream_ns.play(videos[currentVideo]);</p>
<p>stream_ns.onMetaData = function(evt:Object):Void {<br />
  duration = evt.duration;<br />
  ready = true;<br />
};</p>
<p>stream_ns.onStatus = function(evt:Object):Void {<br />
  if (ready &amp;&amp; this.time &gt; 0 &amp;&amp; this.time &gt;= (duration &#8211; 0.5)) {<br />
    ready = false;<br />
    currentVideo++;<br />
    if (currentVideo &gt;= videos.length) {<br />
      currentVideo = 0;<br />
    }<br />
    stream_ns.play(videos[currentVideo]);<br />
  }<br />
}</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: anand</title>
		<link>http://www.quip.net/blog/2007/flash/actionscript-20/how-to-play-video-files-sequentially#comment-345424</link>
		<dc:creator>anand</dc:creator>
		<pubDate>Wed, 04 Feb 2009 07:07:59 +0000</pubDate>
		<guid isPermaLink="false">http://www.quip.net/blog/2007/flash/actionscript-20/how-to-play-video-files-sequentially#comment-345424</guid>
		<description>Hi, thanx for tutorials - 

I’m really enjoying them even though I’m new to flash:) 

But maybe you can help me with sequential video player with source for the same, working,....
:)</description>
		<content:encoded><![CDATA[<p>Hi, thanx for tutorials &#8211; </p>
<p>I’m really enjoying them even though I’m new to flash:) </p>
<p>But maybe you can help me with sequential video player with source for the same, working,&#8230;.<br />
 <img src='http://www.quip.net/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: George</title>
		<link>http://www.quip.net/blog/2007/flash/actionscript-20/how-to-play-video-files-sequentially#comment-310912</link>
		<dc:creator>George</dc:creator>
		<pubDate>Mon, 01 Dec 2008 21:02:44 +0000</pubDate>
		<guid isPermaLink="false">http://www.quip.net/blog/2007/flash/actionscript-20/how-to-play-video-files-sequentially#comment-310912</guid>
		<description>David. 

I&#039;m sure you&#039;re a busy man!. Thanks for the help!

 ok. I&#039;ve scrapped the resizing idea, and have just embeded the first animation, and then the video plays, and then I want to gotoandstop(232); or go back to the last frame in the animation, .http://www.aos5.com You can see the animation here. At the end of this animation, they want a video to play, on top of this, and then after the video is done.  go back to the last frame of the animation.  Any ideas?</description>
		<content:encoded><![CDATA[<p>David. </p>
<p>I&#8217;m sure you&#8217;re a busy man!. Thanks for the help!</p>
<p> ok. I&#8217;ve scrapped the resizing idea, and have just embeded the first animation, and then the video plays, and then I want to gotoandstop(232); or go back to the last frame in the animation, .<a href="http://www.aos5.com" rel="nofollow">http://www.aos5.com</a> You can see the animation here. At the end of this animation, they want a video to play, on top of this, and then after the video is done.  go back to the last frame of the animation.  Any ideas?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: George</title>
		<link>http://www.quip.net/blog/2007/flash/actionscript-20/how-to-play-video-files-sequentially#comment-306268</link>
		<dc:creator>George</dc:creator>
		<pubDate>Tue, 25 Nov 2008 19:14:50 +0000</pubDate>
		<guid isPermaLink="false">http://www.quip.net/blog/2007/flash/actionscript-20/how-to-play-video-files-sequentially#comment-306268</guid>
		<description>David, 
 I&#039;m a total nube in flash, but I&#039;ve got this working, and the flvs are playing great, I have one items to complicate this though.  Maybe you can help.  my first video is more like a banner for a site with an odd size.  824X285 and the second video is  a promo video with the size of 480x270.   Any way to keep that second video from stretching?  And one last thing. Is there any way to load an image after the videos have played. So it goes from a banner, to a short promo video and then just a place holder.  Does that make sense?  Thanks for you help.</description>
		<content:encoded><![CDATA[<p>David,<br />
 I&#8217;m a total nube in flash, but I&#8217;ve got this working, and the flvs are playing great, I have one items to complicate this though.  Maybe you can help.  my first video is more like a banner for a site with an odd size.  824X285 and the second video is  a promo video with the size of 480&#215;270.   Any way to keep that second video from stretching?  And one last thing. Is there any way to load an image after the videos have played. So it goes from a banner, to a short promo video and then just a place holder.  Does that make sense?  Thanks for you help.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Arunava</title>
		<link>http://www.quip.net/blog/2007/flash/actionscript-20/how-to-play-video-files-sequentially#comment-290459</link>
		<dc:creator>Arunava</dc:creator>
		<pubDate>Thu, 23 Oct 2008 10:28:39 +0000</pubDate>
		<guid isPermaLink="false">http://www.quip.net/blog/2007/flash/actionscript-20/how-to-play-video-files-sequentially#comment-290459</guid>
		<description>David,

Thanks very much for such an excellent article. It has helped me to a great extent. 

However, will you please help me out with the following problem: 

My video player will be playing two videos sequentially. When the first video plays, the second video will preload in the background. How to implement the background preloading with the existing code?

Thanks in advance!!</description>
		<content:encoded><![CDATA[<p>David,</p>
<p>Thanks very much for such an excellent article. It has helped me to a great extent. </p>
<p>However, will you please help me out with the following problem: </p>
<p>My video player will be playing two videos sequentially. When the first video plays, the second video will preload in the background. How to implement the background preloading with the existing code?</p>
<p>Thanks in advance!!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: becca</title>
		<link>http://www.quip.net/blog/2007/flash/actionscript-20/how-to-play-video-files-sequentially#comment-264091</link>
		<dc:creator>becca</dc:creator>
		<pubDate>Fri, 05 Sep 2008 10:08:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.quip.net/blog/2007/flash/actionscript-20/how-to-play-video-files-sequentially#comment-264091</guid>
		<description>GREAT POST!

I was wondering if there is a way to add fade in and out transition between movies and loop?

Thanks in advance for all your help.</description>
		<content:encoded><![CDATA[<p>GREAT POST!</p>
<p>I was wondering if there is a way to add fade in and out transition between movies and loop?</p>
<p>Thanks in advance for all your help.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: David Stiller</title>
		<link>http://www.quip.net/blog/2007/flash/actionscript-20/how-to-play-video-files-sequentially#comment-247007</link>
		<dc:creator>David Stiller</dc:creator>
		<pubDate>Tue, 12 Aug 2008 02:52:33 +0000</pubDate>
		<guid isPermaLink="false">http://www.quip.net/blog/2007/flash/actionscript-20/how-to-play-video-files-sequentially#comment-247007</guid>
		<description>Matt,

&lt;blockquote&gt;I’m sure it can be done better but it works for me.&lt;/blockquote&gt;

I find that to be true of most of my work!  Sometimes it depends on deadlines, budget, a combination of those, or something else altogether.  ;)

You might want to consider a tweak to this portion of your code:

&lt;pre&gt;&lt;code&gt;if (_vidURL.indexOf(
    &quot;rtmp://&quot; &#124;&#124; &quot;RTMP://&quot; &#124;&#124; &quot;RTMPE://&quot; &#124;&#124;
    &quot;RTMPS://&quot; &#124;&#124; &quot;rtmpe://&quot; &#124;&#124; &quot;rtmps://&quot;
  ) &gt; -1) {&lt;/code&gt;&lt;/pre&gt;

... only because, if you really want to play it safe, you may want to account for variants besides all-lowercase or all-uppercase.  One trick I&#039;ve seen pretty often is to use &lt;code&gt;String.toLowerCase()&lt;/code&gt; in the comparison expression to evaluate the target string in all lowercase ...

&lt;pre&gt;&lt;code&gt;if (_vidURL.toLowerCase().indexOf(
    &quot;rtmp://&quot; &#124;&#124; &quot;rtmpe://&quot; &#124;&#124; &quot;rtmps://&quot;
  ) &gt; -1) {&lt;/code&gt;&lt;/pre&gt;

That&#039;ll even cover bizarre variants such as &quot;RtMP&quot; and the like (not that that&#039;s especially likely).  And then, since the &quot;rtmpe&quot; and &quot;rtmps&quot; versions contain the pivotal string &quot;rtmp,&quot; it might be enough just to search for &quot;rtmp&quot; ... but like you said, this is already working for you, and I often find the adage &quot;if it ain&#039;t broke, don&#039;t fix it&quot; a good one.</description>
		<content:encoded><![CDATA[<p>Matt,</p>
<blockquote><p>I’m sure it can be done better but it works for me.</p></blockquote>
<p>I find that to be true of most of my work!  Sometimes it depends on deadlines, budget, a combination of those, or something else altogether.  <img src='http://www.quip.net/blog/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<p>You might want to consider a tweak to this portion of your code:</p>
<pre><code>if (_vidURL.indexOf(
    &quot;rtmp://&quot; || &quot;RTMP://&quot; || &quot;RTMPE://&quot; ||
    &quot;RTMPS://&quot; || &quot;rtmpe://&quot; || &quot;rtmps://&quot;
  ) > -1) {</code></pre>
<p>&#8230; only because, if you really want to play it safe, you may want to account for variants besides all-lowercase or all-uppercase.  One trick I&#8217;ve seen pretty often is to use <code>String.toLowerCase()</code> in the comparison expression to evaluate the target string in all lowercase &#8230;</p>
<pre><code>if (_vidURL.toLowerCase().indexOf(
    &quot;rtmp://&quot; || &quot;rtmpe://&quot; || &quot;rtmps://&quot;
  ) > -1) {</code></pre>
<p>That&#8217;ll even cover bizarre variants such as &#8220;RtMP&#8221; and the like (not that that&#8217;s especially likely).  And then, since the &#8220;rtmpe&#8221; and &#8220;rtmps&#8221; versions contain the pivotal string &#8220;rtmp,&#8221; it might be enough just to search for &#8220;rtmp&#8221; &#8230; but like you said, this is already working for you, and I often find the adage &#8220;if it ain&#8217;t broke, don&#8217;t fix it&#8221; a good one.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Matt</title>
		<link>http://www.quip.net/blog/2007/flash/actionscript-20/how-to-play-video-files-sequentially#comment-246205</link>
		<dc:creator>Matt</dc:creator>
		<pubDate>Mon, 11 Aug 2008 01:55:37 +0000</pubDate>
		<guid isPermaLink="false">http://www.quip.net/blog/2007/flash/actionscript-20/how-to-play-video-files-sequentially#comment-246205</guid>
		<description>Was easier then I thought... Thought I&#039;d post my code. I&#039;m sure it can be done better but it works for me. Just need to close the stream after playing now.

-------------------------

function loadURL():void {
		//trace(&quot;vidURL1: &quot; + _vidURL);	

		_appURL = _vidURL.substr(0 , (_vidURL.lastIndexOf(&quot;/&quot;) + 1));
		//trace(&quot;_appURL1: &quot; + _appURL);
				
		_lastSlash = _vidURL.lastIndexOf(&quot;/&quot;);
		//trace(&quot;_lastSlash1: &quot; + _lastSlash);

		_lastDot = _vidURL.lastIndexOf(&quot;.&quot;);
		//trace(&quot;_lastDot1: &quot; + _lastDot);

		_vidEXT = _vidURL.substr(_lastDot + 1);
		//trace(&quot;_vidEXT1: &quot; + _vidEXT);

		_vidFile = _vidURL.substr(_lastSlash + 1);
		//trace(&quot;_vidFile1: &quot; + _vidFile);
				

		if (_vidURL.indexOf(&quot;rtmp://&quot; &#124;&#124; &quot;RTMP://&quot; &#124;&#124; &quot;RTMPE://&quot; &#124;&#124; &quot;RTMPS://&quot; &#124;&#124; &quot;rtmpe://&quot; &#124;&#124; &quot;rtmps://&quot;) &gt; -1) {
				
				trace(&quot;_appURL1a: &quot; + _appURL);
				//_debugField.appendText(&quot;RTMP URL Found &quot; + &quot; \n &quot;);
				
				conn.connect(_appURL);
				
				}
				
		else {

				conn.connect(null);
				//_debugField.appendText(&quot;HTTP URL Found &quot; + &quot; \n &quot;);
				}
				
				
	}
	
	function onBWDone():void{
		//trace(&quot;onBWDone: &quot;);
		//_debugField.appendText(&quot;onBWDone&quot; + &quot; \n &quot;);
		} 
		

	function streamRTMP():void {
		//trace(&quot;StreamRTMP: &quot; + _vidFile);
		//_debugField.appendText(&quot;StreamRTMP function: &quot; + &quot; \n &quot;);
			stream = new NetStream(conn);
			stream.addEventListener(NetStatusEvent.NET_STATUS, netStatusHandler);
			stream.addEventListener(AsyncErrorEvent.ASYNC_ERROR, asyncErrorHandler);
        	stream.addEventListener(SecurityErrorEvent.SECURITY_ERROR, securityErrorHandler);
			stream.play(_vidFile);
			player();
		}
		
	function streamHTTP():void {
		//_debugField.appendText(&quot;streamHTTP function: &quot; + &quot; \n &quot;);
		//trace(&quot;StreamHTTP: &quot; + _vidURL);
			stream = new NetStream(conn);
			stream.addEventListener(NetStatusEvent.NET_STATUS, netStatusHandler);
			stream.addEventListener(AsyncErrorEvent.ASYNC_ERROR, asyncErrorHandler);
        	stream.addEventListener(SecurityErrorEvent.SECURITY_ERROR, securityErrorHandler);
			stream.play(_vidURL);
			player();
		}

--------------------------</description>
		<content:encoded><![CDATA[<p>Was easier then I thought&#8230; Thought I&#8217;d post my code. I&#8217;m sure it can be done better but it works for me. Just need to close the stream after playing now.</p>
<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-</p>
<p>function loadURL():void {<br />
		//trace(&#8220;vidURL1: &#8221; + _vidURL);	</p>
<p>		_appURL = _vidURL.substr(0 , (_vidURL.lastIndexOf(&#8220;/&#8221;) + 1));<br />
		//trace(&#8220;_appURL1: &#8221; + _appURL);</p>
<p>		_lastSlash = _vidURL.lastIndexOf(&#8220;/&#8221;);<br />
		//trace(&#8220;_lastSlash1: &#8221; + _lastSlash);</p>
<p>		_lastDot = _vidURL.lastIndexOf(&#8220;.&#8221;);<br />
		//trace(&#8220;_lastDot1: &#8221; + _lastDot);</p>
<p>		_vidEXT = _vidURL.substr(_lastDot + 1);<br />
		//trace(&#8220;_vidEXT1: &#8221; + _vidEXT);</p>
<p>		_vidFile = _vidURL.substr(_lastSlash + 1);<br />
		//trace(&#8220;_vidFile1: &#8221; + _vidFile);</p>
<p>		if (_vidURL.indexOf(&#8220;rtmp://&#8221; || &#8220;RTMP://&#8221; || &#8220;RTMPE://&#8221; || &#8220;RTMPS://&#8221; || &#8220;rtmpe://&#8221; || &#8220;rtmps://&#8221;) &gt; -1) {</p>
<p>				trace(&#8220;_appURL1a: &#8221; + _appURL);<br />
				//_debugField.appendText(&#8220;RTMP URL Found &#8221; + &#8221; \n &#8220;);</p>
<p>				conn.connect(_appURL);</p>
<p>				}</p>
<p>		else {</p>
<p>				conn.connect(null);<br />
				//_debugField.appendText(&#8220;HTTP URL Found &#8221; + &#8221; \n &#8220;);<br />
				}</p>
<p>	}</p>
<p>	function onBWDone():void{<br />
		//trace(&#8220;onBWDone: &#8220;);<br />
		//_debugField.appendText(&#8220;onBWDone&#8221; + &#8221; \n &#8220;);<br />
		} </p>
<p>	function streamRTMP():void {<br />
		//trace(&#8220;StreamRTMP: &#8221; + _vidFile);<br />
		//_debugField.appendText(&#8220;StreamRTMP function: &#8221; + &#8221; \n &#8220;);<br />
			stream = new NetStream(conn);<br />
			stream.addEventListener(NetStatusEvent.NET_STATUS, netStatusHandler);<br />
			stream.addEventListener(AsyncErrorEvent.ASYNC_ERROR, asyncErrorHandler);<br />
        	stream.addEventListener(SecurityErrorEvent.SECURITY_ERROR, securityErrorHandler);<br />
			stream.play(_vidFile);<br />
			player();<br />
		}</p>
<p>	function streamHTTP():void {<br />
		//_debugField.appendText(&#8220;streamHTTP function: &#8221; + &#8221; \n &#8220;);<br />
		//trace(&#8220;StreamHTTP: &#8221; + _vidURL);<br />
			stream = new NetStream(conn);<br />
			stream.addEventListener(NetStatusEvent.NET_STATUS, netStatusHandler);<br />
			stream.addEventListener(AsyncErrorEvent.ASYNC_ERROR, asyncErrorHandler);<br />
        	stream.addEventListener(SecurityErrorEvent.SECURITY_ERROR, securityErrorHandler);<br />
			stream.play(_vidURL);<br />
			player();<br />
		}</p>
<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: David Stiller</title>
		<link>http://www.quip.net/blog/2007/flash/actionscript-20/how-to-play-video-files-sequentially#comment-245134</link>
		<dc:creator>David Stiller</dc:creator>
		<pubDate>Sun, 10 Aug 2008 02:20:50 +0000</pubDate>
		<guid isPermaLink="false">http://www.quip.net/blog/2007/flash/actionscript-20/how-to-play-video-files-sequentially#comment-245134</guid>
		<description>Matt and Peter,

Rock on, guys!  Glad you&#039;re rolling now.  :)</description>
		<content:encoded><![CDATA[<p>Matt and Peter,</p>
<p>Rock on, guys!  Glad you&#8217;re rolling now.  <img src='http://www.quip.net/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
</channel>
</rss>

