Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

External Flv's

Status
Not open for further replies.

CheeseWiz

Technical User
Mar 2, 2007
2
US
Hi,
I am creating a website in Flash 8 Pro on my PC. I have three external flv's (video01.flv, video02.flv, video03.flv) that I have attached with a NetConnection/NetStream setup. They play great. My question is how, can I get one video to stop in middle and start playing the next?

If I am watching video01 and half way through I click the button to start video02, video02 will start playing but I can still hear video01 playing in the background. Is there actionscript to stop this?

Any help would be greatly appreciated. If this has already been asked before, please direct me to proper thread.
Thanks
 
Hi Kenneth,

Thanks for the response. I have tried NetStream.close(), but that shuts down all three the external flv's from playing video and audio. Is there a way to target NetStream.close() to only one external flv, while opening a new NetStream for the new flv.

Right now to close the video I am targeting the movie clip, which stops the video and starts up the next video, but I can still hear the audio in the background (I'm guessing probably becuase I have loaded it in with NetStream and need to figure out how to stop and start the NetStream, right?).

eg: ON THE BUTTON FOR video1 I HAVE:

//----------Stop/Starting Movieclip------------//
on (release) {

//Movieclip GotoAndStop Behavior
this.video2.gotoAndStop("1");

//Movieclip GotoAndStop Behavior
this.video3.gotoAndStop("1");

//Movieclip GotoAndPlay Behavior
this.Video2.gotoAndPlay("2");

}

AND FOR ATTACHING flv (video1) I HAVE:


//-----------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 == "NetStream.Play.Start") {
progressBar.onEnterFrame = videoUpdate;
}
if(info.code == "NetStream.Play.Stop") {
delete progressBar.onEnterFrame;
}
}

ns.onMetaData = function(info) {
ns.duration = info.duration;
}

//----------ATTACHING NETSTREAM--------------//
video1.attachVideo(ns);


//---------PLAYING EXTERNAL FLV-------------//
ns.play("video1.flv");
 
> Right now to close the video I am targeting the movie clip, which stops the video and starts up the next video

This is not clear to me as you don't need MovieClip to control FLV at all. Can you explain a bit more?

Kenneth Kawamoto
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top