5 Replies Latest reply on Apr 14, 2009 11:34 PM by kglad

    After drag and drop initiation get rid of dragged symbol

    goalpost95

      Here is the code I have now for the drag and drop initation

       

       

      onMouseMove = function(){

      updateAfterEvent();

      }

       

      redCircle.onPress = function(){

      startDrag(this,true)

      }

       

      redCircle.onRelease = function(){

      this.stopDrag();

      checkTarget(this);

       

      }

       

      redCircle.onReleaseOutside = function(){

      this.stopDrag();

      checkTarget(this);

      }

       

      function checkTarget(drag){

       

      // _dropTarget method (commented so non active)

      // trace(drag+ "has been dropped on "+eval(drag._droptarget));

       

      if (drag.hitTest(greyCircle)) {

      drag+ gotoAndStop (32);

      } else {

      gotoAndStop (31);

      }

       

      }

       

       

      What I want to happen is that after you drop the dragged symbol into the landing area the symbol disappears instead of staying in the landing area.

      I am just wondering how to do this.

        • 1. Re: After drag and drop initiation get rid of dragged symbol
          kglad Adobe Community Professional & MVP
          try:

           

           

          onMouseMove = function(){

          updateAfterEvent();

          }

           

          redCircle.onPress = function(){

          startDrag(this,true)

          }

           

          redCircle.onRelease = function(){

          this.stopDrag();

          checkTarget(this);

           

          }

           

          redCircle.onReleaseOutside = function(){

          this.stopDrag();

          checkTarget(this);

          }

           

          function checkTarget(drag){

           

          // _dropTarget method (commented so non active)

          // trace(drag+ "has been dropped on "+eval(drag._droptarget));

           

          if (drag.hitTest(greyCircle)) {

          drag+ gotoAndStop (32);  //<- what's that supposed to do?

          drag.removeMovieClip();

          } else {

          gotoAndStop (31);

          }

           

          }

           

           

          What I want to happen is that after you drop the dragged symbol into the landing area the symbol disappears instead of staying in the landing area.

          I am just wondering how to do this.

          • 2. Re: After drag and drop initiation get rid of dragged symbol
            goalpost95 Level 1

            try:

             

             

            onMouseMove = function(){

            updateAfterEvent();

            }

             

            redCircle.onPress = function(){

            startDrag(this,true)

            }

             

            redCircle.onRelease = function(){

            this.stopDrag();

            checkTarget(this);

             

            }

             

            redCircle.onReleaseOutside = function(){

            this.stopDrag();

            checkTarget(this);

            }

             

            function checkTarget(drag){

             

            // _dropTarget method (commented so non active)

            // trace(drag+ "has been dropped on "+eval(drag._droptarget));

             

            if (drag.hitTest(greyCircle)) {

            drag+ gotoAndStop (32);  //<- what's that supposed to do?   <----------That makes the timeline go to frame 32 when the symbol is dropped into the                                                                                                              //landing area

            drag.removeMovieClip();

            } else {

            gotoAndStop (31);

            }

             

            }

             

             

            What I want to happen is that after you drop the dragged symbol into the landing area the symbol disappears instead of staying in the landing area.

            I am just wondering how to do this.         

             

             

            the drag.removeMovieClip(); did not work the movie clip drop symbol was still was visible when it was placed in the landing area

            • 3. Re: After drag and drop initiation get rid of dragged symbol
              kglad Adobe Community Professional & MVP

              then that movieclip is not at a removable depth.  use swapDepths() to change that:

               

              drag.swapDepths(1000000);

              drag.removeMovieClip();