1 Reply Latest reply on May 14, 2010 4:29 AM by webqaflash

    want to rotate on button press or button hold 180 degree

    JaxNa Level 1

      hi

       

      here is my code,

       

       

      var strawRadians;
      var strawDegrees;
      function aimStraw() {
          straw._visible = true;
          var dx = _xmouse-straw._x;
          var dy = _ymouse-straw._y;
          strawRadians = Math.atan2(dy, dx);
          strawDegrees = 360*strawRadians/6.283185E+000;
          straw._rotation = strawDegrees;
      }
      straw.onEnterFrame = function() {
          _root.aimStraw();
      };

       

       

      This is running on Enterframe but  I want to ratate 180 degree and on button press and hold button

      Plz any one help me..

       

       

        • 1. Re: want to rotate on button press or button hold 180 degree
          webqaflash Level 3

          onClipEvent (enterFrame)
          {
              function onPress()
              {
                  pressing = 1;
              }
              function onRelease()
              {
                  pressing = 0;
                 
              }
              function onReleaseOutside()
              {
                  pressing = 0;
              }

           

              if (pressing == 1)
              {

                 _root.aimStraw();
              }
          }

           

          //above is the code on the button