2 flv videos in one swf

I want to be able to play multiple flv files in one swf file, but not at the same time. It will be as basic as having one play until it is finished then having a new one play.

Check out a neave.tv for a good example of this.

I’ve tried changing ns.play to a new address when the duration of the video almost reaches its end. The function executes, but it seems like the 2nd video (testB.flv) loads over and over again.

Does anyone know a good and easy way of doing this? I’m figuring it will have to do something with first unloading the current video and reestablishing the NetStream.

Here’s my current code:


var nc:NetConnection = new NetConnection();
nc.connect(null);

var ns:NetStream = new NetStream(nc);

theVideo.attachVideo(ns);

ns.play("http://www.vectorsector.net/fullScreen/flv/testA.flv");

rewindButton.onRelease = function(){
ns.seek(0);
}
playButton.onRelease = function(){
ns.pause();
}

var videoInterval = setInterval(videoStatus,100);
var amountLoaded:Number;
var duration:Number;

ns["onMetaData"] = function(obj){
duration = obj.duration;
}


function videoStatus(){
amountLoaded = ns.bytesLoaded / ns.bytesTotal;
loader.loadBar._width = amountLoaded * 216;
loader.scrub._x = ns.time / duration * 216;
}

var scrubInterval;

loader.scrub.onPress = function(){
clearInterval(videoInterval);
scrubInterval = setInterval(scrubit,10);
this.startDrag(false,0,this._y,216,this._y);
}

loader.scrub.onRelease = loader.scrub.onReleaseOutside = function(){
clearInterval(scrubInterval);
videoInterval = setInterval(videoStatus,100);
this.stopDrag();
}

function scrubIt(){
ns.seek(Math.floor((loader.scrub._x / 216) * duration));
}

And…just in case, I don’t think it’s real important but here’s my current player: vidTest3.swf

Right now the player doesn’t feature a working scrubber, and don’t mind the current graphics…its all for test purposes right now.

Thanks.