

































<?xml version="1.0" encoding="UTF-8"?><!-- generator="wordpress/2.0.2" -->
<rss version="2.0" 
	xmlns:content="http://purl.org/rss/1.0/modules/content/">
<channel>
	<title>Comments on: How to Control Video (FLV) without a Component</title>
	<link>http://www.quip.net/blog/2006/flash/how-to-control-flv-without-component</link>
	<description>Luck is the residue of good design.</description>
	<pubDate>Tue, 07 Feb 2012 20:15:50 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.0.2</generator>

	<item>
		<title>by: Imabearee</title>
		<link>http://www.quip.net/blog/2006/flash/how-to-control-flv-without-component#comment-459386</link>
		<pubDate>Thu, 27 May 2010 01:09:41 +0000</pubDate>
		<guid>http://www.quip.net/blog/2006/flash/how-to-control-flv-without-component#comment-459386</guid>
					<description>I get a choice of &quot;stop script&quot; or let script &quot;continue&quot;. I always choose &quot;continue&quot; and this resolves things in about 20 secs. But the messages are beginning to bug me. Help !</description>
		<content:encoded><![CDATA[<p>I get a choice of &#8220;stop script&#8221; or let script &#8220;continue&#8221;. I always choose &#8220;continue&#8221; and this resolves things in about 20 secs. But the messages are beginning to bug me. Help !
</p>
]]></content:encoded>
				</item>
	<item>
		<title>by: Al</title>
		<link>http://www.quip.net/blog/2006/flash/how-to-control-flv-without-component#comment-422577</link>
		<pubDate>Wed, 28 Oct 2009 12:38:26 +0000</pubDate>
		<guid>http://www.quip.net/blog/2006/flash/how-to-control-flv-without-component#comment-422577</guid>
					<description>Hi David
Thanks so much for this tutorial! Has solved many problems!
I have some questions though:

I have 5 buttons but i only want the video to play on the 'home' button.
When i click on the other buttons i have added :

videoPlayer._alpha = 0
ns.close()

that hides the video and stops it, however when i click the 'home' the video is paused where i stopped it and the pause/play button doesn't work (i want it to automatically start again).

What code should i add to my other buttons to-  stop/hide/put video back to the start?
And what code do i use so that when the home button is pressed the video is at the start and plays automatically?

Many many thanks!</description>
		<content:encoded><![CDATA[<p>Hi David<br />
Thanks so much for this tutorial! Has solved many problems!<br />
I have some questions though:</p>
<p>I have 5 buttons but i only want the video to play on the &#8216;home&#8217; button.<br />
When i click on the other buttons i have added :</p>
<p>videoPlayer._alpha = 0<br />
ns.close()</p>
<p>that hides the video and stops it, however when i click the &#8216;home&#8217; the video is paused where i stopped it and the pause/play button doesn&#8217;t work (i want it to automatically start again).</p>
<p>What code should i add to my other buttons to-  stop/hide/put video back to the start?<br />
And what code do i use so that when the home button is pressed the video is at the start and plays automatically?</p>
<p>Many many thanks!
</p>
]]></content:encoded>
				</item>
	<item>
		<title>by: David Stiller</title>
		<link>http://www.quip.net/blog/2006/flash/how-to-control-flv-without-component#comment-408039</link>
		<pubDate>Fri, 21 Aug 2009 14:12:10 +0000</pubDate>
		<guid>http://www.quip.net/blog/2006/flash/how-to-control-flv-without-component#comment-408039</guid>
					<description>&lt;strong&gt;To Davader ...&lt;/strong&gt;

&lt;blockquote&gt;I wish to load a new movie thats a swf that streams a flv, size is 450 x 300 but when ever it loads it plays at 600 x 800&lt;/blockquote&gt;

Your code looks basically okay, honestly.  In a case like this, where it takes numerous steps to achieve your goal (unload one clip, load another; the new clip loads a video ...) it's generally best to test each step along the way.  That way, you can verify that each step is happening as expected.  If you do nothing else but unload your first clip, does your &lt;code&gt;onUnload&lt;/code&gt; handler properly execute?  If you load your new clip &amp;#8212; just a SWF (one that doesn't &lt;em&gt;do&lt;/em&gt; anything) &amp;#8212; does it properly load at the right dimensions?

It sounds to me like your SWF (the second one) might be getting resized somewhere, which in turn resizes its movie.

&lt;strong&gt;To Adam ...&lt;/strong&gt;

&lt;blockquote&gt;I have built a an FLV Player in ActionScript 3.0 using the VideoPlayer class. Do you have any experience with it?&lt;/blockquote&gt;

