dcsimg
A Flash Developer Resource Site

Results 1 to 3 of 3

Thread: [CS3] [AS2] Collision detection.

  1. #1
    Member
    Join Date
    Sep 2007
    Posts
    48

    [CS3] [AS2] Collision detection.

    Hello,

    I wanted to know if there is a way with which I can get the names of objects hitting another object.

    Suppose I have a box and three circles (draggable) on stage. Now, suppose user drags all three circles on the box, I get an Array with a list of their instance names...?

    I know how to detect collisions. mc.hitTest(mc2) etc. .. But the situation is that I have to get the a list of object's names which are currently touching the other specific object...

    is that possible?

  2. #2
    Banned deepakflash's Avatar
    Join Date
    Aug 2007
    Location
    [Object not found]
    Posts
    1,160
    use _name
    ie., as soon as the hitTest is fired use _parent._name (or) this._name

  3. #3
    Member
    Join Date
    Sep 2007
    Posts
    48
    I didn't really understand anything :s

    Can you kindly write a small example please? I 'REALLY' need to solve this trouble..

    I just want a kind of listener that tells me that some object was hit with, say, box_mc. The problem here is that I do not want to mention the name of the object that was hit with box_mc, I want to 'receive' that name. Whatever object hits box_mc, I want to know the name of the object. I cannot set hitTest untill I don't know the name of the object.

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