4 Replies Latest reply on Jun 17, 2009 10:01 AM by Itzelm

    Controlling main timeline and embedded movie clip timeline

    Itzelm Level 1

      Good afternoon folks,

       

      I am trying to solve this problem.  I have a main timeline with an animation. (animation is not a movie clip).  I also have an embedded movie clip in the main timeline. I want to control the actions of the main timeline AND the embedded animation at the same time.

      For example, when a user clicks a "pause" button, i want to stop the main timeline's animation as well as the embedded movie clip. I figured out how to stop the main timeline using the stop(); command.  I also figured out how to stop the embedded movie using the  command  _root.embeddedclipinstancename.stop();  Problem is i don't know the commands to stop both things at the same time.

       

      I tried to find an instance name for the main timeline but there isn't any (i think). I know i could make the animation in the timeline into a movie clip but i don't want to go that route.  Any ideas of how to control both things? 
      Also, if possible, I would prefer not to use the _root command since I know that this might cause a conflict in Captivate.

       

      Thanks.

        • 1. Re: Controlling main timeline and embedded movie clip timeline
          Ned Murphy Adobe Community Professional & MVP

          Include both the commands that worked in your pause button code.  If your [ause button is on the main timeline you don't need to use a _root reference.  That's really only useful if you're targeting from some distant child level object back to the main timeline.  You can _parent (and string them if need be) instead of using _root.  That won't get you in trouble unless you're on the _root timeline when you use it.

          • 2. Re: Controlling main timeline and embedded movie clip timeline
            Itzelm Level 1

            Thanks. It was actually fairly simple. I was trying to complicate things.

             

            I ended up using very simple code

             

            on (release) {
            stop ();
            captions_clip.stop ();
            }

             

            I used slightly different versions for play, rewind and forward.

             

            Works like a charm!

             

            Thanks

            • 4. Re: Controlling main timeline and embedded movie clip timeline
              Itzelm Level 1

              Here is a followup to this discussion.

               

              The last time I posted to this thread, the animations played fine in the Flash Player.  BUT in Adobe's Captivate (which is supposed to be based on Actionscript), the animation works strangely.  When i click play both the animation in the main timeline and the embedded movie clip play syncrhonized.  But when both end playing, the embedded movie clip keeps looping. I don't know what the problem is.  Its driving me crazy as everything worked in Flash but not in Captivate.

               

              I added a stop (); command to the end of the embedded movie clip.  That stops it from looping but then I have to click the play button twice to start both the main animation and the embedded one at the same time. I think its because there is also a stop(); at the beginning of the main timeline. Not sure though.

               

              Any suggestions for a workaround? I tried adding a nameofembeddedclip.stop(); under stop(); to the main timeline but it does nothing to stop the embedded movie clip from looping.

               

              Suggestions?