Adam, your questions are all good and thoughtfully worded.  Unfortunately, I haven't toyed much with the AS3 &lt;code&gt;VideoPlayer&lt;/code&gt; class &amp;#8212; even in the year since you originally posted your questions &amp;#8212; so I'm afraid I don't have any insight for you.  Sorry!

&lt;strong&gt;To Cesar ...&lt;/strong&gt;

&lt;blockquote&gt;My problem is the same as Jason Hone had (4 posts up), I would like to restart the video as soon as it completes.&lt;/blockquote&gt;
[then later]
&lt;blockquote&gt;Nevermind! I got it. [...] You have to make sure to put double quotes around NetStream.Play.Stop.&lt;/blockquote&gt;

w00t!  Glad you nailed that, Cesar.  :)  I'm so behind in these replies, it's a relief to me when I see that a reader managed to navigate through a challenge alone.  (Makes me feel less guilty for taking so long to reply.)

&lt;strong&gt;To Steve C ...&lt;/strong&gt;

&lt;blockquote&gt;Is there a way to loop the video? [...] Nevermind ... I was able to find the solution here: [CMX article]&lt;/blockquote&gt;

Cool deal!  I have vague memories about that particular CMX article (by Tom Green).  It's possible Tom consulted with me on that one before posting it.  If so, that would be funny.  Glad you found an answer!

&lt;strong&gt;To casimara ...&lt;/strong&gt;

&lt;blockquote&gt;found your site while trying to figure out a problem with the &quot;go back to frame 1 after playing a FLV&quot; via the netstream method. Do you have any idea why the last chunk of code below screws up my playhead positioning?&lt;/blockquote&gt;

Your last chunk of code looks like this:

