<?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 preload FLV video in flash with actionscript 2.0</title>
	<atom:link href="http://www.bloommedia.co.uk/blog/technical/preload-flv-video-in-flash-actionscript-20-2/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.bloommedia.co.uk/blog/technical/preload-flv-video-in-flash-actionscript-20-2/</link>
	<description>Bloom Media are an award winning 'full service digital agency', we provide ROI focussed digital campaigns for some of the UK's biggest brands.</description>
	<lastBuildDate>Fri, 18 Jun 2010 15:11:19 +0100</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.2</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Josh</title>
		<link>http://www.bloommedia.co.uk/blog/technical/preload-flv-video-in-flash-actionscript-20-2/#comment-678</link>
		<dc:creator>Josh</dc:creator>
		<pubDate>Wed, 13 Jan 2010 11:54:49 +0000</pubDate>
		<guid isPermaLink="false">http://www.bloommedia.co.uk/blog/?p=40#comment-678</guid>
		<description>Hello,

No sure if this is still active but i&#039;m having problems going to the next frame. I have placed the above code (going to the next frame) however it just goes to the next frame and does play through the .flv.

Any help would be great

Cheers</description>
		<content:encoded><![CDATA[<p>Hello,</p>
<p>No sure if this is still active but i&#8217;m having problems going to the next frame. I have placed the above code (going to the next frame) however it just goes to the next frame and does play through the .flv.</p>
<p>Any help would be great</p>
<p>Cheers</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Narayan</title>
		<link>http://www.bloommedia.co.uk/blog/technical/preload-flv-video-in-flash-actionscript-20-2/#comment-340</link>
		<dc:creator>Narayan</dc:creator>
		<pubDate>Wed, 05 Aug 2009 16:18:35 +0000</pubDate>
		<guid isPermaLink="false">http://www.bloommedia.co.uk/blog/?p=40#comment-340</guid>
		<description>very helpful</description>
		<content:encoded><![CDATA[<p>very helpful</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Duda</title>
		<link>http://www.bloommedia.co.uk/blog/technical/preload-flv-video-in-flash-actionscript-20-2/#comment-330</link>
		<dc:creator>Duda</dc:creator>
		<pubDate>Thu, 09 Jul 2009 22:08:33 +0000</pubDate>
		<guid isPermaLink="false">http://www.bloommedia.co.uk/blog/?p=40#comment-330</guid>
		<description>im desperated, the videos show up but doesnt play. what im doing wrong. i cant think any more, i need to create the vars dynamicly i think, but i cant think how. 
i really will apreciate your help if you could, the dead line for this project its tomorrow and im stuck.

please please.
thnks a million.

function opennews() {
	newslist = new XML();
	newslist.load(&quot;pv/pv.xml&quot;);
	newslist.ignoreWhite = true;
	var item_spacing = 140;
	var item_cont = 1;



	condition = 1;



	loadingNews._alpha = 100;
	newslist.onLoad = function(success) {
		if (success) {

			if (this.getBytesLoaded() == this.getBytesTotal()) {

				var news:XMLNode = this.firstChild;
				numberOfItems = news.childNodes.length;
				pages = numberOfItems/6;


				for (i=0; i&lt;numberOfItems; i++) {
					var link = news.childNodes[i].childNodes[1].childNodes[0].nodeValue;
					var TEXT:String = news.childNodes[i].childNodes[0].childNodes[0].nodeValue;
					var item_mc = pvHolder_mc.smallHolder_mc.attachMovie(&quot;small_mc&quot;, &quot;small_mc&quot;+i, i);
					item_mc._x = i*165.6;

					//loadFlv(link);
					//loadFlv2(link);
					
					var nc:NetConnection = new NetConnection();
					nc.connect(null);
					var ns:NetStream = new NetStream(nc);
					item_mc.videoPlayer.theVideo.attachVideo(ns);
					ns.play(link);</description>
		<content:encoded><![CDATA[<p>im desperated, the videos show up but doesnt play. what im doing wrong. i cant think any more, i need to create the vars dynamicly i think, but i cant think how.<br />
i really will apreciate your help if you could, the dead line for this project its tomorrow and im stuck.</p>
<p>please please.<br />
thnks a million.</p>
<p>function opennews() {<br />
	newslist = new XML();<br />
	newslist.load(&#8221;pv/pv.xml&#8221;);<br />
	newslist.ignoreWhite = true;<br />
	var item_spacing = 140;<br />
	var item_cont = 1;</p>
<p>	condition = 1;</p>
<p>	loadingNews._alpha = 100;<br />
	newslist.onLoad = function(success) {<br />
		if (success) {</p>
<p>			if (this.getBytesLoaded() == this.getBytesTotal()) {</p>
<p>				var news:XMLNode = this.firstChild;<br />
				numberOfItems = news.childNodes.length;<br />
				pages = numberOfItems/6;</p>
<p>				for (i=0; i&lt;numberOfItems; i++) {<br />
					var link = news.childNodes[i].childNodes[1].childNodes[0].nodeValue;<br />
					var TEXT:String = news.childNodes[i].childNodes[0].childNodes[0].nodeValue;<br />
					var item_mc = pvHolder_mc.smallHolder_mc.attachMovie(&#8221;small_mc&#8221;, &#8220;small_mc&#8221;+i, i);<br />
					item_mc._x = i*165.6;</p>
<p>					//loadFlv(link);<br />
					//loadFlv2(link);</p>
<p>					var nc:NetConnection = new NetConnection();<br />
					nc.connect(null);<br />
					var ns:NetStream = new NetStream(nc);<br />
					item_mc.videoPlayer.theVideo.attachVideo(ns);<br />
					ns.play(link);</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Megadeth</title>
		<link>http://www.bloommedia.co.uk/blog/technical/preload-flv-video-in-flash-actionscript-20-2/#comment-314</link>
		<dc:creator>Megadeth</dc:creator>
		<pubDate>Thu, 28 May 2009 09:49:04 +0000</pubDate>
		<guid isPermaLink="false">http://www.bloommedia.co.uk/blog/?p=40#comment-314</guid>
		<description>Hi, Thanks a lot for this tut&#039; ! Can we add in this case a skin (ClearOverPlaySeekMute.swf for example) to the flv and how ? Best regards, Mega ;)</description>
		<content:encoded><![CDATA[<p>Hi, Thanks a lot for this tut&#8217; ! Can we add in this case a skin (ClearOverPlaySeekMute.swf for example) to the flv and how ? Best regards, Mega <img src='http://www.bloommedia.co.uk/blog/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Megadeth</title>
		<link>http://www.bloommedia.co.uk/blog/technical/preload-flv-video-in-flash-actionscript-20-2/#comment-313</link>
		<dc:creator>Megadeth</dc:creator>
		<pubDate>Thu, 28 May 2009 09:47:51 +0000</pubDate>
		<guid isPermaLink="false">http://www.bloommedia.co.uk/blog/?p=40#comment-313</guid>
		<description>Hi, Thanks a lot for this tut&#039; ! Can we add in this case a skin (ClearOverPlaySeekMute.swf for example) to the flv ? Best regards, Mega ;)</description>
		<content:encoded><![CDATA[<p>Hi, Thanks a lot for this tut&#8217; ! Can we add in this case a skin (ClearOverPlaySeekMute.swf for example) to the flv ? Best regards, Mega <img src='http://www.bloommedia.co.uk/blog/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: TheBuzzer</title>
		<link>http://www.bloommedia.co.uk/blog/technical/preload-flv-video-in-flash-actionscript-20-2/#comment-303</link>
		<dc:creator>TheBuzzer</dc:creator>
		<pubDate>Tue, 05 May 2009 11:37:08 +0000</pubDate>
		<guid isPermaLink="false">http://www.bloommedia.co.uk/blog/?p=40#comment-303</guid>
		<description>AS3 doesn&#039; recognize the onStatus function, I found the way to do it with listener...

ns.addEventListener(NetStatusEvent.NET_STATUS, StatusNS);
...
function StatusNS (eventNS:NetStatusEvent) {
	if (eventNS.info.code == &quot;NetStream.Play.Stop&quot;) {
		this.seek(0);
		// Or do something else like GotoPlay(100); or GetURL();
	}
};

I&#039;m working to fix the onMetaData section for AS3, I&#039;ll leave the code tomorrow!

Marc</description>
		<content:encoded><![CDATA[<p>AS3 doesn&#8217; recognize the onStatus function, I found the way to do it with listener&#8230;</p>
<p>ns.addEventListener(NetStatusEvent.NET_STATUS, StatusNS);<br />
&#8230;<br />
function StatusNS (eventNS:NetStatusEvent) {<br />
	if (eventNS.info.code == &#8220;NetStream.Play.Stop&#8221;) {<br />
		this.seek(0);<br />
		// Or do something else like GotoPlay(100); or GetURL();<br />
	}<br />
};</p>
<p>I&#8217;m working to fix the onMetaData section for AS3, I&#8217;ll leave the code tomorrow!</p>
<p>Marc</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Paul Barrett</title>
		<link>http://www.bloommedia.co.uk/blog/technical/preload-flv-video-in-flash-actionscript-20-2/#comment-300</link>
		<dc:creator>Paul Barrett</dc:creator>
		<pubDate>Fri, 01 May 2009 11:04:19 +0000</pubDate>
		<guid isPermaLink="false">http://www.bloommedia.co.uk/blog/?p=40#comment-300</guid>
		<description>Hi Dominic
thanks for the tutorial stuff, hopefully you can help out a little further. I&#039;m getting multiple clips to load fine if I hard code them in, ie::

**********

// open a net connection
var nc:NetConnection = new NetConnection();
// null connection for progressive download
nc.connect(null);
//
// create a stream – attach it to a MC on the main timeline (myVideo)
myNetStream = new NetStream(nc);
myVideo.attachVideo(myNetStream);
//
myNetStream2 = new NetStream(nc);
myVideo2.attachVideo(myNetStream2);
// load video
myNetStream.play(&quot;1_intro_FL9_1024x576_website.flv&quot;);
myNetStream2.play(&quot;2_homePageButtons_FL9_1024x576_website.flv&quot;);
// pause video to hide it from the stage (we can remove this to autostart)
myNetStream.pause();
myNetStream2.pause(); 

*****

then I use your percentage preloader which works fine also for the first clip. I&#039;m using the stop listener to start the next clip (2) playing and hide the first one. This is all ok, but when I try to build a loop and load them from an array it just wont have it. My code looks like this:

*****

// create an array for the names of the video clips
videoClipArray = new Array(&quot;1_intro_FL9_1024x576_website.flv&quot;, &quot;2_homePageButtons_FL9_1024x576_website.flv&quot;);
// open a net connection 
var nc:NetConnection = new NetConnection();
// null connection for progressive download
nc.connect(null);
//
for (i=0; i&lt;videoClipArray.length; i++) {
	// create a stream 
	myNetStream[i] = new NetStream(nc);
	// duplicate the movie clip video component
	//this.myVideo.duplicateMovieClip(&quot;myvideo&quot;+i,i,{_x:0, _y:0});
	// attach it to an MC on the main timeline (myVideo)
	myVideo[i].attachVideo(myNetStream[i]);
	// load video
	myNetStream[i].play(videoClipArray[i]);
	// pause video to hide it from the stage (we can remove this to autostart)
	myNetStream[i].pause();
	// hide load progress
	percentage._visible = false;
	percentage._visible = false;
	//
	// resize video onload, based on meta data
	myNetStream[i].onMetaData = function(obj) {
		myVideo[i]._height = obj.height;
		myVideo[i]._width = obj.width;
		// show load progress
		percentage._visible = true;
		percentage._visible = true;
	};
}

****

I&#039;m not getting any code errors, can you see what I might be doing wrong?

Many thanks
Paul</description>
		<content:encoded><![CDATA[<p>Hi Dominic<br />
thanks for the tutorial stuff, hopefully you can help out a little further. I&#8217;m getting multiple clips to load fine if I hard code them in, ie::</p>
<p>**********</p>
<p>// open a net connection<br />
var nc:NetConnection = new NetConnection();<br />
// null connection for progressive download<br />
nc.connect(null);<br />
//<br />
// create a stream – attach it to a MC on the main timeline (myVideo)<br />
myNetStream = new NetStream(nc);<br />
myVideo.attachVideo(myNetStream);<br />
//<br />
myNetStream2 = new NetStream(nc);<br />
myVideo2.attachVideo(myNetStream2);<br />
// load video<br />
myNetStream.play(&#8221;1_intro_FL9_1024&#215;576_website.flv&#8221;);<br />
myNetStream2.play(&#8221;2_homePageButtons_FL9_1024&#215;576_website.flv&#8221;);<br />
// pause video to hide it from the stage (we can remove this to autostart)<br />
myNetStream.pause();<br />
myNetStream2.pause(); </p>
<p>*****</p>
<p>then I use your percentage preloader which works fine also for the first clip. I&#8217;m using the stop listener to start the next clip (2) playing and hide the first one. This is all ok, but when I try to build a loop and load them from an array it just wont have it. My code looks like this:</p>
<p>*****</p>
<p>// create an array for the names of the video clips<br />
videoClipArray = new Array(&#8221;1_intro_FL9_1024&#215;576_website.flv&#8221;, &#8220;2_homePageButtons_FL9_1024&#215;576_website.flv&#8221;);<br />
// open a net connection<br />
var nc:NetConnection = new NetConnection();<br />
// null connection for progressive download<br />
nc.connect(null);<br />
//<br />
for (i=0; i&lt;videoClipArray.length; i++) {<br />
	// create a stream<br />
	myNetStream[i] = new NetStream(nc);<br />
	// duplicate the movie clip video component<br />
	//this.myVideo.duplicateMovieClip(&#8221;myvideo&#8221;+i,i,{_x:0, _y:0});<br />
	// attach it to an MC on the main timeline (myVideo)<br />
	myVideo[i].attachVideo(myNetStream[i]);<br />
	// load video<br />
	myNetStream[i].play(videoClipArray[i]);<br />
	// pause video to hide it from the stage (we can remove this to autostart)<br />
	myNetStream[i].pause();<br />
	// hide load progress<br />
	percentage._visible = false;<br />
	percentage._visible = false;<br />
	//<br />
	// resize video onload, based on meta data<br />
	myNetStream[i].onMetaData = function(obj) {<br />
		myVideo[i]._height = obj.height;<br />
		myVideo[i]._width = obj.width;<br />
		// show load progress<br />
		percentage._visible = true;<br />
		percentage._visible = true;<br />
	};<br />
}</p>
<p>****</p>
<p>I&#8217;m not getting any code errors, can you see what I might be doing wrong?</p>
<p>Many thanks<br />
Paul</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jason</title>
		<link>http://www.bloommedia.co.uk/blog/technical/preload-flv-video-in-flash-actionscript-20-2/#comment-299</link>
		<dc:creator>Jason</dc:creator>
		<pubDate>Thu, 30 Apr 2009 18:49:20 +0000</pubDate>
		<guid isPermaLink="false">http://www.bloommedia.co.uk/blog/?p=40#comment-299</guid>
		<description>Dominic,

How would I add a play/pause button, a seek bar, and audio controls after the movie loads?  I cant seem to get it to work....

Thanks!</description>
		<content:encoded><![CDATA[<p>Dominic,</p>
<p>How would I add a play/pause button, a seek bar, and audio controls after the movie loads?  I cant seem to get it to work&#8230;.</p>
<p>Thanks!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jason</title>
		<link>http://www.bloommedia.co.uk/blog/technical/preload-flv-video-in-flash-actionscript-20-2/#comment-298</link>
		<dc:creator>Jason</dc:creator>
		<pubDate>Thu, 30 Apr 2009 18:44:26 +0000</pubDate>
		<guid isPermaLink="false">http://www.bloommedia.co.uk/blog/?p=40#comment-298</guid>
		<description>Hi there!

Great tutorial, or code sharing, as it were.

I am trying to add controls to the video after it loads.  A simple play/pause button, a statusbar (for scrubbing video) and a volume control.  I have tried everything, and I cant seem to get them to play.  I have even tried listening for the stop command, and assigning my controls with something like myVideo.seekBar=my_seekBar; burt to no avail.

Do you have any suggestions?</description>
		<content:encoded><![CDATA[<p>Hi there!</p>
<p>Great tutorial, or code sharing, as it were.</p>
<p>I am trying to add controls to the video after it loads.  A simple play/pause button, a statusbar (for scrubbing video) and a volume control.  I have tried everything, and I cant seem to get them to play.  I have even tried listening for the stop command, and assigning my controls with something like myVideo.seekBar=my_seekBar; burt to no avail.</p>
<p>Do you have any suggestions?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Steve</title>
		<link>http://www.bloommedia.co.uk/blog/technical/preload-flv-video-in-flash-actionscript-20-2/#comment-295</link>
		<dc:creator>Steve</dc:creator>
		<pubDate>Tue, 28 Apr 2009 01:55:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.bloommedia.co.uk/blog/?p=40#comment-295</guid>
		<description>Thank you very much for the FLV preloader - looked everywhere - yours is the best! 
One more favor if you could - how can I add a &quot;go to URL&quot; to your script once the video is done playing? 

This is what I had earlier that worked:
-------------------------------
import fl.video.VideoEvent;

myVideo.addEventListener(VideoEvent.STOPPED_STATE_ENTERED, onVideoStopped);

function onVideoStopped(evt:VideoEvent):void
{
    var url:URLRequest = new URLRequest(&quot;http://url.html/&quot;);
    navigateToURL(url, &quot;_self&quot;);
}
-------------------------
Thanks again!</description>
		<content:encoded><![CDATA[<p>Thank you very much for the FLV preloader &#8211; looked everywhere &#8211; yours is the best!<br />
One more favor if you could &#8211; how can I add a &#8220;go to URL&#8221; to your script once the video is done playing? </p>
<p>This is what I had earlier that worked:<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
import fl.video.VideoEvent;</p>
<p>myVideo.addEventListener(VideoEvent.STOPPED_STATE_ENTERED, onVideoStopped);</p>
<p>function onVideoStopped(evt:VideoEvent):void<br />
{<br />
    var url:URLRequest = new URLRequest(&#8221;http://url.html/&#8221;);<br />
    navigateToURL(url, &#8220;_self&#8221;);<br />
}<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
Thanks again!</p>
]]></content:encoded>
	</item>
</channel>
</rss>
