3 Replies Latest reply on Feb 12, 2010 8:12 AM by JOliver77

    stopDrag Issue.. ??

    JOliver77

      Hello,

       

      I have a movie clip placed on my stage.  Within this movie clip I have a sliding button with the instance name 'volumeslide_btn'.  On frame 1 of this movie clip (on it own 'actions' layer) I have the following script:

       

      this.volumeslide_btn.onPress = function() {

          volumeslide_btn.startDrag(this,true,24,1,115,1);

      }

      this.volumeslide_btn.onRelease = function() {

          volumeslide_btn.stopDrag();

      }

       

       

      My problem is that the stopDrag command is not working.  when I click the mouse picks up the button and drags to just fine, but when i release, nothing happens and the button stays attached to my mouse arrow.

       

      Any help would be much appreciated.

        • 1. Re: stopDrag Issue.. ??
          kglad Adobe Community Professional & MVP

          try:

           




          this.volumeslide_btn.onPress = function() {

              volumeslide_btn.startDrag(this,true,24,1,115,1);

          }

          this.volumeslide_btn.onRelease = this.volumeslide_btn.onReleaseOutside = function() {

              volumeslide_btn.stopDrag();

          }

           

           


          • 2. Re: stopDrag Issue.. ??
            JOliver77 Level 1

            Hi, that appears to have done the trick..  thanks a million!

             

            As I'm still learning with Flash could you explain why the code I was using didnt work..  just so I can understand my error?

             

            Many thanks..

            • 3. Re: stopDrag Issue.. ??
              kglad Adobe Community Professional & MVP

              your onRelease() could not have been executing.  so, i reasoned you must not be releasing your dragged object.  that happens (in as2) when you release the mouse button but the object is no longer under the mouse.  ie, an onReleaseOutside() would execute but not an onRelease.

              1 person found this helpful