FORUMS: list search recent posts

multiple FLV's

COW Forums : Adobe Flash

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
lensflare1
multiple FLV's
on Jul 13, 2006 at 5:09:12 am

Hi there.

I was wanting to have 3 external FLV's looping as netstreams simultaneously on a page.

How do I amend this code to include 2 more FLV's


var nc:NetConnection = new NetConnection();
nc.connect(null);
var ns:NetStream = new NetStream(nc);
ns.setBufferTime(30);
ns.onStatus = function(info) {
if (info.code == "NetStream.Play.Stop") {
ns.seek(0);
}
};
roadside.attachVideo(ns);
ns.play("roadside.flv");


cheers

Lensflare


Return to posts index

lajoiet
Re: multiple FLV's
on Jul 13, 2006 at 12:25:14 pm

Well, you already have everything you need to do this, except for the 3 videos. The ns.onStatus function you have is already listening for the FLV video to finish playing, now all you need is an array to hold your video files, and a counter to keep track of which video is playing so you can increment int and play the next one:


var flvArray:Array = new Array("roadside.flv", "second.flv", "third.flv");
var count:Number = 0;
var nc:NetConnection = new NetConnection();
nc.connect(null);
var ns:NetStream = new NetStream(nc);
roadside.attachVideo(ns);
ns.setBufferTime(30);
ns.onStatus = function(info) {
if (info.code == "NetStream.Play.Stop") {
count++
if (count >= flvArray.length) {
count = 0;
}
ns.play("flvArray[count]");
}
};
ns.play("flvArray[count]");

>Todd
_____________________________________

I'm filling a need. Without me there would be no bad examples.
_____________________________________


Return to posts index

lensflare1
Re: multiple FLV's
on Jul 14, 2006 at 5:50:41 am

thanks Todd. will give it a go.

Cheers

Lensflare


Return to posts index

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
© 2017 CreativeCOW.net All Rights Reserved
[TOP]