PDA

View Full Version : Playing Multiple Movies


jerrye25
08-05-2009, 03:49 AM
So I'm very much a beginner at this and over the last week or so I've created a nice little screen with 10 buttons. Each button, when clicked plays a movie with the FLVPlayer object. It actually works very well so far.

But here's where I'm stuck. When the movie from Button 1 plays, then finishes playing, I would like the next movie, the one behind Button 2 to start playing automatically so if the user lets it run, all 10 would play from Beginning to End.

I'm having trouble figuring out how to make it detect when Video 1 ends so I can move it to Video 2.

Any help is truly appreciated, this is the first time I've designed anything in flash and so far, I'm really liking it.

Xoria
08-05-2009, 04:16 AM
Sorry, I probably won't be of much help, but did you use any actionscript? If so could you post it? If not maybe you should use it to solve the problem.

jerrye25
08-05-2009, 04:39 PM
So each one of the videos has it's own button, click the button and the video plays. What I would like it to do is let's say someone clicks the Video5 button, when it ends, if no buttons are pressed, I want it to move on to Video 6 automatically.

I've thought of doing one long video divided into segments but there may be a time where I want to change one of the videos and I don't want to have to deal with defining segments everytime I re-record one of the videos.


stop();
pages.stop();

var myNum:int = 0;
var totalNumVideos = 11;
var myVideoArray:Array = new Array();

myVideoArray.push("Videos/Video1.flv");
myVideoArray.push("Videos/Video2.flv");
myVideoArray.push("Videos/Video3.flv");
myVideoArray.push("Videos/Video4.flv");
myVideoArray.push("Videos/Video5.flv");
myVideoArray.push("Videos/Video6.flv");
myVideoArray.push("Videos/Video7.flv");
myVideoArray.push("Videos/Video8.flv");
myVideoArray.push("Videos/Video9.flv");
myVideoArray.push("Videos/Video10.flv");
myVideoArray.push("Videos/Video11.flv");

function startPlaying(num:int): void {
VideoPlayer.source = myVideoArray[num];
VideoPlayer.play();
}

function makeFBSegmentsButton(mc:MovieClip,num:int): void {
mc.addEventListener(MouseEvent.CLICK,onClickFBSegm entsButton);
mc.buttonMode = true;
mc.num = num;
}

function onClickFBSegmentsButton(e:MouseEvent):void {
if (VideoPlayer.state == "playing") {
VideoPlayer.stop();
}

myNum = e.target.num;
startPlaying(myNum);
}

makeFBSegmentsButton(FBVideo1_btn,0);
makeFBSegmentsButton(FBVideo2_btn,1);
makeFBSegmentsButton(FBVideo3_btn,2);
makeFBSegmentsButton(FBVideo4_btn,3);
makeFBSegmentsButton(FBVideo5_btn,4);
makeFBSegmentsButton(FBVideo6_btn,5);
makeFBSegmentsButton(FBVideo7_btn,6);
makeFBSegmentsButton(FBVideo8_btn,7);
makeFBSegmentsButton(FBVideo9_btn,8);
makeFBSegmentsButton(FBVideo10_btn,9);
makeFBSegmentsButton(FBVideo11_btn,10);

myNum = 0;
startPlaying(myNum);