5 Replies Latest reply on May 18, 2006 6:38 AM by shawnA2

    Rotate movie clip with a button mouse over?

    shawnA2
      If anyone has any ideas about how to code this, it'd be greatly appreciated.

      I have a one frame swf with a few buttons and two movie clips of a wheel. The wheel needs to spin when you mouse over the buttons and stop when not hovering.

      I tried setting the property rotation of the clip on roll over, but it doesn't move the wheels continuously or stop where it lands.

      Anybody have any ideas? Thanks!
        • 1. Re: Rotate movie clip with a button mouse over?
          gregmax17 Level 1
          I think it would easier to make the button a movie clip, unless that is what you have, good job. Then try this:

          wheel.onRollOver = function() { wheel._roration = wheel._rotation + 25; }
          wheel.onRollOut = function() { wheel._roration = wheel._rotation + 0; }
          whell.onPress = funciton() { /*what you want it to do*/ };

          That is my suggestion.
          • 3. Re: Rotate movie clip with a button mouse over?
            shawnA2 Level 1
            well I would, but there are multiple buttons and two seperate wheels. that would work way better, but i have to stick to the intial design laid out by the graphics guy. Thanks for your help though!
            • 4. Re: Rotate movie clip with a button mouse over?
              Level 7
              "shawnA2" <webforumsuser@macromedia.com> wrote in message news:e4fuip$38j$1@forums.macromedia.com...
              > If anyone has any ideas about how to code this, it'd be greatly appreciated.
              >
              > I have a one frame swf with a few buttons and two movie clips of a wheel. The
              > wheel needs to spin when you mouse over the buttons and stop when not hovering.
              >
              > I tried setting the property rotation of the clip on roll over, but it doesn't
              > move the wheels continuously or stop where it lands.
              >
              > Anybody have any ideas? Thanks!
              >

              Here is the way I would do it.
              wheel movieclip has instance name of 'wheel'
              2 buttons with instance names of btn1 and btn2
              All code is in frame 1, nothing attached to anything.
              tralfaz

              // ************* wheel stuff ***********
              this.wheel.onEnterFrame = function()
              {
              this._rotation += _root.direction;
              }

              // ************* button 1 stuff ***********
              btn1.onRollOver = function()
              {
              direction = 5;
              }

              btn1.onRollOut = function()
              {
              direction = 0;
              }

              btn1.onRelease = function()
              {
              direction = 0; // if you want to stop wheel when button is pressed
              }

              // ************* button 2 stuff ***********
              btn2.onRollOver = function()
              {
              direction = -5;
              }

              btn2.onRollOut = function()
              {
              direction = 0;
              }

              btn2.onRelease = function()
              {
              direction = 0; // if you want to stop wheel when button is pressed
              }
              // ***********************************




              • 5. Re: Rotate movie clip with a button mouse over?
                shawnA2 Level 1
                Thank you so much! That worked perfectly!