Skip to main content
Quinquefolius
Participant
February 16, 2010
Question

Hittest Multiple SAME Movie Clip Entities.

  • February 16, 2010
  • 1 reply
  • 651 views

By using the attachMovie function, I create multiple entities of the same movieClip. Is it possible to detect collisions from the same, but multiple movie clips (And, with different Linkage Identifiers with each entity of the same movieClip.) ?

Many thanks in advance.

This topic has been closed for replies.

1 reply

kglad
Community Expert
Community Expert
February 16, 2010

you can detect hitTest() between any two movieclips.

Quinquefolius
Participant
February 16, 2010

How am I going to refer to the same movieClip using hitTest?

Inspiring
February 16, 2010

Well you can't really test against the same movie clips. If they all have the same names how would flash know which one was hit? When you attach them you should give each one a unique name:

for(var i=0;i<numToAttach,i++){

  someClip.attachMovie("linkage","newName"+i,1000+i)

}

That is one way, especially if the number of them will remain fairly constant over time. If they are coming and going a lot, maybe you would want to push/remove them from an array and then test against the array.