3 Replies Latest reply on May 28, 2006 4:29 AM by Newsgroup_User

    calling a movieclip to play on a mouse event

    oopsidazy Level 1
      Hi!

      I have a button that when the user goes over it with his mouse, i want a movie clip to show up. This movie clip has more buttons on it. so i placed the movie clip on a separate layer and on the movie clip itself, the first keyframe is blank and has a stop action. now when the user hovers with the mouse over the button i want to do "goto and play" and call the movie clip to start from the second frame. I would appreciate it if someone can tell me where i write the script and what exactly do i have to write?

      thanx for your kindness,
        • 1. calling a movieclip to play on a mouse event
          Mad_Rhino
          Hey,

          you mentioned that you have a button already, well select that button and click on the 'actions' panel (Window -> Actions). Once there enter this code:

          on(rollOver){
          MovieClipName.gotoAndPlay(2);
          }

          Replace MovieClipName with your movieclip (the one with the extra buttons);


          • 2. Re: calling a movieclip to play on a mouse event
            oopsidazy Level 1
            so i did that but now as long as the mouse is over that button, it keeps calling the movie clip to start and i want to disable the button,
            see my question posted today: "Disabling a button"

            thanx for your help
            • 3. Re: calling a movieclip to play on a mouse event
              Level 7
              if you assign onRollOver function to a movieClip from frame script
              (click frame where the button is and press F9 for actionscript..), you
              can disable it as well:

              my_mc.onRollOver = function() {
              gotoAndPlay(2);
              delete this.onRollOver;
              }


              but I don't understand why your function is still called...onRollOver is
              invoked just once. When you len mouse hover the button, this function is
              NOT CALLED.
              If your button is a movieClip which changes size so it acts like the
              mouse was moving away and back over it, you should create an extra layer
              (bottom) to your button mc, covering maximum area your animated button
              will need. then change layers _alpha to 0 and your mouse should no
              longer be "jumping out of the button"

              Pepa