Controlling playback of movieclips from the main timeline

Posted on 2007-08-03
Last Modified: 2013-11-05
Hi. I have created a movie in Flash 8. On the main timeline one layer consists of three movie clips positioned sequentially (i.e. the first movie clip mcIntro is in frame one, mcMiddle is in frame two, and mcEnd is in frame 3). I would like a button on the main timeline that would, when clicked, pause whichever movie clip is playing, and then change into a play button so the same movie is restarted from the position where it was initially paused. I'm stuck right from the start because I don't know how to specify that the button is to control whichever movie clip happens to be playing. Thanks a lot for the help!
Question by:choward123
    LVL 14

    Expert Comment

    In order to control the movieclips, you have to give the movieclips instance names (you can do this in the properties panel). Give each of them separate instance names so that you can refer each on in actionscript individually. Once you have the instance names, you can control the movieclips accordingly using the _root.myclip1.stop() to stop them and to play again. Replace myclip1 with the instance names of the movieclips so if you have mcIntro as the instance name for one of the movieclips, you can stop and play it using this command:


    Author Comment

    Thanks trigger-happy, but that's not exactly what I'm looking for. I have navigation buttons where the viewer can jump to certain sections and I've coded those buttons to how you have described, but I am still stuck on the pause buttons.

    The way the movie is set up is so the viewer will watch all three movie clips in a row without a break, like a presentation. I want to add the pause button so the viewer has the option to stop the presentation midway, so I'm wondering if there is a general way of saying to stop whatever movie clip is playing and then be able to restart the same movie clip in the same frame.

    LVL 14

    Accepted Solution

    The only method that I'm aware of for stopping all movieclips would be to make use of the actionscript events. That kind of method is actually way more complicated than simply forcing specific movieclips to stop/pause. In general, if you intend to make a lot more video segments, then using the Flash event system would be a very good choice, but with just 3-4 video segments, you're better off commanding the movieclips individually. This can be done by creating keyframes for all 3 segments in the main timeline for the play/pause button. In each frame, change the code inside the button to refer to the appropriate movieclip instance.

    Hope I understood your problem and helped solve it.


    Author Comment

    Thanks, I think I'll stick with the less complicated route now. I appreciate your help.

    Featured Post

    Threat Intelligence Starter Resources

    Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

    Join & Write a Comment

    This is intended to introduce all collision detection principles in flash, their strengths, weaknesses and workarounds. The main method for Collision Detection in flash is using hitTestObject. But unless you'll be pushing rectangular shapes without …
    I have been doing hardcore actionscripting for some time; and needless to say I have faced a lot of problems in just understanding others' code rather than understanding what the code executes. A programmer's life can become hell when there are a lo…
    The goal of the tutorial is to teach the user how to live broadcast using Flash Media Live Encoder and connecting it to YouTube to broadcast. Log into your Youtube account, choose live stream settings, start live stream from Flash Media Live Enc…
    The goal of the tutorial is to teach the user how to select the video input device. Make sure you have an input device that in connected and work and recognized by Adobe Flash Media Live Encoder and select it in the “video input” menu.

    745 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    13 Experts available now in Live!

    Get 1:1 Help Now