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

fast forward and rewind buttons to control movie clips AND main movie

Status
Not open for further replies.

kdelacruz

Technical User
Oct 7, 2002
25
0
0
ES
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.

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
 
you are perhaps going back or trying to go back 100 frames before 100 frames have loaded or before totalframes are known. some preload code for that clip ?

ok reread your post and you say that that


also if works best with absolute test >= rather than >


is there a reason for the 100 frame jump? maybe some smother control with a slider would be better.
 
Nothing special about the 100 frames jump ... a slider would be fine too -- I just need some way for users to be able to go back or forward a bit.

Even with a slider, though, and no matter how far back or forward they would go, there's always a chance to hit the movie at a point where a movieclip should be playing (and not be loaded since you could miss the loading frame), right?

Maybe what I can do is put some code in the frames at the beginning and end of each movieclip, and store the frame number where the last movie began and ended, then in the code of the rewind & ff buttons, use that info to decide how far back or forward to go (to make sure, for example, in rewinding, I go back far enough to hit the last movie clip's load frame if I need to).

Please let me know if you have an idea where a slider or anything else would make this easier!

Thanks!
--Kathy
 
Just how many of these external video.swfs do you have, in the whole movie?

Regards,

cubalibre2.gif
 
Thanks for the tips ... but these external swfs are really loading at runtime, and those components aren't meant to control a main movie AND a runtime loaded clip seamlessly, they're meant to control a clip.
What I did was just scrap the rewind and fast forward buttons and replaced them with a restart button! If any users complain and ask for a rewind & fast forward button, THEN I'll mess around with it more!

I appreciate all your help!

--Kathy
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top