1 Reply Latest reply on Mar 13, 2007 7:18 PM by candeecake

    Rotating Menu/Panels. How to stop them onRelease?

    candeecake
      Hi all,
      I got this script from a tutorial site ( http://www.actionscript.org/showMovie.php?id=1284). It's a 3D rotating menu/panels, reacting to mouse movement. On mouse click, it will expand to a certain size, but I can't stop the rotation. How can I stop the rotation with the specified panel facing front when mouse release, and return to rotating and its original size upon second mouse click??

      And, I notice it's a little buggy, the panel shink to a size smaller than original size when you do a quick click while it's still expanding. :S

      I don't know how I can attach the codes here because all the codes are all over the instance and frames. Perhaps you can check out the original tutorial http://www.actionscript.org/showMovie.php?id=1284

      Many thanks!! I really appreciated it!
        • 1. Re: Rotating Menu/Panels. How to stop them onRelease?
          candeecake Level 1
          Not sure if it helps, here are the codes from the FLA file:

          //////////////////////////////////////////

          this._visible = false;
          var numrotos = 3;
          for (n = 0; n < numrotos; n++){
          newroto = "roto" + String(n);
          this.attachMovie("roto", newroto, n + 1);
          this[newroto].theta = n * 360 / numrotos;
          this[newroto].panel = 31;
          this[newroto].radius = 100;
          this[newroto].contents.gotoAndStop(n + 1);
          } // end of for
          this.title.swapDepths(100);


          //////////////////////////////////////////


          if (_root._ymouse < 120 || _root._ymouse > 280) {
          speed = speed * 0.950000;
          } else {
          speed = -_xmouse / 50;
          }

          this._visible = true;


          //////////////////////////////////////////

          on (press)
          {
          if (out)
          {
          _parent.pressv = -2;
          out = false;
          }
          else
          {
          _parent.pressv = 2;
          out = true;
          } // end if
          }


          //////////////////////////////////////////


          if (pressv != 0)
          {
          this.panel = this.panel + pressv;
          pressv = pressv * 0.95;
          if (pressv < 0.200000 && pressv > -0.200000)
          {
          pressv = 0;
          } // end if
          } // end if
          theta = theta + _parent.speed;
          xbit = Math.sin(0.017453 * theta);
          ybit = Math.cos(0.017453 * theta);
          this._xscale = ybit * this.panel;
          this._x = xbit * this.radius;
          this._alpha = 30 + (ybit + 1) * 50;
          this._yscale = this.panel + (ybit + 1) * 3;
          stack = Math.round((ybit + 1) * radius * 2);
          if (stack == 100)
          {
          stack = 101;
          } // end if
          this.swapDepths(stack);