I am creating a software training movie in Flash (MX). The main movie has text, sound and animations directly on the main timeline, and also includes external swfs (video screen captures) that are loaded dynamically into a movieclip target.
I'm not importing these videos because they can be quite large after importing (my video capturing software can export as swf and avi). I will never play more than one movieclip at a time (so I use the same movieclip to load all movies: mc_finvideo), and there can be many frames in between movie clips where there's only non-movieclip stuff going on on the main timeline. After I finish playing a movie clip , I unload the movie from the movieclip using the following on the frame on the main timeline where the movieclip should end
I have play, pause, fast forward and rewind buttons on the main timeline that control the main movie just fine. The play and pause buttons also control the movieclip fine.
However, I'm having problems with the rewind and fast forward controlling the movieclip. The button logic works fine (moves play ahead or back 100 frames) UNLESS I click the rewind button at a point within 100 frames AFTER a movie clip has unloaded. Then (assuming the last movie clip was at least 100 frames long), the movie goes back to a frame where there should be a movie loaded, but of course there isn't, since the frame that loaded the movie clip wasn't hit.
Here's the code for the rewind button's on release event:
The fast forward button is similarly problematic -- if I click fast forward within 100 frames of a frame where a movie clip will load, the frame that the movie fast forwards to has no movie clip playing because the frame that loads the clip was skipped over.
Can anyone help me make this work? (Maybe I'm going about this whole thing the hard way?)
I can post a sample fla if it will help clarify.
Thanks
Code:
loadMovie("bkr_openpgm.swf", "mc_finvideo");
I'm not importing these videos because they can be quite large after importing (my video capturing software can export as swf and avi). I will never play more than one movieclip at a time (so I use the same movieclip to load all movies: mc_finvideo), and there can be many frames in between movie clips where there's only non-movieclip stuff going on on the main timeline. After I finish playing a movie clip , I unload the movie from the movieclip using the following on the frame on the main timeline where the movieclip should end
Code:
mc_finvideo.unloadMovie()
I have play, pause, fast forward and rewind buttons on the main timeline that control the main movie just fine. The play and pause buttons also control the movieclip fine.
However, I'm having problems with the rewind and fast forward controlling the movieclip. The button logic works fine (moves play ahead or back 100 frames) UNLESS I click the rewind button at a point within 100 frames AFTER a movie clip has unloaded. Then (assuming the last movie clip was at least 100 frames long), the movie goes back to a frame where there should be a movie loaded, but of course there isn't, since the frame that loaded the movie clip wasn't hit.
Here's the code for the rewind button's on release event:
Code:
intCurrFrame = math.round(_currentframe);
intMCCurrFrame = math.round(mc_finvideo._currentframe);
//if the movieclip is closer than 100 frames
// to the beginning, go back 100 frames
// otherwise unload it
if ((mc_finvideo._currentframe - 100) > mc_finvideo._totalframes) {
mc_finvideo.gotoAndPlay(intMCCurrFrame - 100);
} else {
mc_finvideo.unloadmovie();
}
this.gotoAndPlay((intCurrFrame - 100));
The fast forward button is similarly problematic -- if I click fast forward within 100 frames of a frame where a movie clip will load, the frame that the movie fast forwards to has no movie clip playing because the frame that loads the clip was skipped over.
Can anyone help me make this work? (Maybe I'm going about this whole thing the hard way?)
I can post a sample fla if it will help clarify.
Thanks