How to detect whether a movie clip A touches another movie clip B?
A Flash Developer Resource Site

Results 1 to 2 of 2

Thread: How to detect whether a movie clip A touches another movie clip B?

  1. #1
    Junior Member
    Join Date
    Oct 2004
    Posts
    15

    How to detect whether a movie clip A touches another movie clip B?

    How to detect whether a movie clip A touches another movie clip B?
    we can implement this function using MovieClip.hitTest()
    but according to the documentation this function is not supported in FL
    sometimes i use getProperty() to detect but it is not a smart way
    well, i want to implement this detect to make a table tennis etc.
    how should i do?

  2. #2
    Member
    Join Date
    Feb 2002
    Posts
    48
    The hitTest() function is NOT supported by FlashLite. The FlashLite engine is based on the the Flash 4 syntax.

    I know that detecting collision gets a bit lengthy and tedious with FL, but that is the only way out. One has to use the getProperty() method to detect collision.

    What you can do is, if Object A is colliding with Object B, you can calculate the distance between the two objects. If the distance is <= Object A width/2+Object B width/2, then they are colliding.

    I hope this helps.

    Regards,
    Mariam
    "It's never too late to be what you might have been."

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width


HTML5 Development Center

Poll by Flashkit.com