PDA

View Full Version : Using "NetStream" class to play a movie when the previous one has ended.


carayo
09-23-2004, 10:12 AM
Im pretty new at this and could really use some help
I want to trigger a new video "video2.flv" when the first one finishes, and Im sooo close. The onStatus handler (its a handler...right?) works and traces "finished" when the first video reaches the end. Then I try to play the second video and it completely freezes. Im using netStream.play("videos/video2.flv"); which makes sense to me, but its obviously not right...



var netConn:NetConnection = new NetConnection();
netConn.connect(null);
var netStream:NetStream = new NetStream(netConn);
Smartvideo.attachVideo(netStream);
netStream.setBufferTime(5);
netStream.play("videos/video1.flv");

netStream.onStatus = function (vInfo) {
trace(vInfo.code)
if (vInfo.code == "NetStream.Play.Stop") {
trace("finished")
netStream.play("videos/video2.flv");

}
}


stop();

darkee999
01-30-2008, 08:27 AM
Hello. I was having a problem too with changing to the next video, I didn't knew when it was finissed:P.

I use the exact same code as you, only i use a function that plays the movie(and does other things) instead of netStream.play("videos/video2.flv");

It works just fine!