2 Replies Latest reply on May 13, 2006 5:36 AM by Newsgroup_User

    startDrag has the mouse sticking

    JstMrd
      I have a small project which allows the user to drag a selected response to a question to an answer box. The only problem is that the mouse sometimes sticks, or that it does not stopDrag when the user releases the mouse.

      I have tried many things to releave this but to no avail. The script is on a frame, and controls movie clips on the stage. Below is a sample for one of the clips. I must be overlooking something or is there someway to properly test this out and to have the mouse release properly.

      SCRIPT SAMPLE:

      move01.onPress = function() {
      this.swapDepths(1000);
      startDrag (this, true);
      }

      move01.onRelease = function() {
      stopDrag();
      if (this._droptarget == "/tg01") {
      _root.rFLD="Please try again.";
      this._x = 229.7;
      this._y = 263.1;
      _global.shortAnswer = _global.shortAnswer+1;
      }
      if (_global.shortAnswer == 2) {
      _root.rFLD="The correct answer is";
      _root.varAnswer=_global.realAnswer;;
      _global.shortAnswer= 0;
      play();
      }
      this.swapDepths(this.depth);
      this._x = 229.7;
      this._y = 263.1;
      }
        • 1. Re: startDrag has the mouse sticking
          pwyon
          try something like:
          myButton.onRelease = myButton.onReleaseOutside = function(){
          trace( "Hello" );
          }//end button

          Hope that helps.
          • 2. Re: startDrag has the mouse sticking
            Level 7
            You just need an onReleaseOutside in addition to the onRelease. Just set
            move01.onReleaseOutside to the same function as you have set the onRelease
            to.

            Also, just a FWIW, but you have:

            this.swapDepths(1000);
            startDrag (this, true);

            Why don't you stay consistent and say: this.startDrag(true);
            I think that reads better as well...


            --
            Dave -
            Adobe Community Expert
            www.blurredistinction.com
            www.macromedia.com/support/forums/team_macromedia/