dcsimg
A Flash Developer Resource Site

Results 1 to 2 of 2

Thread: Why doesn't this hitTest work?

  1. #1
    Junior Member
    Join Date
    Aug 2004
    Posts
    16

    Why doesn't this hitTest work?

    This might make more sense if you download and run the .fla file first -

    pointer_mc was originally just two lines put together to form a + sign. The resulting shape was converted into a movie clip. Within that movie clip I placed another movie clip called pointerLine_mc. My intention was to rotate the whole thing at the +. A hitTest is contintually run so that whenever pointerLine_mc touches certain objects, a green indicator becomes visible. My problem is that the hitTest comes up positive when pointerLine_mc gets close to the object instead of only coming up positive when it touches the object (at least that is how I thought hitTests were supposed to work). Can anyone figure out why hitTest is not working the way it should?

    In the example given, the red dot is supposed to turn green when the line touches the blue dot. The green dot should turn back to red when the line is no longer touching the blue dot.
    Attached Files Attached Files
    Last edited by darthjones; 11-23-2004 at 01:16 PM.

  2. #2
    Senior Member hum's Avatar
    Join Date
    Sep 2003
    Location
    CloudCuckooland
    Posts
    1,714
    Hi....

    This hitTest is judging the bounding box
    dimensions and distance .....not the content inside............
    so make smaller MCs within that act as the hit testers......
    in this example i have colored them red....
    here is your fla. updated..

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