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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Loading a New FLV

Status
Not open for further replies.

TigerGirl7

Programmer
Apr 8, 2003
152
US
Hi,

Below is the script I'm using to load my FLV. It works great!

What I don't know how to do is tell the file that when the video is finished, to load a different FLV. (The purpose for this is to load a still image from the beginning of the video just so the user has something to look at. Or a SWF instead of an FLV that could say "Play Again".)

Any suggestions?

====

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

var ns:NetStream = new NetStream(nc);

theVideo.attachVideo(ns);

ns.play("video_1.flv");

====

Cheers!
 
Actually, it would be even better if I could just tell my movie to play frame 2 when the video is over.

Can I do this??
 

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

var ns:NetStream = new NetStream(nc);

ns.onStatus = function(info){
if(info.code == "NetStream.Play.Stop"){
ns.play("video_2.flv");
// Or some other code as...
_root.gotoAndStop(2); // or gotoAndPlay(2);
}
};

theVideo.attachVideo(ns);

ns.play("video_1.flv");

Regards. FLASH HELP - OPENED FOR BUSINESS!
TO GET YOUR OWN FREE WEBSITE HOSTING
 
great, thanks! I've got that part working now. What I need to do now is create a button that in addition to playing a new FLV, also eliminates the old one.

Here's the code that I'm currently using for my button:


video2Btn.onRelease = function() {
//ns.close();
gotoAndStop(2);
ns.play("video_2.flv");
ns.onStatus = function(info:Object) {
if (info.code == "NetStream.Play.Stop") {
gotoAndPlay("ph2");

}
}
}


Is there a to delete, onRelease, video_1.flv? It's getting stuck in the player, keeping video_2 from being displayed.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top