3 Replies Latest reply on May 1, 2006 12:19 PM by mrmille

    Another drag issue


      I'm trying to create a "slider" that only gives med the x-coordinates

      Just something simple like this...

      on(press) {
      this._x = _root._xmouse;

      _root.curX.text = this._x;

      But the bugger wont just move =(
      Oh, well, a few pixels at a time but no drag...

      I havent managed to restrict startDrag to the x-axis either

      Please help!
        • 1. Re: Another drag issue
          The followind code work just fine for sliders:

          on (press) {
          startDrag(this, false, 0, 0, 91.9, 0);
          on (release) {

          Numbers 0, 0, 91.9 and 0 means that slider can move only left and right, from 0 x-coordinate to 91.9 x-coordinate.
          • 2. Re: Another drag issue
            this.startDrag (false, _x , 0, _x + _width, 0); will constrain to the x and y axis, (copied from my current project, changes the 0's to move along y). In order to do what you want you need to uuse he onMouseDown function along with onEnterFrame (if you want a 'real-time' update ofthe x-coordinate, or simply onMouseUp. You have to use onMouse up either way.
            • 3. Re: Another drag issue
              mrmille Level 1

              I actually solved this one as soon as i posted this message

              startX = 226;
              startY = 132;