-
Can anyone tell me how to do a collision detection? I tryed the tutorial, but it's in Flash 4 and doesn't work when I tryed it myself.
I'm doing this: I have 2 circle graphics in a movie clip, then when there is a collision, I want the one movie clip w/ circle graphic to change its alpha to 0.
Thanks,
-
add this script to each movieclip:
onClipEvent(enterframe){
distance = Math.sqrt((_x-_root.movieclip2._x)*(_x-_root.movieclip2._x)+(_y-_root.movieclip2._y)*(_y-_root.movieclip2._y));
if (distance<=_width/2+_root.movieclip2._width/2){
_alpha=0
}
}
now change the movieclip name that says movieclip2 to movieclip 1 when you assign the script to the second movielip!
Hope that helps!
Regards FlashGuru
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|