A Flash Developer Resource Site

Results 1 to 4 of 4

Thread: (hitTest(x, y, true))

  1. #1
    Junior Member
    Join Date
    Feb 2003
    Posts
    8

    (hitTest(x, y, true))

    Question: Is there any way to make (hitTest(x, y, true)) or perhaps a work around work in 3dfa?
    Something other than .collideRect() ?
    To determine collision with the actual object and not the bounding box and not for like detecting the distance between balls?
    In other words, is there anyway to get (hitTest(x, y, true)) working in 3dfa?


    Thanks,
    Stephen

  2. #2
    KoolMoves Moderator blanius's Avatar
    Join Date
    Jul 2001
    Location
    Atlanta GA
    Posts
    5,244
    I think so but it would require you writing your own function. The one I showed for circle collisions should do what you want with little modification as it's main methods is to determine the distance between two objects. I'm sure if you really needed to dectect collision between two complex shapes it could be done, but basically it would require a fairly complex alogrythm where you check each corner and the path to the next corner of both objects. I can almost visualize it but I'm not a hard core programmer.

    Hard to imagine where you'd need this level of detection though. Perhaps if you shared what you are trying to do and perhaps there is a better solution.

  3. #3
    hates sounds in preloaders.
    Join Date
    Nov 2002
    Location
    Sweden
    Posts
    361
    Originally posted by blanius
    I think so but it would require you writing your own function. The one I showed for circle collisions should do what you want with little modification as it's main methods is to determine the distance between two objects. I'm sure if you really needed to dectect collision between two complex shapes it could be done, but basically it would require a fairly complex alogrythm where you check each corner and the path to the next corner of both objects. I can almost visualize it but I'm not a hard core programmer.

    Hard to imagine where you'd need this level of detection though. Perhaps if you shared what you are trying to do and perhaps there is a better solution.
    Anyway, we need the hitTest() function in 3DFA anyway. Could somebody mail support? I've got no antivirus program, so i aint touching my mail right now... :/
    hurg.

  4. #4
    KoolMoves Moderator blanius's Avatar
    Join Date
    Jul 2001
    Location
    Atlanta GA
    Posts
    5,244

    ??

    Perhaps you miss understand me. Hittest is RectCOllide.

    There really are only two ways in flash to detect collisions one on the bounding rec and the other would be by distance.

    Actually there is another way you could do it if you really must detect irregular shaped objects.

    You make your object a layer then underneath the visable object you place small rectangular objects that sort of build your object. Then you can test if ANY of those objects collide with the other object then hittest is true.

    Lets sat we have a butterfly image. We make some rectangles under it and then assign an array these rectangles we can then do a hit test like for a object ball is colliding with any of the small rectangles we do:

    hittest=ball.collideRect (b[0])||ball.collideRect (b[1])||ball.collideRect (b[2])||ball.collideRect (b[3])||ball.collideRect (b[4])

    as for Viruses Quit using Outlook and most of your worries about virus in email go away. I use the BEST email software and it's available FREE!!!!!! check out Pegasus Email
    Last edited by blanius; 08-25-2003 at 01:15 PM.

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