Question
Attach NetStream to Duplicated MovideClip on the fly
Hi,
Thanks for looking at this.
I am trying to play diferent segments of a movie.flv looped in duplicated MovieCLips. However, only the first MovieClip loads the video, and the rest of duplicated MovieCLips are created but without the flv. here is the code:
// Create the NetConnection object, and connect to the FlashComm
// application on the server.
var nc = new NetConnection( );
nc.connect("rtmp://localhost/surveillance");
//number of times looping
j=6;
count = 0;
//starting point for the video
starting=0;
//duplicate MovieClip that plays the Video
while (count<=j) {
this.one.duplicateMovieClip("one"+count, count);
var ns = new NetStream(nc);
this["one"+count].Mymov.attachVideo(ns);
ns.play("security4","starting",10);
//once done play it again
ns.onStatus=function(info:Object){
if(info.code == "NetStream.Play.Stop"){
ns.seek(0);
}
}
count += 1;
starting +=3;
}
I would appreciate any help. THanks.
Thanks for looking at this.
I am trying to play diferent segments of a movie.flv looped in duplicated MovieCLips. However, only the first MovieClip loads the video, and the rest of duplicated MovieCLips are created but without the flv. here is the code:
// Create the NetConnection object, and connect to the FlashComm
// application on the server.
var nc = new NetConnection( );
nc.connect("rtmp://localhost/surveillance");
//number of times looping
j=6;
count = 0;
//starting point for the video
starting=0;
//duplicate MovieClip that plays the Video
while (count<=j) {
this.one.duplicateMovieClip("one"+count, count);
var ns = new NetStream(nc);
this["one"+count].Mymov.attachVideo(ns);
ns.play("security4","starting",10);
//once done play it again
ns.onStatus=function(info:Object){
if(info.code == "NetStream.Play.Stop"){
ns.seek(0);
}
}
count += 1;
starting +=3;
}
I would appreciate any help. THanks.