Duplicating a movie clip with the same instance name

When I have my movie clip duplicated, does the copy still have the same instance name? When I try to use hit test with the duplication, it doesnt work. :hat:

duplicate movieclip has parameter where you specify the new instance name. Whatever you put there is given as the new name of the duplicated clip

I did that and kept the same name, but still, only the original movie clip is able to do any actions.

show what youre using

The FLA?

what exactly are you trying to do?

Have the duplicated movie clip hit the face with the instance name ‘evil’ and have the face explode :). But, the instance name doesnt seem to follow onto the duplicate so hit testing isn’t going to take any effect.

well its there, but you really dont need it. you have code on the bullet itself, that carries over to each duplication. using this in that script will correctly reference that bullet, no matter what duplication it is. Then you can use this.hitTest(whatever) in that bullet script to do what you need to do

It’s still not working… Is there something wrong with this?

onClipEvent (load) {
if (_root.bullet.hitTest(_root.evil)) {
tellTarget (_root.evil) {
gotoAndPlay(21);
}
}
}

yes, you’re not doing what I said :wink: re-read the previous post

I tried what you said, but it still didn’t work. :hat:

Just keeping this thread alive… :-\

Keeping it alive more… I:-)

Ehm… :-\ Doo de doo…

To duplicate your instances…
[AS]
for (var i=0;i<numOfObjs;i++) {
_root.objName.duplicationMovieClip(“objName”+i, i);
}
[/AS]
That will duplicate the instances and change their names for you. That is the only way to use the duplicated instances, by changing their names…
:m:

:crazy: Thats confusing… Where do I put it? =/

I’ve been trying to solve someone elses problem just like this one on this thread:

http://www.kirupaforum.com/forums/showthread.php?s=&threadid=25422

It’s only a couple minutes old. What Jubba was saying earlier is that this code:
[AS]
onClipEvent (load) {
if (_root.bullet.hitTest(_root.evil)) {
tellTarget (_root.evil) {
gotoAndPlay(21);
}
}
}
[/AS]
Should be on your bullet like this:
[AS]
onClipEvent(enterFrame){
if(this.hitTest(_root.evil)){
_root.evil.gotoAndPlay(21);
}
}
[/AS]

Hope that helps…:smirk:

You put it in Frame1 in one of your layers…

Fred - I tried using that script and it works now, but theres one problem… When I shoot the bullet the hit test takes effect even though its not touching the face thing…

Could you post your fla again with the different code?