5 Replies Latest reply on Apr 15, 2009 10:18 AM by mgct2009

    Rollover buttons that play a movie clip.

    mgct2009

      Hello,

       

         I am new to Flash and I am trying to accomplish a simulation such as this example, http://www.its-about-time.com/investinesart/coalplantvirtualtour.swf. I have all of my movie clips done, but how do I tell a rollover button to play a specific movie clip? I also want to have all the movie clips to play simultaneously via a rollover button as shown in the example. I've attached a captured image of my timeline, if that helps. I've tried everything so far, but nothing is working! What is the simplest way of doing this?

       

      I have this inside one of the movie clips (mc_2) in a seperate layer under - (actions)

       

      RO_btn.onRollover = function(){
      mc_2.play();
      };

       

      On the main timeline I have an actions layer with this:

       

      stop();

       

      Thinking that this may stop all of my movie clips but it doesn't.

       

      Should I make an actions layer in each movie clip with this syntax huh? stop();?

       

      I'm frustrated!!

       

      Thanks, if you can help!

       

      MG

        • 1. Re: Rollover buttons that play a movie clip.
          Ned Murphy Adobe Community Professional & MVP

          For the rollover code you show, it would have to be outside of the movieclip it is trying to play, in the timeline that contains the movieclip and the button.  It's a matter of understanding targeting objects.

           

          stop();'s work for the timeline they are assigned to, so if you want your movieclips stopped, you need to have stop();'s in their individual timelines.

          • 2. Re: Rollover buttons that play a movie clip.

            Hi,

             

            I have made something that you are looking for.

            It will be of help to you.

            basically you will have to create a few movie clips namely:

             

            2 buttons: (name them a_btn, b_btn, c_btn, d_btn, e_btn)

            3 movie clips (I am taking example image1_mc, image2_mc, image3_mc)

             

            in each of these movieclips.place 2 frames and on second frame put your movieclip(one in one).on both the frames put stop()

             

            now click on a_btn and write this script

             

            on (rollOver) {
            _root.image1_mc.gotoAndPlay(2);
            _root.image2_mc.gotoAndPlay(2);
            _root.image3_mc.gotoAndPlay(2);

             

            }
            on (rollOut) {
                _root.image1_mc.gotoAndPlay(1);
                _root.image2_mc.gotoAndPlay(1);
                _root.image3_mc.gotoAndPlay(1);
            }

             

             

            with this all 3 animations will work simultaneously. if you need to run any one of the movieclips at a time the you can address that mc in particular

            .Say if you want only 1 mc to move at a time then put this on  btn 2

            on (rollOver) {
            _root.image1_mc.gotoAndPlay(2);

             

            }
            on (rollOut) {
                _root.image1_mc.gotoAndPlay(1);

            }

             

             

            .Dont forget to give proper instance names to movieclips.(they are in properties panel.)

             

             

            Cheers!

            • 3. Re: Rollover buttons that play a movie clip.
              Level 1

              Hi

               

               

              I have attached a file which will serve your purpose well.

              Its almost done here.let me know in case you have any problems understnading the same

               

               

              Cheers!

              • 4. Re: Rollover buttons that play a movie clip.
                Level 1

                Hi

                 

                 

                I have attached a file which will serve your purpose well.

                Its almost done here.let me know in case you have any problems understnading the same

                 

                 

                Cheers!

                • 5. Re: Rollover buttons that play a movie clip.
                  mgct2009 Level 1

                  You're the best! It finally worked, after some troubleshooting!!! Awesome...