FORUMS: list search recent posts

register a hit test when an object passes over another

COW Forums : Adobe Flash

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Keith Vickers
register a hit test when an object passes over another
on Aug 16, 2016 at 8:32:56 am

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.

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

Return to posts index

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
© 2018 All Rights Reserved