&lt;pre&gt;&lt;code&gt;ns.onStatus = function(info:Object) {
  if (info.code == &amp;#34;NetStream.Play.Stop&amp;#34;) {
  gotoAndPlay(1);
}&lt;/code&gt;&lt;/pre&gt;

But I'm wondering if you should actually be using &lt;code&gt;gotoAndStop(1)&lt;/code&gt; (stop, as opposed to play)?

&lt;strong&gt;To Jim J ...&lt;/strong&gt;

&lt;blockquote&gt;So if my code runs the external FLV on one server, but not the other, it seems a server adminstrator’s mime settings might need tweaking. Any further thoughts or suggestions?&lt;/blockquote&gt;

Gosh, that's a good question!  To be honest, Jim, I've been lucky enough not to have to worry about MIME settings at all.  I'm afraid I'm dry on this one.  :(

&lt;strong&gt;To Kristi ...&lt;/strong&gt;

&lt;blockquote&gt;Can I have a listener.play [and listener.pause] function [for an FLVPlayback instance]? [...] Am I completely on the wrong track?&lt;/blockquote&gt;

Kristi, you're not on the wrong track at all.  :)  The listener mechanism is no different from how you outlined, and you can re-use that same &lt;code&gt;listener&lt;/code&gt; object (the &lt;code&gt;Object&lt;/code&gt; instance named &quot;listener&quot;) for all your various events.  Check it out:

&lt;pre&gt;&lt;code&gt;var listener:Object = new Object();

listener.complete = function(evt:Object):Void {
  lastVideoFrame._visible = true;
  stills.stop();
};
videoPlayer.addEventListener(&amp;#34;complete&amp;#34;, listener);

listener.paused = function(evt:Object):Void {
  // insert event-handling code here
};
videoPlayer.addEventListener(&amp;#34;paused&amp;#34;, listener);

listener.playing = function(evt:Object):Void {
  // insert event-handling code here
};
videoPlayer.addEventListener(&amp;#34;playing&amp;#34;, listener);&lt;/code&gt;&lt;/pre&gt;

Does that help?  (Note, the above code is AS2.  Not sure which version you need.)

&lt;strong&gt;To Land Onlong ...&lt;/strong&gt;

&lt;blockquote&gt;Have a fully functional SWF with external FLV. The swf includes scrolling text that plays simultaneously with the flv video content. The issue, is that as the videos get longer, the more chance there is for mismatches between the scrolling swf text and the flv video content.&lt;/blockquote&gt;

Given the independance of video timelines from animation timelines, I'm not surprised to hear about the lack of synch, especially down the line.  In a case like this, I would probably try to rely on the actual progress of the video as a reference for tweening the text programmatically.  In AS3, use the &lt;code&gt;NetStream.onMetaData&lt;/code&gt; event to derive the duration of the video (assuming it has metadata, which it probably does).  Once you now how long the video is, you can use an &lt;code&gt;Event.ENTER_FRAME&lt;/code&gt; event to track &lt;code&gt;NetStream.time&lt;/code&gt; repeatedly to determine how far along the video has played.  If the video is 10 seconds, for example, and the video has played 5 seconds so far, you know it's halfway done (5 / 10 = 0.5).  With that ratio, you'll know how far to set the &lt;code&gt;MovieClip.x&lt;/code&gt; or &lt;code&gt;y&lt;/code&gt; property of your scrolling text.

At zero seconds it, for example, the text shouldn't be scrolled at all.  Assuming its default resting position is 0 and the text has a width of 500, that could be set up something like this:

&lt;code&gt;scrollingText.x = -(ns.time / duration * scrollingText.width);&lt;/code&gt;
assuming ...
&lt;code&gt;scrollingText.x = -(0 / 10 * 500)&lt;/code&gt; (it sits there at 0)

Using the same formula, the text would be scrolled 250 pixels to the left (that is, scrolled halfway to the left) when &lt;code&gt;ns.time&lt;/code&gt; is 5 seconds ...

&lt;code&gt;scrollingText.x = -(5 / 10 * 500)&lt;/code&gt; (now at -250)

Bear in mind, of course, that I'm showing a simplified principle.  You'll have to check if &lt;code&gt;NetStream.time&lt;/code&gt; returns its value in seconds or milliseconds, and you'll have to check the value of &lt;code&gt;duration&lt;/code&gt; for the same.  Be prepared to multiply or divide either value by 1,000 to potentially compensate, as the case might be.  But that's one basic approach, in a nutshell.

&lt;strong&gt;To Barbara Confino ...&lt;/strong&gt;

&lt;blockquote&gt;Can I make an flv invisible, and then visible when the mouse/mc rolls over it?&lt;/blockquote&gt;

You sure can.  The way you do it depends on how you're playing the video itself (FLVPlayback or &lt;code&gt;NetStream&lt;/code&gt;), but in either case, you can make it easy on yourself and wrap your chosen playback mechanism in a movie clip.  In other words, convert your FLVPlayback instance to a movie clip symbol, or convert your Video symbol to a movie clip symbol.  That way, you have easy access to the &lt;code&gt;MovieClip&lt;/code&gt; properties, methods, and events.

Make sure to give your movie clip an instance name, because you'll need that instance name to &quot;talk&quot; to your movie clip with ActionScript &amp;#8212; and also to talk &quot;through&quot; it to the playback mechanism inside it (FLVPlayback or Video symbol).  Once you have your movie clip in place &amp;#8212; this container that holds your video &amp;#8212; you can use, say, the &lt;code&gt;MovieClip.onRollover&lt;/code&gt; and &lt;code&gt;onRollOut&lt;/code&gt; events as your triggers to set the &lt;code&gt;MovieClip._visible&lt;/code&gt; property of that clip.  If you're dragging, check out the &lt;code&gt;MovieClip.onDragOver&lt;/code&gt; and &lt;code&gt;onDragOut&lt;/code&gt; events.

What version of ActionScript are you using?  I've been assuming AS2 in my reply so far, but if you let me know for sure, I can flesh out a better code sample for you.</description>
		<content:encoded><![CDATA[<p><strong>To Davader &#8230;</strong></p>
<blockquote><p>I wish to load a new movie thats a swf that streams a flv, size is 450 x 300 but when ever it loads it plays at 600 x 800</p></blockquote>
<p>Your code looks basically okay, honestly.  In a case like this, where it takes numerous steps to achieve your goal (unload one clip, load another; the new clip loads a video &#8230;) it&#8217;s generally best to test each step along the way.  That way, you can verify that each step is happening as expected.  If you do nothing else but unload your first clip, does your <code>onUnload</code> handler properly execute?  If you load your new clip &mdash; just a SWF (one that doesn&#8217;t <em>do</em> anything) &mdash; does it properly load at the right dimensions?</p>
<p>It sounds to me like your SWF (the second one) might be getting resized somewhere, which in turn resizes its movie.</p>
<p><strong>To Adam &#8230;</strong></p>
<blockquote><p>I have built a an FLV Player in ActionScript 3.0 using the VideoPlayer class. Do you have any experience with it?</p></blockquote>
<p>Adam, your questions are all good and thoughtfully worded.  Unfortunately, I haven&#8217;t toyed much with the AS3 <code>VideoPlayer</code> class &mdash; even in the year since you originally posted your questions &mdash; so I&#8217;m afraid I don&#8217;t have any insight for you.  Sorry!</p>
<p><strong>To Cesar &#8230;</strong></p>
<blockquote><p>My problem is the same as Jason Hone had (4 posts up), I would like to restart the video as soon as it completes.</p></blockquote>
<p>[then later]</p>
<blockquote><p>Nevermind! I got it. [&#8230;] You have to make sure to put double quotes around NetStream.Play.Stop.</p></blockquote>
<p>w00t!  Glad you nailed that, Cesar.  <img src='http://www.quip.net/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />   I&#8217;m so behind in these replies, it&#8217;s a relief to me when I see that a reader managed to navigate through a challenge alone.  (Makes me feel less guilty for taking so long to reply.)</p>
<p><strong>To Steve C &#8230;</strong></p>
<blockquote><p>Is there a way to loop the video? [&#8230;] Nevermind &#8230; I was able to find the solution here: [CMX article]</p></blockquote>
<p>Cool deal!  I have vague memories about that particular CMX article (by Tom Green).  It&#8217;s possible Tom consulted with me on that one before posting it.  If so, that would be funny.  Glad you found an answer!</p>
<p><strong>To casimara &#8230;</strong></p>
<blockquote><p>found your site while trying to figure out a problem with the &#8220;go back to frame 1 after playing a FLV&#8221; via the netstream method. Do you have any idea why the last chunk of code below screws up my playhead positioning?</p></blockquote>
<p>Your last chunk of code looks like this:</p>
<pre><code>ns.onStatus = function(info:Object) {
  if (info.code == &quot;NetStream.Play.Stop&quot;) {
  gotoAndPlay(1);
}</code></pre>
<p>But I&#8217;m wondering if you should actually be using <code>gotoAndStop(1)</code> (stop, as opposed to play)?</p>
<p><strong>To Jim J &#8230;</strong></p>
<blockquote><p>So if my code runs the external FLV on one server, but not the other, it seems a server adminstrator’s mime settings might need tweaking. Any further thoughts or suggestions?</p></blockquote>
<p>Gosh, that&#8217;s a good question!  To be honest, Jim, I&#8217;ve been lucky enough not to have to worry about MIME settings at all.  I&#8217;m afraid I&#8217;m dry on this one.  <img src='http://www.quip.net/blog/wp-includes/images/smilies/icon_sad.gif' alt=':(' class='wp-smiley' /> </p>
<p><strong>To Kristi &#8230;</strong></p>
<blockquote><p>Can I have a listener.play [and listener.pause] function [for an FLVPlayback instance]? [&#8230;] Am I completely on the wrong track?</p></blockquote>
<p>Kristi, you&#8217;re not on the wrong track at all.  <img src='http://www.quip.net/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />   The listener mechanism is no different from how you outlined, and you can re-use that same <code>listener</code> object (the <code>Object</code> instance named &#8220;listener&#8221;) for all your various events.  Check it out:</p>
<pre><code>var listener:Object = new Object();

listener.complete = function(evt:Object):Void {
  lastVideoFrame._visible = true;
  stills.stop();
};
videoPlayer.addEventListener(&quot;complete&quot;, listener);

listener.paused = function(evt:Object):Void {
  // insert event-handling code here
};
videoPlayer.addEventListener(&quot;paused&quot;, listener);

listener.playing = function(evt:Object):Void {
  // insert event-handling code here
};
videoPlayer.addEventListener(&quot;playing&quot;, listener);</code></pre>
<p>Does that help?  (Note, the above code is AS2.  Not sure which version you need.)</p>
<p><strong>To Land Onlong &#8230;</strong></p>
<blockquote><p>Have a fully functional SWF with external FLV. The swf includes scrolling text that plays simultaneously with the flv video content. The issue, is that as the videos get longer, the more chance there is for mismatches between the scrolling swf text and the flv video content.</p></blockquote>
<p>Given the independance of video timelines from animation timelines, I&#8217;m not surprised to hear about the lack of synch, especially down the line.  In a case like this, I would probably try to rely on the actual progress of the video as a reference for tweening the text programmatically.  In AS3, use the <code>NetStream.onMetaData</code> event to derive the duration of the video (assuming it has metadata, which it probably does).  Once you now how long the video is, you can use an <code>Event.ENTER_FRAME</code> event to track <code>NetStream.time</code> repeatedly to determine how far along the video has played.  If the video is 10 seconds, for example, and the video has played 5 seconds so far, you know it&#8217;s halfway done (5 / 10 = 0.5).  With that ratio, you&#8217;ll know how far to set the <code>MovieClip.x</code> or <code>y</code> property of your scrolling text.</p>
<p>At zero seconds it, for example, the text shouldn&#8217;t be scrolled at all.  Assuming its default resting position is 0 and the text has a width of 500, that could be set up something like this:</p>
<p><code>scrollingText.x = -(ns.time / duration * scrollingText.width);</code><br />
assuming &#8230;<br />
<code>scrollingText.x = -(0 / 10 * 500)</code> (it sits there at 0)</p>
<p>Using the same formula, the text would be scrolled 250 pixels to the left (that is, scrolled halfway to the left) when <code>ns.time</code> is 5 seconds &#8230;</p>
<p><code>scrollingText.x = -(5 / 10 * 500)</code> (now at -250)</p>
<p>Bear in mind, of course, that I&#8217;m showing a simplified principle.  You&#8217;ll have to check if <code>NetStream.time</code> returns its value in seconds or milliseconds, and you&#8217;ll have to check the value of <code>duration</code> for the same.  Be prepared to multiply or divide either value by 1,000 to potentially compensate, as the case might be.  But that&#8217;s one basic approach, in a nutshell.</p>
<p><strong>To Barbara Confino &#8230;</strong></p>
<blockquote><p>Can I make an flv invisible, and then visible when the mouse/mc rolls over it?</p></blockquote>
<p>You sure can.  The way you do it depends on how you&#8217;re playing the video itself (FLVPlayback or <code>NetStream</code>), but in either case, you can make it easy on yourself and wrap your chosen playback mechanism in a movie clip.  In other words, convert your FLVPlayback instance to a movie clip symbol, or convert your Video symbol to a movie clip symbol.  That way, you have easy access to the <code>MovieClip</code> properties, methods, and events.</p>
<p>Make sure to give your movie clip an instance name, because you&#8217;ll need that instance name to &#8220;talk&#8221; to your movie clip with ActionScript &mdash; and also to talk &#8220;through&#8221; it to the playback mechanism inside it (FLVPlayback or Video symbol).  Once you have your movie clip in place &mdash; this container that holds your video &mdash; you can use, say, the <code>MovieClip.onRollover</code> and <code>onRollOut</code> events as your triggers to set the <code>MovieClip._visible</code> property of that clip.  If you&#8217;re dragging, check out the <code>MovieClip.onDragOver</code> and <code>onDragOut</code> events.</p>
<p>What version of ActionScript are you using?  I&#8217;ve been assuming AS2 in my reply so far, but if you let me know for sure, I can flesh out a better code sample for you.
</p>
]]></content:encoded>
				</item>
	<item>
		<title>by: Barbara Confino</title>
		<link>http://www.quip.net/blog/2006/flash/how-to-control-flv-without-component#comment-407884</link>
		<pubDate>Thu, 20 Aug 2009 21:31:09 +0000</pubDate>
		<guid>http://www.quip.net/blog/2006/flash/how-to-control-flv-without-component#comment-407884</guid>
					<description>Hi David
I am trying to create a map type game in which you drag an mc and when it hits an invisible flv, the flv starts playing. How do I do that? Can I make an flv invisible, and then visible when the mouse/mc rolls over it?
Please help.
Thanks</description>
		<content:encoded><![CDATA[<p>Hi David<br />
I am trying to create a map type game in which you drag an mc and when it hits an invisible flv, the flv starts playing. How do I do that? Can I make an flv invisible, and then visible when the mouse/mc rolls over it?<br />
Please help.<br />
Thanks
</p>
]]></content:encoded>
				</item>
	<item>
		<title>by: Land Onlong</title>
		<link>http://www.quip.net/blog/2006/flash/how-to-control-flv-without-component#comment-407529</link>
		<pubDate>Tue, 18 Aug 2009 17:56:20 +0000</pubDate>
		<guid>http://www.quip.net/blog/2006/flash/how-to-control-flv-without-component#comment-407529</guid>
					<description>Hey David,

Thanks for the insightful tutorials here, defiantely a help.  Read through your posts here and havent come across this question. I am also a AS3 newbie and have two challenges that I am attempting to overcome.

Have a fully functional SWF with external FLV. The swf includes scrolling text that plays simultaneously with the flv video content. The issue, is that as the videos get longer, the more chance there is for mismatches between the scrolling swf text and the flv video content. 

I am now attempting to:
- preload both the SWF and FLV together.
- insert player controls that control both the swf and flv simultaneously.

I have been chomping at this for a few days now, and cant seem to get it just right.  Any assistance on this would be greatly appreciated. Also, Crackin Blog ~ Great resources and advice ;-)</description>
		<content:encoded><![CDATA[<p>Hey David,</p>
<p>Thanks for the insightful tutorials here, defiantely a help.  Read through your posts here and havent come across this question. I am also a AS3 newbie and have two challenges that I am attempting to overcome.</p>
<p>Have a fully functional SWF with external FLV. The swf includes scrolling text that plays simultaneously with the flv video content. The issue, is that as the videos get longer, the more chance there is for mismatches between the scrolling swf text and the flv video content. </p>
<p>I am now attempting to:<br />
- preload both the SWF and FLV together.<br />
- insert player controls that control both the swf and flv simultaneously.</p>
<p>I have been chomping at this for a few days now, and cant seem to get it just right.  Any assistance on this would be greatly appreciated. Also, Crackin Blog ~ Great resources and advice <img src='http://www.quip.net/blog/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' />
</p>
]]></content:encoded>
				</item>
	<item>
		<title>by: Kristi</title>
		<link>http://www.quip.net/blog/2006/flash/how-to-control-flv-without-component#comment-405566</link>
		<pubDate>Tue, 04 Aug 2009 02:49:35 +0000</pubDate>
		<guid>http://www.quip.net/blog/2006/flash/how-to-control-flv-without-component#comment-405566</guid>
					<description>Hi David
Sorry this another FLVPlayback component question, but not sure where else to put it. I'm a relative newbie.
I'd prefer to use FLVPlayback for ease of use and stability based on what I've read here on your fantastic blog; however I only seam to be able to find netstream code for the status of the video.
What I want to do is: know when the viewer has clicked pause (with the built-in FLV Playback skin controls), so that I can stop a movie clip (instance name: stills) which is also playing. And then play stills movieclip again on play of flv; 
plus, for extra complication: have another movie clip invisible until the completion of flv, like so:

lastVideoFrame._visible = false;

var listener:Object = new Object();
listener.complete = function(evt:Object):Void {
  lastVideoFrame._visible = true;
  stills.stop();
}
videoPlayer.addEventListener(&quot;complete&quot;, listener);

but if the viewer then clicks play again on flv once it's completed, I need to have
lastVideoFrame._visible = false;
stills.play();

Can I have a listener.play function? If so, does this have to be a separate listener, such as 
var PlayListener:Object

Am I completely on the wrong track? Should I be using NetStream instead for complete control? Your infinite wisdom and simple way of explaining things would be much appreciated for this ActionScript struggler</description>
		<content:encoded><![CDATA[<p>Hi David<br />
Sorry this another FLVPlayback component question, but not sure where else to put it. I&#8217;m a relative newbie.<br />
I&#8217;d prefer to use FLVPlayback for ease of use and stability based on what I&#8217;ve read here on your fantastic blog; however I only seam to be able to find netstream code for the status of the video.<br />
What I want to do is: know when the viewer has clicked pause (with the built-in FLV Playback skin controls), so that I can stop a movie clip (instance name: stills) which is also playing. And then play stills movieclip again on play of flv;<br />
plus, for extra complication: have another movie clip invisible until the completion of flv, like so:</p>
<p>lastVideoFrame._visible = false;</p>
<p>var listener:Object = new Object();<br />
listener.complete = function(evt:Object):Void {<br />
  lastVideoFrame._visible = true;<br />
  stills.stop();<br />
}<br />
videoPlayer.addEventListener(&#8221;complete&#8221;, listener);</p>
<p>but if the viewer then clicks play again on flv once it&#8217;s completed, I need to have<br />
lastVideoFrame._visible = false;<br />
stills.play();</p>
<p>Can I have a listener.play function? If so, does this have to be a separate listener, such as<br />
var PlayListener:Object</p>
<p>Am I completely on the wrong track? Should I be using NetStream instead for complete control? Your infinite wisdom and simple way of explaining things would be much appreciated for this ActionScript struggler
</p>
]]></content:encoded>
				</item>
	<item>
		<title>by: Jim J</title>
		<link>http://www.quip.net/blog/2006/flash/how-to-control-flv-without-component#comment-342107</link>
		<pubDate>Wed, 28 Jan 2009 03:32:35 +0000</pubDate>
		<guid>http://www.quip.net/blog/2006/flash/how-to-control-flv-without-component#comment-342107</guid>
					<description>David:
I have Actionscript 2 code within a SWF that runs an external FLV file in the same folder as the SWF calling it.  The puzzling problem is the Actionscript calls and runs the FLV perfectly on one of our servers, but there's no video on our ColdFusion development server which is the first step in a three stepped server sequence (development-integration-production) to production.   We want the Flash video to run on the ColdFusion servers.  Where I work, server administration is out of my realm/control, but I'm hearing the issue may be at the server end with mime settings.  Why not just use the server that runs the external FLV?  We eventually want to locate all FLV files externally and to make things even more complex, link to them on another domain.  I know, &quot;that's hard way to do things&quot; but that's what's being strongly suggested.  So if my code runs the external FLV on one server, but not the other, it seems a server adminstrator's mime settings might need tweaking.  Any further thoughts or suggestions?  JJ</description>
		<content:encoded><![CDATA[<p>David:<br />
I have Actionscript 2 code within a SWF that runs an external FLV file in the same folder as the SWF calling it.  The puzzling problem is the Actionscript calls and runs the FLV perfectly on one of our servers, but there&#8217;s no video on our ColdFusion development server which is the first step in a three stepped server sequence (development-integration-production) to production.   We want the Flash video to run on the ColdFusion servers.  Where I work, server administration is out of my realm/control, but I&#8217;m hearing the issue may be at the server end with mime settings.  Why not just use the server that runs the external FLV?  We eventually want to locate all FLV files externally and to make things even more complex, link to them on another domain.  I know, &#8220;that&#8217;s hard way to do things&#8221; but that&#8217;s what&#8217;s being strongly suggested.  So if my code runs the external FLV on one server, but not the other, it seems a server adminstrator&#8217;s mime settings might need tweaking.  Any further thoughts or suggestions?  JJ
</p>
]]></content:encoded>
				</item>
	<item>
		<title>by: casimara</title>
		<link>http://www.quip.net/blog/2006/flash/how-to-control-flv-without-component#comment-306294</link>
		<pubDate>Wed, 26 Nov 2008 00:23:26 +0000</pubDate>
		<guid>http://www.quip.net/blog/2006/flash/how-to-control-flv-without-component#comment-306294</guid>
					<description>Hi David,
You've got such great info here.  I found your site while trying to figure out a problem with the &quot;go back to frame 1 after playing a FLV&quot; via the netstream method.  Do you have any idea why the last chunk of code below screws up my playhead positioning?  There is a &quot;play&quot; button on frame 1, and all this code on frame 2:

//--------NETCONNECTION SETUP--------------
var nc:NetConnection = new NetConnection();
nc.connect(null);

//--------NETSTREAM SETUP------------------
var ns:NetStream = new NetStream(nc);

ns.onStatus = function(info) {
	if(info.code == &quot;NetStream.Play.Start&quot;) {
		progressBar.onEnterFrame = videoUpdate;
	}
	if(info.code == &quot;NetStream.Play.Stop&quot;) {
		delete progressBar.onEnterFrame;
	}
}

ns.onMetaData = function(info) {
	ns.duration = info.duration;
}

//--------ATTACHING NETSTREAM--------------
video.attachVideo(ns);

//--------PLAYING EXTERNAL FLV-------------
ns.play(&quot;Settle.flv&quot;);

//------------LOADBAR-------------
loadbar.onEnterFrame = function() {
	this._xscale = (ns.bytesLoaded/ns.bytesTotal)*100;
	if(this._xscale == 100) {
		delete this.onEnterFrame;
	}
}

//------------VIDEO UPDATE-----------
function videoUpdate() {
	progressBar._xscale = (ns.time/ns.duration)*100;
	timecode.text = getTimecode(ns.time);
}

//------------VIDEO SCRUBBER----------
loadbar.onPress = function() {
	progressBar.onEnterFrame = videoScrub;
}

loadbar.onRelease = loadbar.onReleaseOutside = function() {
	progressBar.onEnterFrame = videoUpdate;
}

function videoScrub() {
	var dist:Number = (_root._xmouse-loadbar._x)/loadbar._width;
	ns.seek(Math.floor(ns.duration*dist));
	progressBar._xscale = (ns.time/ns.duration)*100;

	timecode.text = getTimecode(ns.time);
}

playHead.onEnterFrame = function() {
	this._x = Math.floor(progressBar._width + loadbar._x);
}

//--------------This code works but breaks the playhead location---------
ns.onStatus = function(info:Object) {
   if (info.code == &quot;NetStream.Play.Stop&quot;) {
   		gotoAndPlay(1);
    }
	
} 

stop();

Any insight is greatly appreciated.

Best,
casimara</description>
		<content:encoded><![CDATA[<p>Hi David,<br />
You&#8217;ve got such great info here.  I found your site while trying to figure out a problem with the &#8220;go back to frame 1 after playing a FLV&#8221; via the netstream method.  Do you have any idea why the last chunk of code below screws up my playhead positioning?  There is a &#8220;play&#8221; button on frame 1, and all this code on frame 2:</p>
<p>//&#8212;&#8212;&#8211;NETCONNECTION SETUP&#8212;&#8212;&#8212;&#8212;&#8211;<br />
var nc:NetConnection = new NetConnection();<br />
nc.connect(null);</p>
<p>//&#8212;&#8212;&#8211;NETSTREAM SETUP&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<br />
var ns:NetStream = new NetStream(nc);</p>
<p>ns.onStatus = function(info) {<br />
	if(info.code == &#8220;NetStream.Play.Start&#8221;) {<br />
		progressBar.onEnterFrame = videoUpdate;<br />
	}<br />
	if(info.code == &#8220;NetStream.Play.Stop&#8221;) {<br />
		delete progressBar.onEnterFrame;<br />
	}<br />
}</p>
<p>ns.onMetaData = function(info) {<br />
	ns.duration = info.duration;<br />
}</p>
<p>//&#8212;&#8212;&#8211;ATTACHING NETSTREAM&#8212;&#8212;&#8212;&#8212;&#8211;<br />
video.attachVideo(ns);</p>
<p>//&#8212;&#8212;&#8211;PLAYING EXTERNAL FLV&#8212;&#8212;&#8212;&#8212;-<br />
ns.play(&#8221;Settle.flv&#8221;);</p>
<p>//&#8212;&#8212;&#8212;&#8212;LOADBAR&#8212;&#8212;&#8212;&#8212;-<br />
loadbar.onEnterFrame = function() {<br />
	this._xscale = (ns.bytesLoaded/ns.bytesTotal)*100;<br />
	if(this._xscale == 100) {<br />
		delete this.onEnterFrame;<br />
	}<br />
}</p>
<p>//&#8212;&#8212;&#8212;&#8212;VIDEO UPDATE&#8212;&#8212;&#8212;&#8211;<br />
function videoUpdate() {<br />
	progressBar._xscale = (ns.time/ns.duration)*100;<br />
	timecode.text = getTimecode(ns.time);<br />
}</p>
<p>//&#8212;&#8212;&#8212;&#8212;VIDEO SCRUBBER&#8212;&#8212;&#8212;-<br />
loadbar.onPress = function() {<br />
	progressBar.onEnterFrame = videoScrub;<br />
}</p>
<p>loadbar.onRelease = loadbar.onReleaseOutside = function() {<br />
	progressBar.onEnterFrame = videoUpdate;<br />
}</p>
<p>function videoScrub() {<br />
	var dist:Number = (_root._xmouse-loadbar._x)/loadbar._width;<br />
	ns.seek(Math.floor(ns.duration*dist));<br />
	progressBar._xscale = (ns.time/ns.duration)*100;</p>
<p>	timecode.text = getTimecode(ns.time);<br />
}</p>
<p>playHead.onEnterFrame = function() {<br />
	this._x = Math.floor(progressBar._width + loadbar._x);<br />
}</p>
<p>//&#8212;&#8212;&#8212;&#8212;&#8211;This code works but breaks the playhead location&#8212;&#8212;&#8212;<br />
ns.onStatus = function(info:Object) {<br />
   if (info.code == &#8220;NetStream.Play.Stop&#8221;) {<br />
   		gotoAndPlay(1);<br />
    }</p>
<p>} </p>
<p>stop();</p>
<p>Any insight is greatly appreciated.</p>
<p>Best,<br />
casimara
</p>
]]></content:encoded>
				</item>
	<item>
		<title>by: Steve C</title>
		<link>http://www.quip.net/blog/2006/flash/how-to-control-flv-without-component#comment-288511</link>
		<pubDate>Thu, 16 Oct 2008 20:48:00 +0000</pubDate>
		<guid>http://www.quip.net/blog/2006/flash/how-to-control-flv-without-component#comment-288511</guid>
					<description>Nevermind...I was able to find the solution here: http://www.communitymx.com/content/article.cfm?cid=984BA


Basically just add this to the same frame of actionscript:

ns.onStatus = function(info) {
  if (info.code == &quot;NetStream.Play.Stop&quot;) {
  ns.seek(0);
  }
 }; 

Still, many thanks to David for the great tutorial which has saved me once again!</description>
		<content:encoded><![CDATA[<p>Nevermind&#8230;I was able to find the solution here: <a href='http://www.communitymx.com/content/article.cfm?cid=984BA' rel='nofollow'>http://www.communitymx.com/content/article.cfm?cid=984BA</a></p>
<p>Basically just add this to the same frame of actionscript:</p>
<p>ns.onStatus = function(info) {<br />
  if (info.code == &#8220;NetStream.Play.Stop&#8221;) {<br />
  ns.seek(0);<br />
  }<br />
 }; </p>
<p>Still, many thanks to David for the great tutorial which has saved me once again!
</p>
]]></content:encoded>
				</item>
	<item>
		<title>by: Steve C</title>
		<link>http://www.quip.net/blog/2006/flash/how-to-control-flv-without-component#comment-288490</link>
		<pubDate>Thu, 16 Oct 2008 15:42:31 +0000</pubDate>
		<guid>http://www.quip.net/blog/2006/flash/how-to-control-flv-without-component#comment-288490</guid>
					<description>Hi David...
Thanks for the great tutorial...just one question:

Is there a way to loop the video?

Normally I would just apply this code to the component on the stage:
on (complete) {
this.autorewind =true;
this.play();
}

However, I cannot apply any code to the empty video player...</description>
		<content:encoded><![CDATA[<p>Hi David&#8230;<br />
Thanks for the great tutorial&#8230;just one question:</p>
<p>Is there a way to loop the video?</p>
<p>Normally I would just apply this code to the component on the stage:<br />
on (complete) {<br />
this.autorewind =true;<br />
this.play();<br />
}</p>
<p>However, I cannot apply any code to the empty video player&#8230;
</p>
]]></content:encoded>
				</item>
</channel>
</rss>

