;

PDA

Click to See Complete Forum and Search --> : dynamic external flv - multiple istances


mbenney
03-09-2007, 01:55 PM
Hi Peeps.

I'm having a bit of trouble here. I'm trying to create multiple video clips at once. I want to be able to attach x amount of video clips to the stage and load a different video into each one. It doesn't really bother me if they are streaming or not (they are very small clips) but streaming would be preferred. I would like the clips to loop.

What i have been trying to do is...

create a movie clip (with linkage id) with a video object clip inside it (made by selecting the 'new video' option from the library dropdown).

Create a netconnection and netstream.

attach the 'holder' clip to the stage several times and pass a different flv file name to each instance of the mc.

It doesnt seem to be working atall :(

I either get only one of the videos playing, or none of them playing and just sound.

Can someone please advise me as to the best approach to tackle this?

Any tuts and or resources would be appreciated

thanks v much

[m]

mbenney
03-09-2007, 02:15 PM
Okay.. have got it working to an extent... now using the same video object duplicated to play multiple videos (will make it dynamic with a loop... that part will be easy)

Does anyone know how I can get the clips to loop? At the moment they play then stop.

Thanks


var my_video:Video; // my_video is a Video object on the Stage
var my_nc:NetConnection = new NetConnection();
my_nc.connect(null);


var my_ns:NetStream = new NetStream(my_nc);
v1.my_video.attachVideo(my_ns);
my_ns.play("video44.flv");

var my_ns2:NetStream = new NetStream(my_nc);
v2.my_video.attachVideo(my_ns2);
my_ns2.play("02.flv");

var my_ns3:NetStream = new NetStream(my_nc);
v3.my_video.attachVideo(my_ns3);
my_ns3.play("3.flv");

mbenney
03-09-2007, 03:31 PM
Okay figured that out too :)

var my_ns2:NetStream = new NetStream(my_nc);
v2.my_video.attachVideo(my_ns2);
my_ns2.play("02.flv");

my_ns2.onStatus = function(info) {
if (info.code == "NetStream.Play.Stop") {
my_ns2.seek(0);
}
};

Last problem... flv files in a sub directory?
this doesent work as it does with jpgs and MovieClipLoader...
"./files/video44.flv"

mbenney
03-09-2007, 03:54 PM
hmm this seems to work... seems a bit like a hack though... anyone know why the above wont work?

my_ns.play("../site/files/video44.flv");