2 Replies Latest reply on Aug 11, 2016 5:39 AM by johnd58352336

    drag and drop item to change a movieclip opacity

    johnd58352336

      Hi all, I am creating a simple game in Animate. I want to be able to pick up(drag and drop) a MovieClip(1) which when moved over another MoviClip(2) will change the opacity of the topmost layer in MovieClip(2). I know I do not explain well.

       

      The game will involve washing dishes or a car. As a graphic of a 'sponge'(clip-1)  is moved over a representation of dirty dishes or a dirty car-bubbles animate from the 'sponge' and depending on how long the 'sponge' is held over the dishes(2) then the opacity of the top layer (which will represent dirt) will drop to reveal a 'clean' layer beneath.

       

      I have seen this exact thing done in the app my boo where the creature is washed with a sponge.

      myBoo.jpg

      The app is for Ios and Android so I need to utilise 'touch-swipe' sort of events.

      Thanks in advance guys.

       

      Peace

        • 1. Re: drag and drop item to change a movieclip opacity
          Ned Murphy Adobe Community Professional & MVP

          One way to do it would be to make the dirt layer out of several semi-transparent movielcips that you pile over one another atop the car or dish.  Then do hit tests for the sponge versus those dirt layer objects and gradually change each one's alpha property until it reaches 0 for each for every time a hit is detected.

          1 person found this helpful
          • 2. Re: drag and drop item to change a movieclip opacity
            johnd58352336 Level 1

            This is where I am Ned

             

             

            I have a MovieClip1(sponge) and MovieClip2(dishes). I have used the Touch_begin and Touch_end events so I can drag MovieClip1 around the screen. I stored it's original position so when I let go it returns to it's original point. Works great.

             

            I need for MoviClip1 to check whether it has passed over MovieClip2.

             

            I have tried placing HitTest in both the Touch_begin and Touch_end functions and run a trace. My MovieClip1 only checks for a hit test when I first drag the movieClip or when I drop it, registering no collision.

             

             

            Is there a way of getting movieClip1 to check for a HitTest as it passes over movieClip2.

             

             

            Thanks in advance

            Peace

            John