View Full Version : Controlling playback on multiple FLVs
valentinus
12-22-2006, 03:18 AM
I created a 15 second movie in After Effects, and exported it as two separate FLV segments. I want to compile these both in Flash so that the first segment plays when the webpage is opened, and as soon as it finishes, the second segment begins playing immediately. From then on, the second segment should continue looping indefinitely.
This sounds like an extremely simple concept, but either I am incredibly unskilled in the ways of Flash (true), or there is much more to this than I would give it credit.
Any suggestions?
I also considered exporting the 15 second movie as a single FLV, and then use cues to indicate when the animation has reached the end. From here I would like to trigger the timeline to return to a separate cue at 7 seconds, thus creating a loop.
I have no idea how to do this.
Any help will be greatly appreciated.
danlefeb
12-22-2006, 07:17 AM
So basically you want the two segments to play like one movie. The easiest way to do that is to simply put the second one right after the first one in the timeline. Then it'll automatically play.
To get the loop, at the very last frame put an action to goToAndPlay whatever the frame is that the second segment starts at. Then it'll play all the way through then when it hits the end it'll start over at the beginning of the second segment, etc.
To limit confusion, I've found its easiest if I label my frames. So in this case I would label the beginning and end frame of each segment. So the second segment's first frame would have a label of something like "begin_part_2". Then at the last frame, you would put a keyframe on that frame and in the actionscript use:
goToAndPlay ("begin_part_2");
valentinus
12-22-2006, 11:56 AM
Thanks for replying so quickly, danlefeb. I'll be sure to implement naming conventions for my frames.
I had tried your suggestion first (it does, afterall, seem like the most obvious thing to do). However, when I preview the SWF following your instructions, I end up with simply a black screen and no video (my stage color is set to black). It was for this reason that I assumed I was doing something wrong :)
If I construct the Flash file using only one of the FLVs, the SWF will play video. When I try to place the two FLVs side-by-side in the timeline, I get nothing.
McGergs
12-22-2006, 12:24 PM
How are you importing the FLV? In a movieclip or just straight to the stage?
valentinus
12-22-2006, 01:07 PM
I have tried both methods, with the same results. I'll walk you through every step as I've done it.
Method 1:
1) Create two separate keyframes next to each other on the timeline
2) File>Import>Import Video
3) Load the file from "On your computer"
4) I've consistently chosen "Progressive download from server." I was wondering if the selection here might be the culprit.
5) Choose "no skin"
6) This inserts the FLV directly onto the first keyframe.
7) Select keyframe 2 and delete the first FLV. Import the second FLV following the method above.
Method 2:
Alternatively, I've created two movie clips and imported the FLVs (as outlined above) directly into them. I create two keyframes for Scene 1 and drag the movie clips to their respective keyframes... with the same result: a blank SWF.
McGergs
12-22-2006, 03:09 PM
Try putting them on different layers. Move the keyframe over for the second movie to line up with the end of the first movie. Then create an ations layer with a keyframe at the end of the second movie with the "goToAndPlay" command like danlefeb said above.
See if this works.
valentinus
12-22-2006, 03:40 PM
I have tried that as well, and it doesn't work. The SWF behaves differently in this case, however. From the best I can tell, the SWF constantly flickers back and forth between the FLV on frame 1 and the FLV on frame 2.
Perhaps we are getting closer to a solution?
McGergs
12-22-2006, 04:56 PM
Are you stretching out the frames in the timeline by hitting F5 to match the flv frame numbers?
valentinus
12-24-2006, 03:59 PM
Good news! I have come across a solution, but as I suspected, it was not quite as easy as the straightforward methods outlined above. I thank you all for pushing me in the right direction, though.
Here is my solution. For reference, the two FLVs I'm working with are named Andro_FadeUp.flv and Andro_Repeat.flv
1. Create three layers in Flash. Name them "video", "movie clip", and "actions", respectively.
2. Import Andro_Repeat.flv as an embedded movie clip to the "movie clip" layer. Give this movie clip an instance name of "mcAndro_Repeat".
3. Open mcAndro_Repeat in edit mode and insert a blank keyframe at frame 1. Write an actionscript for this frame: "stop();"
4. Return to the stage. Import Andro_FadeUp.flv as a progressive download onto the "video" layer. Give this video and instance name of "Andro_FadeUp". In the parameters tab, add an actionscript cue point at 7.000 seconds.
5. The final step is to write an actionscript on the "actions" layer. What we need to create in this case is a listener object for our vid instance to detect the cue point at 7.000 seconds. When that cue point is detected, mcAndroRepeat should trigger and play from frame 2. The actionscript (with notes) I wrote is below:
//create a new listener object
var vidList:Object = new Object();
//direct the movie to mcAndro_Repeat when the cue point at the end of vid is reached
vidList.cuePoint = function(cues) {
//go to frame 2 of Andro_Repeat, since frame 1 is blank and stopped
Andro_Repeat.gotoAndPlay(2);
}
//attach the listener object to the vid instance
vid.addEventListener("cuePoint", vidList);
The main advantage to this solution is that the entire .fla file is only one frame long, and the majority of the action in the movie is tightly controlled by actionscript.